/* Author: Geronemo | Company: GK DigitalStudio UG */
/* UrbanBooks Doku: Papier, Tinte, Petrol. Werte auf dem 4-px-Raster. */

@font-face {
  font-family: "Geist";
  src: url("schrift/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("schrift/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --papier: #f6f4ee;
  --blatt: #fffef9;
  --flaeche: #eeeae1;
  --linie: rgba(28, 42, 37, 0.1);
  --linie-stark: rgba(28, 42, 37, 0.16);
  --tinte: #1c2a25;
  --tinte-2: #4a5550;
  --tinte-3: #646d68;
  --akzent: #0b3f38;
  --akzent-zart: rgba(11, 63, 56, 0.1);
  --achtung: #9b2c2c;
  --kopf: rgba(246, 244, 238, 0.88);
  --schatten: 0 1px 2px rgba(28, 42, 37, 0.05);
  --schatten-schwebend: 0 8px 24px rgba(28, 42, 37, 0.08);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --kurve: cubic-bezier(0.22, 1, 0.36, 1);
  --kopfhoehe: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #151715;
    --blatt: #1c1f1d;
    --flaeche: #242826;
    --linie: rgba(236, 233, 225, 0.09);
    --linie-stark: rgba(236, 233, 225, 0.16);
    --tinte: #ece9e1;
    --tinte-2: #b1b5ae;
    --tinte-3: #8f948d;
    --akzent: #7cc4b5;
    --akzent-zart: rgba(124, 196, 181, 0.12);
    --achtung: #e8877f;
    --kopf: rgba(21, 23, 21, 0.86);
    --schatten: none;
    --schatten-schwebend: 0 8px 24px rgba(0, 0, 0, 0.32);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopfhoehe) + 24px); }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 400 16px/26px var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--akzent) 40%, transparent); transition: color 150ms var(--kurve), text-decoration-color 150ms var(--kurve), background-color 150ms var(--kurve); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.875em; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.sprung { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: 8px; background: var(--akzent); color: var(--papier); text-decoration: none; }
.sprung:focus { top: 8px; }

/* Kopfleiste */
.kopf {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: var(--kopfhoehe); padding: 0 24px;
  background: var(--kopf);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 8px; color: var(--tinte); text-decoration: none; font-size: 16px; line-height: 1; white-space: nowrap; width: 232px; flex: none; }
.marke img { display: block; }
.marke-name { font-weight: 600; }
.marke-zusatz { color: var(--tinte-3); font-weight: 400; }
.menue-knopf { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: -8px; border: 0; border-radius: 8px; background: transparent; color: var(--tinte); cursor: pointer; }
.menue-knopf:hover { background: var(--flaeche); }
.zur-app { margin-left: auto; font-size: 14px; color: var(--tinte-2); text-decoration: none; white-space: nowrap; padding: 8px 12px; border-radius: 8px; }
.zur-app:hover { color: var(--tinte); background: var(--flaeche); }

/* Suche */
.suche { position: relative; display: flex; align-items: center; width: min(400px, 100%); }
.suche-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--tinte-3); pointer-events: none; }
.suche input {
  width: 100%; height: 36px; padding: 0 40px 0 36px;
  border: 1px solid var(--linie-stark); border-radius: 8px;
  background: var(--blatt); color: var(--tinte);
  font: 400 14px/20px var(--sans);
  transition: border-color 150ms var(--kurve), box-shadow 150ms var(--kurve);
  -webkit-appearance: none; appearance: none;
}
.suche input::placeholder { color: var(--tinte-3); }
.suche input:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-zart); }
.suche input::-webkit-search-cancel-button { display: none; }
.taste { position: absolute; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border: 1px solid var(--linie-stark); border-radius: 4px; background: var(--papier); color: var(--tinte-3); font: 400 12px/18px var(--mono); text-align: center; pointer-events: none; }
.suche input:focus ~ .taste { opacity: 0; }

