/* Mobile-First-Layout (Erlenwein). Basis = Smartphone, Erweiterungen ab Breakpoints (min-width).
   Breakpoints: md 768px, lg 992px, xl 1200px. Erzeugt aus der Migration der alten Bootstrap-3-Klassen. */
:root {
  --gutter: clamp(12px, 3vw, 30px);
  --space-s: clamp(12px, 3vw, 20px);
  --space-m: clamp(16px, 4vw, 30px);
  --space-l: clamp(20px, 5vw, 40px);
  --space-xl: clamp(28px, 8vw, 60px);
}

.space-top-s { margin-top: var(--space-s); }   .space-bottom-s { margin-bottom: var(--space-s); }
.space-top-m { margin-top: var(--space-m); }   .space-bottom-m { margin-bottom: var(--space-m); }
.space-top-l { margin-top: var(--space-l); }   .space-bottom-l { margin-bottom: var(--space-l); }
.space-top-xl { margin-top: var(--space-xl); } .space-bottom-xl { margin-bottom: var(--space-xl); }

/* Raster: ein Strang auf dem Smartphone, 12 Spalten ab Tablet */
.layout-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); align-items: start; }
.layout-grid--equal { align-items: stretch; }
.layout-grid__cell { min-width: 0; }
.layout-grid--equal > .layout-grid__cell > * { height: 100%; }

@media (min-width: 768px) {
  .layout-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .layout-grid__cell { grid-column: span 12; }
}

@media (min-width: 768px) {
  .layout-grid .g-md-1 { grid-column: span 1; }
  .layout-grid .g-md-2 { grid-column: span 2; }
  .layout-grid .g-md-3 { grid-column: span 3; }
  .layout-grid .g-md-4 { grid-column: span 4; }
  .layout-grid .g-md-5 { grid-column: span 5; }
  .layout-grid .g-md-6 { grid-column: span 6; }
  .layout-grid .g-md-7 { grid-column: span 7; }
  .layout-grid .g-md-8 { grid-column: span 8; }
  .layout-grid .g-md-9 { grid-column: span 9; }
  .layout-grid .g-md-10 { grid-column: span 10; }
  .layout-grid .g-md-11 { grid-column: span 11; }
  .layout-grid .g-offset-md-1 { grid-column-start: 2; }
  .layout-grid .g-offset-md-2 { grid-column-start: 3; }
  .layout-grid .g-offset-md-3 { grid-column-start: 4; }
  .layout-grid .g-offset-md-4 { grid-column-start: 5; }
  .layout-grid .g-offset-md-5 { grid-column-start: 6; }
  .layout-grid .g-offset-md-6 { grid-column-start: 7; }
  .layout-grid .g-offset-md-7 { grid-column-start: 8; }
  .layout-grid .g-offset-md-8 { grid-column-start: 9; }
  .layout-grid .g-offset-md-9 { grid-column-start: 10; }
  .layout-grid .g-offset-md-10 { grid-column-start: 11; }
  .layout-grid .g-offset-md-11 { grid-column-start: 12; }
}

@media (min-width: 992px) {
  .layout-grid .g-lg-1 { grid-column: span 1; }
  .layout-grid .g-lg-2 { grid-column: span 2; }
  .layout-grid .g-lg-3 { grid-column: span 3; }
  .layout-grid .g-lg-4 { grid-column: span 4; }
  .layout-grid .g-lg-5 { grid-column: span 5; }
  .layout-grid .g-lg-6 { grid-column: span 6; }
  .layout-grid .g-lg-7 { grid-column: span 7; }
  .layout-grid .g-lg-8 { grid-column: span 8; }
  .layout-grid .g-lg-9 { grid-column: span 9; }
  .layout-grid .g-lg-10 { grid-column: span 10; }
  .layout-grid .g-lg-11 { grid-column: span 11; }
}

