@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/literata.woff2) format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/literata-italic.woff2) format("woff2");
}

:root {
  /* Farben angelehnt an die Website des Blauen Rathauses */
  --paper: #FFFFFF;
  --surface: #F3F8FA;
  --ink: #272727;
  --muted: #516C77;       /* Menütext der Website */
  --line: #D5E5EB;
  --accent: #036690;      /* Dunkelblau: Überschriften, Kasten „Aktuelles“ */
  --accent-ink: #FFFFFF;
  --gold: #0290C9;        /* Hellblau: besuchte Stationen, Hervorhebungen */
  --quote-bg: #E8F2F6;
  --me: #D9572B;          /* eigener Standort, bewusst kein Blau */
  --bar: #8CBBCB;         /* Graublau der Seitenleiste */
  --bar-ink: #24434F;
  --bar-active: #012E44;
  --shadow: 0 1px 2px rgba(3, 40, 58, .08), 0 6px 20px rgba(3, 40, 58, .10);

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: 20px;
  --measure: 38rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1A20;
    --surface: #14252D;
    --ink: #E6EEF1;
    --muted: #9DB6C0;
    --line: #23404B;
    --accent: #5BB9E2;
    --accent-ink: #052131;
    --gold: #8CBBCB;
    --quote-bg: #172F39;
    --me: #F08458;
    --bar: #14252D;
    --bar-ink: #9DB6C0;
    --bar-active: #8CD2F0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1A20; --surface: #14252D; --ink: #E6EEF1; --muted: #9DB6C0; --line: #23404B;
  --accent: #5BB9E2; --accent-ink: #052131; --gold: #8CBBCB; --quote-bg: #172F39; --me: #F08458;
  --bar: #14252D; --bar-ink: #9DB6C0; --bar-active: #8CD2F0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

main {
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
}
main:focus { outline: none; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1, h2 { color: var(--accent); }
.hero h1 { color: #fff; }
h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.muted { color: var(--muted); }

/* ---------- Kopfzeile Unterseiten ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 8px) 12px 8px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 15px;
}
.topbar .title { font-family: var(--serif); font-weight: 600; font-size: 17px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none;
}
.iconbtn:hover { background: var(--quote-bg); }

/* ---------- Start ---------- */
.hero {
  position: relative; min-height: 62dvh;
  display: grid; align-items: end;
  color: #fff; background: #052131;
  overflow: hidden;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,30,44,.10) 30%, rgba(2,30,44,.88) 100%); }
.hero .wrap { position: relative; z-index: 1; padding-top: 32px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
.hero .sub { font-style: italic; font-size: 1.15rem; margin-top: 6px; opacity: .92; }
.hero .info { position: absolute; top: calc(var(--safe-t) + 8px); right: 8px; z-index: 2; color: #fff; }

.intro { padding-top: 28px; }
.intro p:first-child { font-size: 1.1rem; }
.facts { display: flex; gap: 24px; margin: 8px 0 28px; font-family: var(--sans); font-size: 15px; color: var(--muted); flex-wrap: wrap; }
.facts strong { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--ink); font-weight: 600; line-height: 1.1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: grid; gap: 12px; margin: 8px 0 32px; }
@media (min-width: 520px) { .btn-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Stationsliste ---------- */
.list { list-style: none; margin: 0; padding: 8px 0 0; }
.list li + li { border-top: 1px solid var(--line); }
.list a {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 0; color: inherit; text-decoration: none;
}
.list .thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--line); }
.list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list .thumb .num { position: absolute; left: 4px; top: 4px; }
.list h3 { font-size: 1.05rem; }
.list .addr { display: block; font-family: var(--sans); font-size: 14px; line-height: 1.35; color: var(--muted); margin-top: 4px; }
.list .dist { font-family: var(--sans); font-size: 14px; color: var(--muted); white-space: nowrap; text-align: right; }
.list .done { color: var(--gold); }
.list-sep { font-family: var(--sans); font-size: 14px; color: var(--muted); padding: 24px 0 4px; border-top: 1px solid var(--line); margin-top: 8px; }

.num {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--sans); font-size: 14px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.num.visited { background: var(--gold); }
.num.lg { width: 40px; height: 40px; font-size: 17px; flex: none; }

/* ---------- Station ---------- */
.station-hero { margin: 0; background: var(--line); }
.station-hero img { width: 100%; max-height: 58dvh; object-fit: cover; cursor: zoom-in; }
.caption { font-size: 14px; line-height: 1.45; color: var(--muted); font-style: italic; padding: 8px var(--gutter) 0; max-width: var(--measure); margin: 0 auto; }

.station-head { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; }
.station-head h1 { font-size: clamp(1.6rem, 6vw, 2rem); }
.station-head .addr { font-family: var(--sans); font-size: 15px; color: var(--muted); margin-top: 4px; }
.today { font-family: var(--sans); font-size: 15px; margin: 14px 0 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.today b { font-weight: 600; }

.actions { display: flex; gap: 8px; margin: 18px 0 24px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 15px; text-decoration: none; cursor: pointer;
}
.chip svg { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .live { color: var(--muted); }

.body p { font-size: 1.05rem; }

.people { margin: 8px 0 28px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.people li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.people b { display: block; font-weight: 600; }
.people span { font-family: var(--sans); font-size: 15px; color: var(--muted); }

.memory { margin: 28px 0; padding: 20px 22px; background: var(--quote-bg); border-radius: 14px; border-left: 4px solid var(--gold); }
.memory p { font-style: italic; margin: 0 0 12px; }
.memory footer { font-family: var(--sans); font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.memory footer img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.note { font-family: var(--sans); font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--gutter) 12px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .gallery { grid-auto-columns: 46%; } }
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery button { padding: 0; border: 0; background: var(--line); border-radius: 10px; overflow: hidden; width: 100%; aspect-ratio: 4/3; cursor: zoom-in; display: block; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { font-size: 13px; line-height: 1.4; color: var(--muted); margin-top: 6px; font-style: italic; }
.section-title { margin: 32px 0 12px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 36px 0 8px; }
.pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink); background: var(--surface); min-height: 76px;
}
.pager a.next { text-align: right; }
.pager small { display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.pager span { font-weight: 600; line-height: 1.3; display: block; margin-top: 2px; }

/* ---------- Geschichte ---------- */
.page-head { padding-top: 24px; padding-bottom: 8px; }
.page-head p { color: var(--muted); margin-top: 10px; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 26px 34px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline .year { font-weight: 700; font-size: 1.15rem; color: var(--accent); display: block; }
.timeline p { margin: 2px 0 0; }
.timeline figure { margin: 12px 0 0; }
.timeline figure button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.timeline figure img { border-radius: 10px; max-height: 260px; width: 100%; object-fit: cover; }
.timeline figcaption { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 6px; line-height: 1.4; }

/* ---------- Gedenken ---------- */
.names { list-style: none; margin: 0 0 8px; padding: 0; }
.names li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.names .n { font-size: 1.2rem; font-weight: 600; }
.names .d { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.names p { margin: 6px 0 0; }
.names a { font-family: var(--sans); font-size: 15px; display: inline-block; margin-top: 6px; }
.group-title { margin: 32px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.candle { display: grid; place-items: center; margin: 32px 0 0; color: var(--gold); }
.candle svg { width: 36px; height: 36px; }

/* ---------- Info ---------- */
.info-list { padding-left: 1.2em; }
.info-list li { margin-bottom: 6px; }

/* ---------- Karte ---------- */
.map-view { position: fixed; inset: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 1; }
#map { position: absolute; inset: 0; background: var(--paper); }
.leaflet-container { font-family: var(--sans); }
.map-locate {
  position: absolute; right: 12px; top: calc(var(--safe-t) + 12px); z-index: 500;
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  display: grid; place-items: center;
}
.map-locate.active { color: var(--me); }
.map-locate circle:first-child { fill: currentColor; }

.pin {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font: 700 15px/1 var(--sans);
  border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transition: transform .15s ease;
}
.pin.visited { background: var(--gold); }
.pin.side { background: var(--muted); }
.pin.selected { transform: scale(1.25); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--me); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--me) 25%, transparent); }

.map-card {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500;
  max-width: 520px; margin: 0 auto;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 12px;
  color: var(--ink); text-decoration: none;
}
.map-card img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; }
.map-card h3 { font-size: 1.05rem; margin-top: 2px; }
.map-card .meta { font-family: var(--sans); font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.map-card .go { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--accent); margin-top: 6px; display: inline-block; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--bar); border-top: 1px solid color-mix(in srgb, var(--bar) 70%, #000);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--bar-ink); text-decoration: none; font-family: var(--sans); font-size: 11.5px; position: relative; font-weight: 500; min-width: 0;
}
.tabbar a[aria-current="page"] { color: var(--bar-active); font-weight: 700; }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--bar-active); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 12px; right: 12px; top: calc(var(--safe-t) + 12px); z-index: 900;
  max-width: 520px; margin: 0 auto;
  background: var(--ink); color: var(--paper); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 15px;
  animation: drop .25s ease;
}
.toast .grow { flex: 1; }
.toast b { font-family: var(--serif); font-size: 17px; display: block; }
.toast a { color: var(--paper); font-weight: 700; white-space: nowrap; }
.toast button { background: none; border: 0; color: var(--paper); opacity: .7; cursor: pointer; padding: 4px; }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(3,18,25,.96); color: #fff; display: grid; place-items: center; padding: 56px 12px 24px; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: calc(100dvh - 160px); max-width: 100%; object-fit: contain; }
.lightbox figcaption { font-size: 15px; line-height: 1.45; font-style: italic; max-width: 40rem; text-align: center; margin-top: 12px; opacity: .9; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox-close { top: calc(var(--safe-t) + 10px); right: 10px; }
.lightbox-prev { left: 10px; top: 50%; }
.lightbox-next { right: 10px; top: 50%; }
.lightbox [hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Dunkle Karte */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.credit { font-size: 14px; margin-top: 28px; }
.credit a { color: inherit; }