.suchergebnis {
  position: absolute; top: 44px; left: 0; width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px; border: 1px solid var(--linie); border-radius: 12px;
  background: var(--blatt); box-shadow: var(--schatten-schwebend);
  animation: aufklappen 180ms var(--kurve);
}
.suchergebnis a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--tinte); text-decoration: none; }
.suchergebnis a[aria-selected="true"], .suchergebnis a:hover { background: var(--flaeche); }
.treffer-titel { display: block; font-size: 14px; line-height: 20px; font-weight: 500; }
.treffer-ort { display: block; font: 400 12px/16px var(--mono); color: var(--tinte-3); margin-top: 2px; }
.treffer-text { display: block; font-size: 13px; line-height: 20px; color: var(--tinte-2); margin-top: 4px; }
.suchergebnis mark { background: var(--akzent-zart); color: inherit; border-radius: 2px; padding: 0 1px; }
.suche-leer { margin: 0; padding: 12px; font-size: 14px; color: var(--tinte-2); }

@keyframes aufklappen { from { transform: translateY(-4px); } }

/* Rahmen, Seitenleiste */
.rahmen { display: grid; grid-template-columns: 264px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.seitenleiste {
  position: sticky; top: var(--kopfhoehe); align-self: start;
  height: calc(100vh - var(--kopfhoehe)); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 48px 24px;
  border-right: 1px solid var(--linie);
}
.nav-gruppe h2 { margin: 24px 0 8px 12px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tinte-3); }
.nav-gruppe:first-child h2 { margin-top: 8px; }
.nav-gruppe ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-gruppe a {
  display: flex; align-items: center; min-height: 32px; padding: 6px 12px;
  border-radius: 8px; color: var(--tinte-2); text-decoration: none;
  font-size: 14px; line-height: 20px;
}
.nav-gruppe a:hover { color: var(--tinte); background: var(--flaeche); }
.nav-gruppe a[aria-current="page"] { color: var(--tinte); background: var(--flaeche); font-weight: 500; box-shadow: inset 0 0 0 1px var(--linie); }
.schleier { display: none; }

/* Hauptbereich */
.haupt { display: grid; grid-template-columns: minmax(0, 720px) 208px; gap: 64px; justify-content: center; padding: 40px 32px 96px; min-width: 0; }
.haupt:focus { outline: none; }
.artikel { min-width: 0; animation: aufgehen 300ms var(--kurve); }
@keyframes aufgehen { from { transform: translateY(6px); } }

.artikel-kopf { margin-bottom: 32px; }
.bereich { margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tinte-3); }
.bereich:empty { display: none; }
h1 { margin: 0; font-size: 36px; line-height: 42px; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.kurz { margin: 12px 0 0; max-width: 36rem; font-size: 18px; line-height: 28px; color: var(--tinte-2); text-wrap: pretty; }
.kurz:empty { display: none; }

/* Signatur: Bonfuß mit Abrisskante */
.stand {
  display: inline-block; margin: 20px 0 0; padding: 14px 12px 8px;
  background: var(--blatt); color: var(--tinte-3);
  font: 400 12px/16px var(--mono);
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
}
.stand-ueberarbeitung { color: var(--achtung); }

/* Fließtext */
.text > :first-child { margin-top: 0; }
.text p { margin: 0 0 16px; text-wrap: pretty; }
.text h2 { position: relative; margin: 48px 0 12px; font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: -0.005em; }
.text h3 { position: relative; margin: 32px 0 8px; font-size: 17px; line-height: 24px; font-weight: 500; }
.anker { position: absolute; left: -24px; width: 16px; color: var(--tinte-3); text-decoration: none; opacity: 0; transition: opacity 150ms var(--kurve); }
h2:hover > .anker, h3:hover > .anker { opacity: 1; }
.text strong { font-weight: 560; color: var(--tinte); }
.text code { font: 400 0.875em/1 var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--flaeche); }
.text ul { margin: 0 0 16px; padding-left: 20px; }
.text ul li { margin: 0 0 8px; padding-left: 4px; }
.text ul li::marker { color: var(--tinte-3); }