@media (min-width: 1200px) {
  .layout-grid .g-xl-1 { grid-column: span 1; }
  .layout-grid .g-xl-2 { grid-column: span 2; }
  .layout-grid .g-xl-3 { grid-column: span 3; }
  .layout-grid .g-xl-4 { grid-column: span 4; }
  .layout-grid .g-xl-5 { grid-column: span 5; }
  .layout-grid .g-xl-6 { grid-column: span 6; }
  .layout-grid .g-xl-7 { grid-column: span 7; }
  .layout-grid .g-xl-8 { grid-column: span 8; }
  .layout-grid .g-xl-9 { grid-column: span 9; }
  .layout-grid .g-xl-10 { grid-column: span 10; }
  .layout-grid .g-xl-11 { grid-column: span 11; }
}

/* Seitenrahmen: Inhalt von Footer/Hauptbereich zentriert, mit seitlichem Abstand (mobil = Gutter) */
#footer > .inside, #main > .inside { width: 100%; max-width: 1220px; margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }

/* Fuss: Hintergrundflaechen ueber die volle Breite, Inhalt weiter auf Inhaltsbreite (Altsystem: durchgehende Farbflaeche) */
#footer .inside { max-width: none; padding-left: 0; padding-right: 0; }
#footer .footertop,
#footer .footerbottom {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: max(var(--gutter, 1rem), calc((100% - 1160px) / 2));
  padding-right: max(var(--gutter, 1rem), calc((100% - 1160px) / 2));
  box-sizing: border-box;
}

/* Text mit Bild: Umfluss wie im Altshop (float_left / float_right). Auf dem Smartphone steht das Bild fuer sich. */
.content-text.media { display: flow-root; }
.content-text.media > figure img { max-width: 100%; height: auto; }
@media (min-width: 768px) {
  .content-text.media--right > figure { float: right; max-width: 50%; margin: 4px 0 12px 34px; }
  .content-text.media--left > figure { float: left; max-width: 50%; margin: 4px 34px 12px 0; }
}
#main .content-text .rte ul { padding-left: 21px; }
#main .content-text .rte ul > li { list-style: disc; }
#main .content-text .rte ol { padding-left: 21px; }
#main .content-text .rte ol > li { list-style: decimal; }
#main .mod_newsreader h2 { color: #8fa69a; }

/* "Nach oben" wie im Altshop: gruenes Quadrat unten rechts, erscheint beim Scrollen (Klasse setzt nav.js) */
#footer a.to-top { position: fixed; right: 30px; bottom: 30px; z-index: 900; width: 30px; height: 30px; overflow: hidden; font-size: 0; background: #8fa69a; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
#footer a.to-top::after { content: ""; position: absolute; left: 11px; top: 12px; width: 7px; height: 7px; border: solid #fff; border-width: 2px 0 0 2px; transform: rotate(45deg); }
#footer a.to-top.is-visible { opacity: 1; visibility: visible; }
#footer a.to-top:focus-visible { outline: 3px solid #36424a; outline-offset: 2px; }
#footer :has(> ul > li > a.to-top) { margin: 0; padding: 0; line-height: 0; }
#footer ul:has(> li > a.to-top) { margin: 0; padding: 0; list-style: none; }

/* Tablet: Die Hauptspalte darf schmaler werden als ihr Inhalt (scrollende Kategorieleiste), sonst liegt die
   Seitenleiste mit dem Warenkorb ausserhalb des Bildschirms */
@media (min-width: 768px) { #main { min-width: 0; } }

/* Raster ohne Spaltenvorgaben (z. B. verschachtelt in einer schmalen Fussspalte) bleibt einspaltig: elf
   Spaltenabstaende allein waeren breiter als die Spalte */
@media (min-width: 768px) {
  .layout-grid:not(:has(> [class*=" g-"])) { grid-template-columns: minmax(0, 1fr); }
  .layout-grid:not(:has(> [class*=" g-"])) > .layout-grid__cell { grid-column: auto; }
}

/* Fuss auf Tablets zweispaltig, damit E-Mail- und Webadresse nicht umbrechen */
@media (min-width: 768px) and (max-width: 991.98px) {
  #footer .footertop > .layout-grid > .layout-grid__cell { grid-column: span 6; }
}
