/* Modellbahnfreunde Ammerndorf – gemeinsames Stylesheet
   Schriften liegen lokal im Ordner /fonts (keine externen Anfragen). */

@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --papier: #f1f2ee;
  --flaeche: #ffffff;
  --tinte: #1c211e;
  --leise: #59625c;
  --linie: #c9cfc8;
  --gruen: #2e4a3b;        /* Chromoxidgrün der Umbauwagen */
  --gruen-hell: #dde5dd;
  --auf-gruen: #e9efe9;
  --gelb: #e3b21c;         /* Gelb aus dem Ammerndorfer Wappen */
  --link: #2a5c42;
  --emaille: #fbfbf8;
  --schild-tinte: #151515;

  --schrift-text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --schrift-schild: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --breite-text: 40rem;
  --breite-seite: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --papier: #141916;
    --flaeche: #1b221e;
    --tinte: #e3e7e2;
    --leise: #a3ada5;
    --linie: #36413a;
    --gruen: #20352a;
    --gruen-hell: #243229;
    --auf-gruen: #dfe8e0;
    --gelb: #e8bb2e;
    --link: #9fd0b0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --papier: #141916; --flaeche: #1b221e; --tinte: #e3e7e2; --leise: #a3ada5;
  --linie: #36413a; --gruen: #20352a; --gruen-hell: #243229; --auf-gruen: #dfe8e0;
  --gelb: #e8bb2e; --link: #9fd0b0;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--schrift-text);
  font-size: 1.125rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; border-radius: 2px; }

.sprung { position: absolute; left: -999px; top: 0; background: var(--gelb); color: #111; padding: .5rem 1rem; z-index: 10; }
.sprung:focus { left: 1rem; top: 1rem; }

/* ---------- Kopf mit Bahnhofsschild ---------- */

.kopf {
  background: var(--gruen);
  color: var(--auf-gruen);
  padding: 1.75rem 1.25rem 0;
}
.kopf-innen {
  max-width: var(--breite-seite);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.kopf a.schild-link { text-decoration: none; display: flex; align-items: center; gap: 1rem; }
.wappen { width: 3.25rem; height: auto; flex: none; }

.schild {
  background: var(--emaille);
  color: var(--schild-tinte);
  border: 2px solid var(--schild-tinte);
  border-radius: 7px;
  box-shadow: inset 0 0 0 4px var(--emaille), inset 0 0 0 6px var(--schild-tinte);
  padding: .55rem 1.6rem .5rem;
  font-family: var(--schrift-schild);
  line-height: 1;
  text-align: center;
}
.schild small {
  display: block;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .04em;
  margin-bottom: .2rem;
}
.schild strong {
  display: block;
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 3rem);
  letter-spacing: .02em;
}

.motto {
  font-style: italic;
  margin: 0;
  font-size: 1.05rem;
  opacity: .9;
}

.navi {
  max-width: var(--breite-seite);
  margin: 1.5rem auto 0;
}
.navi ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.6rem;
}
.navi a {
  display: block;
  padding: .55rem 0 .5rem;
  color: var(--auf-gruen);
  text-decoration: none;
  font-family: var(--schrift-schild);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: .02em;
  border-bottom: 4px solid transparent;
}
.navi a:hover { border-bottom-color: color-mix(in srgb, var(--gelb) 55%, transparent); }
.navi a[aria-current="page"] { border-bottom-color: var(--gelb); }

/* ---------- Inhalt ---------- */

main {
  max-width: calc(var(--breite-seite) + 2.5rem);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.text { max-width: var(--breite-text); }

h1, h2, h3 {
  font-family: var(--schrift-schild);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 2.9rem); margin: 0 0 1rem; }
h2 { font-size: 1.7rem; margin: 2.75rem 0 .75rem; }
h3 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
p { margin: 0 0 1.1rem; }

.einleitung { font-size: 1.25rem; line-height: 1.55; color: var(--leise); }

figure { margin: 2rem 0; }
figure img { border: 1px solid var(--linie); background: var(--flaeche); }
figcaption { font-size: .98rem; color: var(--leise); margin-top: .6rem; font-style: italic; max-width: var(--breite-text); }

.titelbild { margin: 0 0 2.5rem; max-width: 61.25rem; }
.titelbild img { width: 100%; }

.hinweis {
  border-left: 4px solid var(--gelb);
  background: var(--flaeche);
  padding: 1.1rem 1.4rem;
  margin: 2rem 0;
  max-width: var(--breite-text);
}
.hinweis > :last-child { margin-bottom: 0; }

.unterschrift { font-style: italic; }