ol.schritte { list-style: none; counter-reset: schritt; margin: 0 0 24px; padding: 0; }
ol.schritte li { position: relative; counter-increment: schritt; margin: 0 0 12px; padding-left: 40px; }
ol.schritte li::before {
  content: counter(schritt); position: absolute; left: 0; top: 3px;
  width: 24px; height: 20px; border-radius: 4px; background: var(--flaeche);
  font: 500 12px/20px var(--mono); color: var(--tinte-2); text-align: center;
  font-variant-numeric: tabular-nums;
}

.bild { margin: 24px 0 32px; padding: 8px; border: 1px solid var(--linie); border-radius: 12px; background: var(--blatt); box-shadow: var(--schatten); }
.bild img { display: block; width: 100%; height: auto; border-radius: 4px; }
.bild figcaption { padding: 8px 4px 0; font-size: 13px; line-height: 20px; color: var(--tinte-3); }

.hinweis { margin: 24px 0; padding: 16px 20px; border-radius: 12px; background: var(--flaeche); }
.hinweis p { margin: 0; font-size: 15px; line-height: 24px; }
.hinweis p + p { margin-top: 8px; }
.hinweis .hinweis-art { margin: 0 0 4px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tinte-2); }
.hinweis-achtung .hinweis-art { color: var(--achtung); }
.hinweis-ungeprueft { background: transparent; box-shadow: inset 0 0 0 1px var(--linie-stark); }

.tabelle { margin: 0 0 24px; overflow-x: auto; }
.tabelle table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.tabelle th { padding: 8px 12px 8px 0; text-align: left; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tinte-2); border-bottom: 1px solid var(--linie-stark); }
.tabelle td { padding: 10px 12px 10px 0; vertical-align: top; border-bottom: 1px solid var(--linie); }

/* Weiterlesen */
.nachbarn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--linie); }
.nachbar { display: block; padding: 12px 16px; border: 1px solid var(--linie); border-radius: 10px; color: var(--tinte); text-decoration: none; font-size: 15px; line-height: 22px; font-weight: 500; }
.nachbar span { display: block; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--tinte-3); }
.nachbar:hover { background: var(--blatt); border-color: var(--linie-stark); }
.nachbar.weiter { text-align: right; grid-column: 2; }

/* Auf dieser Seite */
.auf-seite { position: sticky; top: calc(var(--kopfhoehe) + 40px); align-self: start; max-height: calc(100vh - var(--kopfhoehe) - 80px); overflow-y: auto; }
.auf-seite h2 { margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tinte-3); }
.auf-seite ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--linie); }
.auf-seite a { display: block; margin-left: -1px; padding: 4px 0 4px 12px; border-left: 1px solid transparent; color: var(--tinte-2); text-decoration: none; font-size: 13px; line-height: 20px; }
.auf-seite a:hover { color: var(--tinte); }
.auf-seite a.ist-hier { color: var(--tinte); border-left-color: var(--akzent); }

/* Fuß */
.fuss { display: flex; flex-wrap: wrap; gap: 8px 24px; max-width: 1440px; margin: 0 auto; padding: 24px 32px 40px 312px; border-top: 1px solid var(--linie); font-size: 13px; line-height: 20px; color: var(--tinte-3); }
.fuss p { margin: 0; }
.fuss a { color: var(--tinte-2); margin-right: 16px; }

/* Startseite */
.seite-start .haupt { grid-template-columns: minmax(0, 1040px); }
.seite-start .artikel { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 64px; align-items: center; }
.seite-start .artikel-kopf { margin: 0; }
.seite-start h1 { font-size: 48px; line-height: 52px; letter-spacing: -0.02em; max-width: 14ch; }
.seite-start .kurz { margin-top: 16px; }
.seite-start .stand { display: none; }
.seite-start .text { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; column-gap: 48px; margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--linie); }
.seite-start .text h2 { margin: 0 0 12px; font-size: 18px; line-height: 24px; }
.seite-start .text h2 .anker { display: none; }
.seite-start .text ul { list-style: none; padding: 0; margin: 0; }
.seite-start .text ul li { padding: 0; margin: 0 0 8px; }
.seite-start .text a { text-decoration: none; }
.seite-start .text a:hover { text-decoration: underline; text-decoration-color: currentColor; }

