/* Geschichte von hier: Farben aus Banner, Siegel und Karte im Video (geschichte/ortsnamen.py) */
:root {
  --wald: #161A13;
  --wald-2: #222819;
  --pergament: #EFE7D6;
  --papier: #FBF7EC;
  --tinte: #2E261C;
  --tinte-leise: #5E5244;
  --creme: #EFE7D6;
  --gold: #F6C544;
  --gold-dunkel: #8F6106;
  --siegel: #7B2A22;
  --siegel-hell: #93362C;
  --grenze: #8A7458;
  --linie: #D8CCB3;
  --serif: Georgia, "Times New Roman", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rand: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--siegel); text-underline-offset: 0.15em; }
a:hover { color: var(--siegel-hell); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 3.2vw + 1rem, 2.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.breite { width: min(1180px, 100% - 2 * var(--rand)); margin-inline: auto; }
.springen { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--wald); padding: 8px 14px; z-index: 10; font-family: var(--ui); }
.springen:focus { left: 8px; }

/* Schriftzug: Georgia fett, „Geschichte“ hell, „von hier“ gold (wie Banner und Schlusstafel) */
.schriftzug { font-family: var(--serif); font-weight: 700; color: var(--creme); letter-spacing: -0.01em; }
.schriftzug span { color: var(--gold); }
.schriftzug.gross { font-size: clamp(3rem, 7vw + 1rem, 6.2rem); line-height: 0.95; margin: 0 0 0.25em; }
.schriftzug.gross span { display: block; }