.zwei-spalten { display: grid; gap: 0 3rem; }
@media (min-width: 52rem) {
  .zwei-spalten { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

address { font-style: normal; }
dl.angaben { margin: 0 0 1.5rem; }
dl.angaben dt { font-family: var(--schrift-schild); font-weight: 600; font-size: 1.1rem; margin-top: 1rem; }
dl.angaben dd { margin: 0; }

.kleingedruckt { font-size: 1rem; }
.kleingedruckt h2 { font-size: 1.4rem; margin-top: 2.2rem; }
.kleingedruckt h3 { font-size: 1.15rem; }

/* Unterpunkte (z. B. Geschichte ↔ Chronik) */
.unternavi { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 2rem; padding: 0; list-style: none; font-family: var(--schrift-schild); font-size: 1.15rem; }
.unternavi a[aria-current="page"] { color: var(--tinte); text-decoration: none; font-weight: 600; }

/* ---------- Chronik als Gleis ---------- */

.chronik { list-style: none; margin: 2rem 0; padding: 0; max-width: 52rem; position: relative; }
.chronik::before {
  /* Schienen und Schwellen */
  content: "";
  position: absolute;
  top: .4rem; bottom: .4rem;
  left: .55rem;
  width: 1.1rem;
  background:
    linear-gradient(to right, transparent 0 .2rem, var(--tinte) .2rem .32rem, transparent .32rem .78rem, var(--tinte) .78rem .9rem, transparent .9rem),
    repeating-linear-gradient(to bottom, var(--leise) 0 .22rem, transparent .22rem .85rem);
  opacity: .55;
}
.chronik li { position: relative; padding: 0 0 1.5rem 3rem; }
.chronik .datum {
  display: inline-block;
  font-family: var(--schrift-schild);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.2;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  padding: .1rem .5rem;
  margin-bottom: .35rem;
}
.chronik .datum::before {
  content: "";
  position: absolute;
  left: .58rem;
  top: .35rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--gelb);
  border: 2px solid var(--tinte);
}
.chronik p { margin: 0; }
.chronik li.abschnitt { padding-bottom: 1rem; }
.chronik li.abschnitt h2 { margin: 1.5rem 0 .5rem; }
.chronik li.abschnitt::before {
  content: "";
  position: absolute;
  left: .2rem;
  top: 1.75rem;
  width: 1.8rem;
  height: .5rem;
  background: var(--tinte);
}
.chronik .liste { margin: .4rem 0 0; padding-left: 1.2rem; }

@media (min-width: 46rem) {
  .chronik li:not(.abschnitt) { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.25rem; }
  .chronik .datum { justify-self: start; align-self: start; margin-bottom: 0; }
}

.quellen { columns: 2 16rem; column-gap: 2.5rem; padding: 0; list-style: none; font-size: 1rem; }
.quellen li { break-inside: avoid; margin-bottom: .9rem; }
.quellen strong { font-weight: 600; }

/* ---------- Bilderbuch ---------- */

.alben {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 2rem 1.75rem;
}
.alben a { text-decoration: none; color: var(--tinte); display: block; }
.alben img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border: 1px solid var(--linie); }
.alben span {
  display: block;
  font-family: var(--schrift-schild);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  margin-top: .6rem;
}
.alben a:hover span { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.alben small { display: block; color: var(--leise); font-size: .95rem; }

.album figure { max-width: 50rem; margin: 0 0 3rem; }
.album figure.hoch { max-width: 30rem; }

.blaettern {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  border-top: 1px solid var(--linie);
  padding-top: 1.25rem;
  margin-top: 1rem;
  font-family: var(--schrift-schild);
  font-size: 1.15rem;
}
.blaettern small { display: block; color: var(--leise); font-size: .95rem; }
.blaettern .weiter { text-align: right; margin-left: auto; }

.weiterlesen { font-family: var(--schrift-schild); font-size: 1.2rem; }

/* ---------- Fuß ---------- */

.fuss {
  border-top: 6px solid var(--gruen);
  background: var(--flaeche);
  font-size: 1rem;
  padding: 2rem 1.25rem 2.5rem;
}
.fuss-innen {
  max-width: var(--breite-seite);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem 3rem;
}
.fuss p { margin: 0; }
.fuss ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; }

@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  .kopf { padding-top: 1.25rem; }
  .schild { padding: .5rem 1rem .45rem; }
  .wappen { width: 2.6rem; }
  .navi ul { gap: 0 1.1rem; }
  .navi a { font-size: 1.1rem; }
}

@media print {
  .kopf, .navi, .fuss, .blaettern { background: none; color: #000; }
  .navi, .sprung { display: none; }
}