.bon {
  position: relative; width: 100%; max-width: 400px; justify-self: end;
  padding: 28px 28px 44px;
  background: #fffef9; color: #1c2a25;
  font: 400 13px/20px var(--mono); font-variant-numeric: tabular-nums;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
  filter: drop-shadow(0 8px 24px rgba(28, 42, 37, 0.1));
  transform: rotate(-1deg);
}
.bon p { margin: 0; }
.bon-kopf { text-align: center; font-size: 15px; font-weight: 500; }
.bon-meta { text-align: center; color: #5b645f; margin-top: 4px !important; }
.bon-liste { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px dashed rgba(28, 42, 37, 0.32); display: grid; gap: 4px; }
.bon-liste a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; margin: 0 -8px; padding: 8px; border-radius: 6px; color: inherit; text-decoration: none; }
.bon-liste a:hover { background: rgba(28, 42, 37, 0.06); }
.bon-posten { font-weight: 500; font-size: 14px; }
.bon-menge { color: #5b645f; }
.bon-text { grid-column: 1 / -1; color: #5b645f; font-size: 12px; line-height: 18px; }
.bon-summe { display: flex; justify-content: space-between; margin-top: 16px !important; padding-top: 12px; border-top: 1px dashed rgba(28, 42, 37, 0.32); font-weight: 500; }
.bon-fuss { margin-top: 20px !important; text-align: center; color: #5b645f; font-size: 12px; line-height: 18px; }

/* Schmalere Fenster */
@media (max-width: 1279px) {
  .haupt { grid-template-columns: minmax(0, 720px); }
  .auf-seite { display: none; }
}

@media (max-width: 1023px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); }
  .menue-knopf { display: inline-flex; }
  .marke { width: auto; }
  .seitenleiste {
    position: fixed; top: var(--kopfhoehe); left: 0; z-index: 25;
    width: min(320px, 86vw); height: calc(100dvh - var(--kopfhoehe));
    background: var(--papier); border-right: 1px solid var(--linie);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 320ms var(--kurve), visibility 0s linear 320ms;
  }
  .offen .seitenleiste { transform: none; visibility: visible; transition: transform 320ms var(--kurve), visibility 0s; }
  .schleier { display: block; position: fixed; inset: var(--kopfhoehe) 0 0 0; z-index: 20; background: rgba(15, 20, 18, 0.24); opacity: 0; transition: opacity 240ms var(--kurve); }
  .offen .schleier { opacity: 1; }
  .schleier[hidden] { display: none; }
  .fuss { padding-left: 32px; }
  .seite-start .artikel { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .seite-start .bon { justify-self: start; }
}

@media (max-width: 767px) {
  body { font-size: 16px; line-height: 26px; }
  .kopf { gap: 8px; padding: 0 16px; }
  .marke-zusatz, .zur-app { display: none; }
  .suche { flex: 1; }
  .suchergebnis { position: fixed; top: calc(var(--kopfhoehe) + 4px); left: 16px; right: 16px; width: auto; }
  .taste { display: none; }
  .haupt { padding: 32px 16px 80px; }
  h1 { font-size: 30px; line-height: 36px; }
  .seite-start h1 { font-size: 36px; line-height: 40px; }
  .kurz { font-size: 17px; line-height: 26px; }
  .text h2 { margin-top: 40px; font-size: 20px; line-height: 26px; }
  .anker { display: none; }
  .bild { margin-left: -8px; margin-right: -8px; padding: 4px; border-radius: 8px; }
  .bild img { border-radius: 4px; }
  .nachbarn { grid-template-columns: minmax(0, 1fr); }
  .nachbar.weiter { grid-column: 1; }
  .fuss { padding: 24px 16px 40px; }
  .seite-start .text { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-template-rows: none; row-gap: 8px; margin-top: 48px; }
  .seite-start .text h2 { margin-top: 24px; }
  .bon { padding: 24px 20px 40px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .kopf { background: var(--papier); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media print {
  .kopf, .seitenleiste, .auf-seite, .nachbarn, .fuss, .sprung { display: none !important; }
  .rahmen, .haupt { display: block; padding: 0; }
  body { background: #fff; color: #000; }
}