/* Kopf */
.kopf { background: var(--wald); border-bottom: 1px solid #2E3526; }
.kopf-zeile { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marke img { width: 40px; height: 40px; border-radius: 50%; }
.marke .schriftzug { font-size: 1.25rem; white-space: nowrap; }
.menue { display: flex; gap: 22px; margin-left: auto; font-family: var(--ui); font-size: 0.95rem; }
.menue a { color: #CFC7B5; text-decoration: none; }
.menue a:hover { color: var(--gold); }
@media (max-width: 760px) { .menue { display: none; } .kopf .knopf { margin-left: auto; } }
@media (max-width: 380px) { .marke .schriftzug { font-size: 1.05rem; } .kopf-zeile { gap: 10px; } }

/* Knöpfe */
.knoepfe { display: flex; flex-wrap: wrap; gap: 12px; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--ui); font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; line-height: 1.2;
  transition: background-color .15s, color .15s, border-color .15s;
}
.knopf.klein { min-height: 40px; padding: 6px 16px; font-size: 0.9rem; }
.knopf-gold { background: var(--gold); color: var(--wald); }
.knopf-gold:hover { background: #FFD766; color: var(--wald); }
.knopf-hell { border-color: rgba(239, 231, 214, .55); color: var(--creme); }
.knopf-hell:hover { border-color: var(--gold); color: var(--gold); }
.knopf-rot { background: var(--siegel); color: #FFF7EA; }
.knopf-rot:hover { background: var(--siegel-hell); color: #fff; }
.dreieck { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.dauer { font-weight: 400; opacity: .75; }

.dachzeile { font-family: var(--ui); font-size: 0.8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.8em; }
.dachzeile.dunkel { color: var(--gold-dunkel); }
.einleitung { font-size: 1.1em; color: var(--tinte-leise); max-width: 62ch; }

/* Bühne */
.buehne { position: relative; background: var(--wald); color: var(--creme); overflow: hidden; isolation: isolate; }
.buehne-bild { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; z-index: -2; }
.buehne::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(22,26,19,0) 20%, rgba(22,26,19,.55) 45%, rgba(22,26,19,.9) 68%), linear-gradient(0deg, rgba(22,26,19,.7), rgba(22,26,19,0) 35%);
}
.buehne-text { min-height: min(78vh, 640px); display: flex; flex-direction: column; justify-content: center; padding-block: 64px; padding-left: 46%; }
.motto { font-size: clamp(1.2rem, 1vw + 1rem, 1.55rem); margin-bottom: 0.7em; }
.fragen { color: #D9D0BD; max-width: 46ch; margin-bottom: 1.6em; }
@media (max-width: 900px) {
  .buehne-bild { position: static; height: auto; aspect-ratio: 16 / 9; object-position: 20% 50%; }
  .buehne::after { display: none; }
  .buehne-text { min-height: 0; padding: 28px 0 44px; }
  .schriftzug.gross span { display: inline; }
}

/* Abschnitte */
.abschnitt { padding-block: clamp(56px, 8vw, 104px); }
.pergament { background: var(--pergament); }
.wald { background: var(--wald); color: var(--creme); }

/* Wie endet dein Ort? */
.ort-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
/* Am Handy: Suchfeld, dann Karte, dann Erklärung (sonst sieht man die Markierung erst nach langem Scrollen) */
@media (max-width: 900px) {
  .ort-raster { grid-template-columns: 1fr; row-gap: 0; }
  .ort-links { display: contents; }
  .karte-rahmen { order: 1; margin-bottom: 20px; }
  .ergebnis { order: 2; }
}

.suche { margin: 28px 0 20px; }
.suche label { display: block; font-family: var(--ui); font-weight: 700; font-size: .95rem; margin-bottom: 8px; }
.suche-feld { position: relative; display: flex; gap: 8px; }
.suche input {
  flex: 1; min-width: 0; min-height: 52px; padding: 10px 16px; font: inherit; font-size: 1.15rem;
  border: 2px solid var(--grenze); border-radius: 12px; background: var(--papier); color: var(--tinte);
}
.suche input:focus { outline: none; border-color: var(--siegel); box-shadow: 0 0 0 4px rgba(246, 197, 68, .45); }
.vorschlaege {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 14px 34px rgba(46, 38, 28, .18);
  max-height: 340px; overflow-y: auto;
}
.vorschlaege li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.vorschlaege li[aria-selected="true"], .vorschlaege li:hover { background: var(--pergament); }
.vorschlaege .mal { font-family: var(--ui); font-size: .85rem; color: var(--tinte-leise); white-space: nowrap; }
.vorschlaege .ende { font-weight: 700; }
.suche-hilfe { font-family: var(--ui); font-size: .92rem; color: var(--tinte-leise); margin-top: 12px; line-height: 2.1; }
.beispiel {
  font: inherit; color: var(--tinte); background: var(--papier); border: 1px solid var(--linie); border-radius: 999px;
  padding: 3px 12px; cursor: pointer; margin-right: 2px;
}
.beispiel:hover { border-color: var(--grenze); }

.ergebnis { min-height: 120px; }
.ergebnis-leer { color: var(--tinte-leise); border-left: 3px solid var(--linie); padding-left: 16px; }
.karteikarte {
  background: var(--papier); border: 1px solid var(--linie); border-radius: 14px; padding: 22px 24px 18px;
  box-shadow: 0 2px 0 var(--linie); border-top: 6px solid var(--farbe, var(--grenze));
  animation: auf .25s ease-out;
}
@keyframes auf { from { opacity: 0; transform: translateY(6px); } }
.karteikarte .ortsname { font-size: clamp(1.7rem, 2vw + 1rem, 2.3rem); font-weight: 700; margin: 0 0 2px; overflow-wrap: anywhere; }
.karteikarte .ortsname mark { background: none; color: var(--farbe, var(--siegel)); }
.karteikarte .bedeutung { font-family: var(--ui); font-weight: 700; color: var(--tinte-leise); margin-bottom: .9em; }
.karteikarte .endung-zeichen { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--farbe); color: #fff; margin-right: 6px; }
.karteikarte .folgezitat { background: var(--pergament); border-radius: 10px; padding: 12px 14px; margin: 0 0 1em; }
.karteikarte .folgezitat b { font-family: var(--ui); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dunkel); display: block; margin-bottom: 2px; }
.karteikarte .vorsicht { border-left: 3px solid var(--siegel); padding-left: 12px; }
.karteikarte .klein { font-family: var(--ui); font-size: .88rem; color: var(--tinte-leise); margin: 0; }

/* Karte */
.karte-rahmen { margin: 0; }
.karte { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--linie); background: #D9E3E6; }
.karte img, .karte canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.karte-punkte { transition: opacity .35s; }
.karte.fokus .karte-punkte { opacity: .16; }
.karte-laden { position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(251, 247, 236, .92); font-family: var(--ui); font-size: .85rem; }
.legende { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.legende button {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--ui); font-size: .9rem; color: var(--tinte);
  background: var(--papier); border: 1px solid var(--linie); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer; min-height: 38px;
}
.legende button::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--farbe); }
.legende button .zahl { color: var(--tinte-leise); }
.legende button[aria-pressed="true"] { border-color: var(--farbe); box-shadow: inset 0 0 0 1px var(--farbe); background: #fff; }
.karte-rahmen figcaption { font-family: var(--ui); font-size: .82rem; color: var(--tinte-leise); line-height: 1.5; }
.karte-rahmen figcaption a { color: inherit; }

/* Folgen */
.folgen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
@media (max-width: 980px) { .folgen { grid-template-columns: 1fr; max-width: 640px; } }
.folge { background: #fff; border: 1px solid var(--linie); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.folge-bild { aspect-ratio: 16 / 9; overflow: hidden; background: var(--pergament); }
.folge-bild img { width: 100%; height: 100%; object-fit: cover; }
.holzschnitt { background: #F3EEE2; }
.holzschnitt img { object-position: 50% 50%; mix-blend-mode: multiply; filter: sepia(.35); }
.folge-text { padding: 20px 22px 22px; }
.folge-text p { color: var(--tinte-leise); }
.folge-text p:last-child { margin-bottom: 0; }
.etikett { font-family: var(--ui); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-dunkel) !important; margin-bottom: .5em; }
.bildnachweis { font-family: var(--ui); font-size: .78rem; }

/* Stempelbild für die Redewendungen */
.stempelbild {
  position: relative; background: var(--pergament);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(138, 116, 88, .16) 31px 32px);
  display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 10px 14px; padding: 18px 22px;
}
.wendung { font-style: italic; font-size: clamp(1rem, 1.4vw + .6rem, 1.2rem); align-self: center; }
.stempel {
  font-family: var(--ui); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem;
  border: 2.5px solid currentColor; border-radius: 6px; padding: 3px 9px; transform: rotate(-6deg); justify-self: start; opacity: .9;
}
.s-stimmt { color: #3F7A3F; }
.s-legende { color: var(--siegel); transform: rotate(4deg); }
.s-offen { color: #7A6A2A; }

/* So arbeiten wir */
.so-raster { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .so-raster { grid-template-columns: 1fr; } }
.trailer { position: relative; display: block; border-radius: 16px; overflow: hidden; color: var(--creme); text-decoration: none; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.trailer img { width: 100%; transition: transform .4s; }
.trailer:hover img { transform: scale(1.03); }
.trailer-knopf {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--gold); display: grid; place-items: center; color: var(--wald);
}
.trailer-knopf .dreieck { border-left-width: 15px; border-top-width: 9px; border-bottom-width: 9px; margin-left: 4px; }
.trailer-zeile {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 36px 16px 14px; font-family: var(--ui); font-weight: 650; background: linear-gradient(0deg, rgba(22,26,19,.92) 40%, transparent);
}
.trailer:hover { color: var(--gold); }
.grundsaetze { list-style: none; margin: 0 0 28px; padding: 0; }
.grundsaetze li { padding: 12px 0 12px 34px; border-top: 1px solid #343B2B; position: relative; color: #D9D0BD; }
.grundsaetze li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 12px; height: 12px; border-radius: 50%; background: var(--siegel-hell); box-shadow: 0 0 0 3px rgba(246, 197, 68, .35); }
.grundsaetze strong { color: var(--creme); }

/* Fuß */
.fuss { background: #0F120D; color: #A99F8C; padding-block: 32px; font-family: var(--ui); font-size: .92rem; }
.fuss-raster { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.fuss-marke { margin: 0; font-size: 1.2rem; }
.fuss nav { display: flex; gap: 20px; flex-wrap: wrap; }
.fuss a { color: #CFC7B5; }
.fuss a:hover { color: var(--gold); }

/* Textseiten (Impressum, Datenschutz, 404) */
.text-seite { width: min(760px, 100% - 2 * var(--rand)); margin-inline: auto; padding-block: 48px 72px; }
.text-seite h1 { font-size: clamp(2rem, 3vw + 1rem, 2.8rem); }
.text-seite h2 { font-size: 1.3rem; margin-top: 1.8em; }
.text-seite .kurz { background: var(--pergament); border-radius: 12px; padding: 16px 18px; }
.text-seite .stand { font-family: var(--ui); font-size: .88rem; color: var(--tinte-leise); margin-top: 2.5em; }
