/* Hohes Kreuz - Stylesheet
   Eine Datei, keine Frameworks, keine externen Abhaengigkeiten.
   Anmutung: Sandstein, Papier, Dorfchronik - warm statt technisch. */

/* ---------------------------------------------------------- Farbrollen */
:root {
  color-scheme: light;

  --surface-0: #f7f2e8;   /* Seitenhintergrund, warmes Papier */
  --surface-1: #fffdf8;   /* Karten, Diagrammflaeche */
  --surface-2: #efe7d7;   /* ruhige Flaechen, Tabellenkopf */
  --line:      #d9cdb6;
  --line-soft: #e8dfcd;

  --ink:       #2a2217;
  --ink-2:     #584d3c;
  --ink-3:     #867a66;

  --brand:     #7a4a1d;   /* Sandstein, gebrannt */
  --brand-2:   #8a5520;
  --accent:    #0a6b4f;   /* Wiese, Wald */

  --series-1:  #b45309;
  --series-2:  #047857;

  --radius:    12px;
  --radius-sm: 7px;
  --shadow:    0 1px 1px rgba(74, 56, 30, .05), 0 10px 26px -18px rgba(74, 56, 30, .35);
  --measure:   66ch;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino,
           "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(.83rem, .81rem + .10vw, .89rem);
  --step-0:  clamp(1.02rem, .99rem + .16vw, 1.11rem);
  --step-1:  clamp(1.21rem, 1.14rem + .32vw, 1.44rem);
  --step-2:  clamp(1.44rem, 1.31rem + .62vw, 1.9rem);
  --step-3:  clamp(1.72rem, 1.48rem + 1.08vw, 2.45rem);
  --step-4:  clamp(2.05rem, 1.62rem + 1.9vw, 3.25rem);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-0: #17140f;
    --surface-1: #201c15;
    --surface-2: #2b251c;
    --line:      #3f382c;
    --line-soft: #332d24;
    --ink:       #f3ece0;
    --ink-2:     #cdc2b0;
    --ink-3:     #9d9181;
    --brand:     #e0b075;
    --brand-2:   #e9c391;
    --accent:    #5fc39a;
    --series-1:  #c2761a;
    --series-2:  #2f9e73;
    --shadow:    0 1px 1px rgba(0, 0, 0, .4), 0 10px 26px -18px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #17140f;
  --surface-1: #201c15;
  --surface-2: #2b251c;
  --line:      #3f382c;
  --line-soft: #332d24;
  --ink:       #f3ece0;
  --ink-2:     #cdc2b0;
  --ink-3:     #9d9181;
  --brand:     #e0b075;
  --brand-2:   #e9c391;
  --accent:    #5fc39a;
  --series-1:  #c2761a;
  --series-2:  #2f9e73;
  --shadow:    0 1px 1px rgba(0, 0, 0, .4), 0 10px 26px -18px rgba(0, 0, 0, .8);
}

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

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

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--ink);
  font: var(--step-0)/1.7 var(--sans);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.22;
  letter-spacing: -.005em;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); margin-top: 2.2em; }
h3 { font-size: var(--step-1); margin-top: 1.9em; }
p, ul, ol { margin: 0 0 1.15em; }
p, li { max-width: var(--measure); text-wrap: pretty; }
small, .small { font-size: var(--step--1); color: var(--ink-3); }

a { color: var(--brand-2); text-underline-offset: .19em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2.5px solid var(--brand-2); outline-offset: 3px; border-radius: 3px; }

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

/* Trenner mit kleinem Kreuz-Motiv */
hr {
  border: 0; margin: 3.2rem auto; height: 1rem; max-width: 12rem;
  background: no-repeat center/auto 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 16'%3E%3Cg fill='none' stroke='%23b09a74' stroke-width='1'%3E%3Cpath d='M0 8h48M72 8h48'/%3E%3Cpath d='M60 3v10M55 6h10'/%3E%3C/g%3E%3C/svg%3E");
}

.wrap { width: min(100% - 2rem, 74rem); margin-inline: auto; }
.prose { width: min(100% - 2rem, 46rem); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--surface-1); color: var(--ink); padding: .6rem 1rem;
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------------ Kopf */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface-0) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 4.2rem;
}
.brand {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--serif); font-weight: 600; letter-spacing: .005em;
  font-size: 1.14rem; color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand svg { flex: none; color: var(--brand); }
.brand span { white-space: nowrap; }
.brand small {
  display: block; font-family: var(--sans); font-size: .67rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
  line-height: 1.4;
}

.nav { display: flex; align-items: center; gap: .15rem; }
.nav a {
  display: block; padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-size: .97rem;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--brand); background: transparent;
  box-shadow: inset 0 -2px 0 var(--brand);
  border-radius: 0;
}

.icon-btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none;
  background: transparent; border: 1px solid var(--line);
  border-radius: 50%; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-toggle { display: none; border-radius: var(--radius-sm); }
[data-theme="dark"] .theme-icon--dark,
.theme-icon--light { display: block; }
[data-theme="dark"] .theme-icon--light,
.theme-icon--dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .theme-icon--light { display: none; }
  :root:where(:not([data-theme="light"])) .theme-icon--dark { display: block; }
}

@media (max-width: 54rem) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; inset: 100% 1rem auto 1rem;
    flex-direction: column; align-items: stretch; gap: .1rem;
    padding: .5rem; background: var(--surface-1);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .nav[hidden] { display: none; }
  .nav a { padding: .7rem .8rem; font-size: 1.02rem; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); }
}

/* --------------------------------------------- Bewegung und Übergänge
   Alles hier ist Zugabe: Ohne Unterstützung sieht die Seite ruhig aus,
   statt kaputt. Wer im Betriebssystem weniger Bewegung wünscht, bekommt
   sie nicht (siehe die Regel bei den Grundlagen). */

/* Sanfte Überblendung beim Seitenwechsel. */
@view-transition { navigation: auto; }

/* Inhalte steigen beim Scrollen leicht herein. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .auftritt,
    .cards > *,
    .stats,
    .figure,
    figure.media,
    .section__head,
    .chronik li {
      animation: auftauchen linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 20%;
    }
  }
}
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(1.4rem); }
  to   { opacity: 1; transform: none; }
}

/* Beim Drucken und in der Lesedarstellung darf nichts unsichtbar bleiben. */
@media print {
  *, *::before, *::after {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  .site-header, .nav, .fortschritt, .skip-link, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .figure, .card, figure.media img { box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
}

/* Lesefortschritt am oberen Rand langer Artikel. */
.fortschritt {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
  background: var(--brand); transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .fortschritt {
    animation: fortschritt linear both;
    animation-timeline: scroll(root block);
  }
}
@media (prefers-reduced-motion: reduce) { .fortschritt { display: none; } }
@keyframes fortschritt { to { transform: scaleX(1); } }

/* ------------------------------------------------------------- Gliederung
   Auf breiten Bildschirmen steht sie im linken Rand und laeuft mit, auf
   schmalen klappt sie oben auf. Ohne JavaScript entsteht sie gar nicht -
   die Seite ist dann einfach eine Seite ohne Sprungmarken. */
.gliederung { display: none; }

.mit-gliederung main :is(h2, h3)[id] { scroll-margin-top: 5.5rem; }

.gliederung__titel {
  font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 .7rem; padding-left: .85rem;
}
.gliederung ol { list-style: none; margin: 0; padding: 0; }
.gliederung li { max-width: none; }
.gliederung a {
  display: block; padding: .32rem .6rem .32rem .85rem;
  border-left: 2px solid var(--line-soft);
  color: var(--ink-2); text-decoration: none; font-size: .9rem; line-height: 1.35;
}
.gliederung a:hover { color: var(--ink); border-left-color: var(--line); }
.gliederung a[aria-current="true"] {
  color: var(--brand); border-left-color: var(--brand);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.gliederung .stufe-3 { padding-left: 1.7rem; font-size: .85rem; }

@media (min-width: 82rem) {
  .mit-gliederung { padding-left: 15.5rem; }
  .mit-gliederung .gliederung--rand {
    display: block; position: fixed; z-index: 40;
    top: 5.6rem; left: 1.1rem; width: 13.2rem;
    padding-bottom: 1rem;
  }

  /* Das Kopfbild reicht bis an den linken Fensterrand. Die Seite ist dort
     um die Randspalte eingerueckt; das Bild nimmt diese Einrueckung wieder
     heraus und gibt sie als Innenabstand zurueck, damit die Ueberschrift
     stehen bleibt, wo sie steht. */
  .mit-gliederung .page-head--bild {
    margin-left: -15.5rem; padding-left: 15.5rem;
  }
}

/* Aufklappbare Fassung fuer schmale Bildschirme */
.gliederung__platz { padding-top: 1.4rem; }
.gliederung--klapp {
  display: block; margin: 0 0 1.5rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-1);
}
.gliederung--klapp > summary {
  cursor: pointer; padding: .7rem 1rem; font-size: .95rem;
  color: var(--ink-2); font-family: var(--serif);
}
.gliederung--klapp[open] > summary { border-bottom: 1px solid var(--line-soft); }
.gliederung--klapp > div { padding: .6rem .6rem .8rem; }
.gliederung--klapp .gliederung__titel { display: none; }
@media (min-width: 82rem) {
  .mit-gliederung .gliederung--klapp { display: none; }
}

/* ------------------------------------------------------------------ Hero */
.hero { position: relative; padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }

.hero--bild .wrap {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
}
@media (max-width: 52rem) {
  .hero--bild .wrap { grid-template-columns: 1fr; }
  .hero__bild { order: -1; max-width: 22rem; margin-inline: auto; }
}
.hero__bild {
  position: relative; border-radius: 180px 180px var(--radius) var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.hero__bild img { width: 100%; display: block; }
.hero__bild figcaption {
  position: absolute; inset: auto 0 0 0; padding: 2.5rem .9rem .7rem;
  font-size: var(--step--1); color: #f3ece0;
  background: linear-gradient(to top, rgba(28, 20, 10, .78), transparent);
}
/* Der Hero der Startseite liegt ueber einer Luftaufnahme des Ortes. Das
   Video laeuft stumm und in einer nahtlosen Schleife: die letzten anderthalb
   Sekunden sind beim Schnitt in die ersten geblendet worden, deshalb springt
   der Uebergang nicht. Der Block bleibt in beiden Farbschemata dunkel - er
   ist ein Foto, kein Papier. */
.hero--video {
  position: relative; isolation: isolate; overflow: hidden;
  background: #1a130a center/cover no-repeat
              url("../img/luftbild-video-standbild.webp");
}
.hero__video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  /* Stoert sonst beim Antippen auf dem Telefon. */
  pointer-events: none;
}
.hero--video::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(26, 19, 10, .9) 0%, rgba(26, 19, 10, .66) 45%,
                            rgba(26, 19, 10, .34) 100%),
    linear-gradient(to bottom, rgba(26, 19, 10, .2) 55%, var(--surface-0) 100%);
}
.hero--video h1 { color: #fbf6ec; }
.hero--video .hero__lead { color: #e4d9c6; }
.hero--video .hero__bild { border-color: rgba(243, 236, 224, .22); }

/* Wer ruhige Seiten eingestellt hat, bekommt das Standbild. Auf dem Telefon
   steht das Steinkreuz-Foto oben und verdeckt das Video ohnehin - dort wird
   es gar nicht erst geladen (media am <source>) und auch nicht angezeigt. */
@media (prefers-reduced-motion: reduce), (max-width: 52rem) {
  .hero__video { display: none; }
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: var(--step--1); letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 1.2rem;
}
.hero__eyebrow::before {
  content: ""; width: 2.2rem; height: 1px; background: var(--brand); display: block;
  opacity: .5;
}
.hero h1 { max-width: 16ch; margin-bottom: .4em; }
.hero__lead {
  font-family: var(--serif); font-size: var(--step-1); color: var(--ink-2);
  max-width: 44ch; line-height: 1.55;
}
.hero__facts {
  display: flex; flex-wrap: wrap; gap: 1.7rem 3rem; margin-top: 2.6rem;
  padding-top: 1.7rem; border-top: 1px solid var(--line);
}
.hero__fact b {
  display: block; font-family: var(--serif); font-size: var(--step-2);
  font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums;
}
.hero__fact span { font-size: var(--step--1); color: var(--ink-3); }

/* ------------------------------------------------------------- Panorama
   Volle Breite wie ein Bildband, aber drehbar. Solange das Bild noch nicht
   geladen ist, steht hier eine ruhige Flaeche statt eines schwarzen Lochs. */
.panorama {
  position: relative; margin: 0; width: 100%;
  border-block: 1px solid var(--line);
  background: var(--surface-2);
}
.panorama__bild,
.panorama__flach {
  display: block; width: 100%;
  height: clamp(17rem, 44vw, 32rem);
}
.panorama__bild {
  cursor: grab; touch-action: none;
  opacity: 0; transition: opacity .6s ease;
}
.panorama--bereit .panorama__bild { opacity: 1; }

.panorama__bild:active { cursor: grabbing; }
.panorama__bild:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }
.panorama__flach { object-fit: cover; }

/* Hinweis und Vollbildknopf liegen auf dem Bild. Der Hinweis verschwindet,
   sobald jemand das Panorama angefasst hat - dann hat er sich erledigt. */
.panorama__hinweis,
.panorama__voll {
  position: absolute; z-index: 1;
  font-size: var(--step--1); color: #f3ece0;
  background: rgba(26, 19, 10, .62); backdrop-filter: blur(6px);
  border: 1px solid rgba(243, 236, 224, .2); border-radius: 100px;
  padding: .4rem .9rem; line-height: 1.2;
}
.panorama__hinweis {
  left: 50%; bottom: 1rem; transform: translateX(-50%);
  pointer-events: none; transition: opacity .4s ease;
}
.panorama--angefasst .panorama__hinweis { opacity: 0; }
.panorama--flach .panorama__hinweis,
.panorama--flach .panorama__voll { display: none; }
.panorama__voll {
  right: 1rem; top: 1rem; cursor: pointer;
  font-family: inherit; display: inline-flex; gap: .45rem; align-items: center;
}
.panorama__voll:hover { background: rgba(26, 19, 10, .8); }
.panorama:fullscreen { border: 0; }
.panorama:fullscreen .panorama__bild { height: 100vh; }

/* ------------------------------------------------------------- Bildband
   Ein Foto über die volle Fensterbreite, als Atempause zwischen zwei
   Abschnitten. Ohne Bildunterschrift - das Bild spricht für sich. */
/* Das Band steht als direktes Kind von <main> ohnehin über die ganze
   Breite - es braucht keinen Ausbruch aus einem Container. Ein Versuch mit
   100vw erzeugte nur waagerechtes Scrollen, weil 100vw die Bildlaufleiste
   mitzählt und die Randspalte der Gliederung dazukommt. */
.bildband {
  margin: 0; padding: 0; width: 100%;
  border-block: 1px solid var(--line);
}
.bildband img {
  width: 100%; height: clamp(14rem, 34vw, 26rem); object-fit: cover;
  display: block;
}

/* ----------------------------------------------------------------- Karten */
.cards {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  margin: 0 0 1rem; padding: 0; list-style: none;
}
.card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.6rem 1.6rem 1.7rem;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .18s ease, border-color .18s ease;
}
a.card:hover { transform: translateY(-2px); border-color: var(--brand); color: inherit; }
.card h3 { margin: 0; font-size: var(--step-1); }
.card p { margin: 0; color: var(--ink-2); font-size: .98rem; max-width: none; }
.card__icon { color: var(--brand); margin-bottom: .4rem; opacity: .9; }
.card__more {
  margin-top: auto; padding-top: .8rem; font-size: .93rem; color: var(--brand-2);
}
a.card:hover .card__more { color: var(--accent); }

/* ---------------------------------------------------------------- Abschnitt */
.section { padding: clamp(2.6rem, 6vw, 4.6rem) 0; }
.section--alt { background: var(--surface-1); border-block: 1px solid var(--line); }
.section__head { max-width: 44ch; margin-bottom: 2.1rem; }
.section__head h2 { margin-top: 0; }
.section__head p { color: var(--ink-2); margin-bottom: 0; }

.page-head {
  padding: clamp(2.6rem, 7vw, 4.6rem) 0 clamp(1.6rem, 3vw, 2.6rem);
  border-bottom: 1px solid var(--line);
}

/* Mit Bild: Ueberschrift und Zeile stehen auf einer Luftaufnahme. Welche,
   sagt die Seite selbst ueber --kopfbild; auf schmalen Bildschirmen wird die
   kleine Fassung geladen, damit unterwegs nicht 90 KB fuer ein Bild
   draufgehen, das ohnehin niemand gross sieht.
   Darueber liegt ein Schleier aus zwei Verlaeufen - von links, damit die
   Schrift Halt hat, und nach unten, damit der Uebergang in die Seite nicht
   als Kante steht. Dasselbe Mittel wie beim Video auf der Startseite. */
.page-head--bild {
  position: relative; isolation: isolate; border-bottom: 0;
  padding: clamp(4rem, 11vw, 7.5rem) 0 clamp(2.4rem, 5vw, 4rem);
  background: #1a130a center/cover no-repeat var(--kopfbild-klein);
}
@media (min-width: 52rem) {
  .page-head--bild { background-image: var(--kopfbild); }
}
.page-head--bild::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(26, 19, 10, .88) 0%, rgba(26, 19, 10, .6) 48%,
                            rgba(26, 19, 10, .3) 100%),
    linear-gradient(to bottom, rgba(26, 19, 10, .2) 55%, var(--surface-0) 100%);
}
.page-head h1 { margin-bottom: .33em; }
.page-head p {
  font-family: var(--serif); font-size: var(--step-1); color: var(--ink-2);
  max-width: 48ch; margin: 0;
}
.page-head--bild h1 { color: #fbf6ec; }
.page-head--bild p { color: #e4d9c6; }

/* ------------------------------------------------------------- Kennzahlen */
/* Eigenständige Karten statt eines durchgehenden Rasters: Bei sechs
   Kennzahlen bliebe sonst eine leere Zelle als dunkler Block stehen. */
.stats {
  display: grid; gap: .9rem; margin: 0 0 1rem; padding: 0; list-style: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 58rem) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .stats { grid-template-columns: minmax(0, 1fr); } }

.stat {
  padding: 1.3rem 1.4rem 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-1) 50%, transparent);
}
.stat b {
  display: block; font-family: var(--serif); font-size: var(--step-3);
  font-weight: 600; line-height: 1.1; color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.stat b i {
  font-style: normal; font-size: .5em; color: var(--ink-3); margin-left: .18em;
  font-family: var(--sans);
}
.stat span { display: block; margin-top: .45rem; font-size: var(--step--1); color: var(--ink-2); }

/* --------------------------------------------------------------- Diagramme */
.figure {
  margin: 2.1rem 0; background: var(--surface-1);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.figure__head { padding: 1.3rem 1.5rem .2rem; }
.figure__head h3 { margin: 0 0 .25rem; font-size: var(--step-1); }
.figure__head p { margin: 0; font-size: var(--step--1); color: var(--ink-3); max-width: 60ch; }
.figure__body { padding: .6rem 1rem 1rem; position: relative; }
.figure figcaption {
  padding: .95rem 1.5rem 1.25rem; font-size: var(--step--1); color: var(--ink-3);
  border-top: 1px solid var(--line-soft);
}

.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: .2rem 1.5rem .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--step--1); color: var(--ink-2); }
.legend i {
  width: 1.1rem; height: 0; border-top: 3px solid currentColor;
  border-radius: 2px; flex: none;
}
.legend i.dash { border-top-style: dashed; border-top-width: 3px; }

.chart { width: 100%; display: block; touch-action: pan-y; }
.chart .grid line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .axis line { stroke: var(--line); }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface-1); stroke-width: 2; }

.tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 10rem; padding: .6rem .78rem;
  background: var(--surface-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: var(--step--1); line-height: 1.5;
}
.tooltip[hidden] { display: none; }
.tooltip b { display: block; margin-bottom: .3rem; font-family: var(--serif); font-weight: 600; }
.tooltip dl { display: grid; grid-template-columns: auto auto; gap: .1rem .9rem; margin: 0; }
.tooltip dt { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink-2); }
.tooltip dt i { width: .85rem; height: 0; border-top: 3px solid currentColor; flex: none; }
.tooltip dt i.dash { border-top-style: dashed; }
.tooltip dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

details.datatable { margin: -.3rem 0 1.6rem; }
details.datatable summary {
  cursor: pointer; font-size: var(--step--1); color: var(--brand-2);
  padding: .4rem 0; width: fit-content;
}
details.datatable .scroll {
  max-height: 22rem; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------- Tabellen */
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
.table-wrap { overflow-x: auto; margin: 1.7rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { margin: 0; }
th, td { padding: .64rem .95rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
thead th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--ink);
  font-family: var(--serif); font-weight: 600; font-size: var(--step--1);
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Inhalt */
figure.media { margin: 2.3rem 0; }
figure.media img {
  border-radius: var(--radius); border: 1px solid var(--line); width: 100%;
  box-shadow: var(--shadow);
}

/* Bilder lassen sich gross anzeigen - natives dialog-Element, kein Zusatzcode. */
.lupe {
  display: block; padding: 0; border: 0; background: none; cursor: zoom-in;
  width: 100%; border-radius: var(--radius); overflow: hidden;
}
.lupe:focus-visible { outline-offset: 4px; }
dialog.leuchtkasten {
  max-width: min(96vw, 1100px); max-height: 94vh; width: auto;
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface-1); color: var(--ink); overflow: hidden;
}
dialog.leuchtkasten::backdrop { background: rgba(20, 14, 6, .82); backdrop-filter: blur(3px); }
dialog.leuchtkasten img { max-height: 82vh; width: auto; margin-inline: auto; }
dialog.leuchtkasten p {
  margin: 0; padding: .85rem 1.1rem; font-size: var(--step--1);
  color: var(--ink-3); max-width: none;
}
dialog.leuchtkasten .schliessen {
  position: absolute; top: .55rem; right: .55rem;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-1); color: var(--ink-2); cursor: pointer;
  font-size: 1.1rem; line-height: 1;
}
@media (prefers-reduced-motion: no-preference) {
  dialog.leuchtkasten, dialog.leuchtkasten::backdrop {
    transition: opacity .2s ease, display .2s allow-discrete,
                overlay .2s allow-discrete;
    opacity: 1;
  }
  dialog.leuchtkasten:not([open]),
  dialog.leuchtkasten:not([open])::backdrop { opacity: 0; }
  @starting-style {
    dialog.leuchtkasten[open], dialog.leuchtkasten[open]::backdrop { opacity: 0; }
  }
}
figure.media figcaption {
  margin-top: .8rem; font-size: var(--step--1); color: var(--ink-3);
  font-style: italic;
}

blockquote {
  margin: 2.2rem 0; padding: .2rem 0 .2rem 1.5rem;
  border-left: 2px solid var(--brand); color: var(--ink-2);
  font-family: var(--serif); font-size: var(--step-1); line-height: 1.6;
}
blockquote p:last-child { margin-bottom: 0; }
figure.zitat { margin: 0; }
figure.zitat figcaption {
  font-size: var(--step--1); color: var(--ink-3); margin: -1.6rem 0 2.2rem 1.5rem;
}

.formel {
  margin: 1.9rem 0; padding: 1.1rem 1.3rem; text-align: center;
  background: var(--surface-2); border-radius: var(--radius);
  font-family: var(--serif); font-size: var(--step-1); max-width: none;
}
.formel i { font-style: italic; }
.formel .small {
  display: block; margin-top: .55rem; font-size: var(--step--1); font-style: normal;
}

/* ------------------------------------------------------------- Fussnoten */
.beleg {
  text-decoration: none; font-weight: 600; white-space: nowrap;
  padding: 0 .1em; color: var(--brand-2);
}
.beleg sup { font-size: .72em; vertical-align: super; line-height: 0; }
.beleg:hover, .beleg:focus-visible { color: var(--accent); }

/* Die Nachweise nutzen die ganze Seitenbreite und stehen in Spalten -
   so bleibt das Verzeichnis flach, statt die Seite zu verlängern. */
.quellen {
  counter-reset: quelle; list-style: none; padding: 0; margin: 1.4rem 0 0;
  columns: 21rem auto; column-gap: 2.4rem;
  font-size: .84rem; line-height: 1.5;
}
.quellen li {
  counter-increment: quelle; position: relative;
  break-inside: avoid;
  padding: .5rem 0 .5rem 2rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: inherit; color: var(--ink-3); max-width: none;
}
.quellen li:last-child { border-bottom: 0; }
.quellen cite { color: var(--ink-2); }
.quellen li::before {
  content: counter(quelle) ".";
  position: absolute; left: 0; top: .5rem;
  font-variant-numeric: tabular-nums; color: var(--brand);
  font-family: var(--serif); font-weight: 600; font-size: .95rem;
}
.quellen li:target { background: var(--surface-2); border-radius: var(--radius-sm); }
.quellen li:target::before { left: .5rem; }
.quellen li:target { padding-left: 2.8rem; padding-right: .6rem; }
.quellen .zurueck { text-decoration: none; margin-left: .4rem; }

/* Einblendfeld beim Darueberfahren oder per Tastaturfokus */
.beleg-tip {
  position: absolute; z-index: 60; max-width: min(28rem, calc(100vw - 2rem));
  padding: .7rem .85rem; background: var(--surface-1); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: var(--step--1); line-height: 1.5;
}
.beleg-tip[hidden] { display: none; }

.note {
  margin: 2.1rem 0; padding: 1.15rem 1.35rem;
  background: var(--surface-2); border-radius: var(--radius);
  border-left: 3px solid var(--brand); color: var(--ink-2);
  font-size: .98rem;
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--ink); }

/* Chronik */
.chronik { list-style: none; margin: 1.6rem 0; padding: 0; }
.chronik li {
  position: relative; padding: 0 0 1.5rem 1.7rem;
  border-left: 1px solid var(--line); max-width: var(--measure);
}
.chronik li:last-child { padding-bottom: .2rem; }
.chronik li::before {
  content: ""; position: absolute; left: -4.5px; top: .6em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface-0); border: 2px solid var(--brand);
}

/* Der Zeitstrahl: eine einzige durchgehende Linie über die ganze Chronik,
   die beim Scrollen von oben nach unten aufgebaut wird. Sie liegt deshalb
   auf der Liste, nicht auf den einzelnen Einträgen — sonst blendete sich
   jeder Abschnitt für sich ein und der Strahl wirkte zerstückelt.
   Den Füllstand setzt site.js als --strahl; ohne JavaScript steht er auf 1
   und die Linie ist schlicht durchgezogen. */
.chronik { position: relative; }
.chronik::after {
  content: ""; position: absolute; left: -1px; top: 0; width: 1px;
  height: 100%; background: var(--brand);
  transform-origin: 50% 0; transform: scaleY(var(--strahl, 1));
}
@media (prefers-reduced-motion: reduce) {
  .chronik::after { transform: scaleY(1); }
}

/* Erreicht man beim Lesen eine Jahreszahl, tritt sie hervor; was noch
   kommt, bleibt zurückgenommen. Welcher Eintrag erreicht ist, entscheidet
   site.js an derselben Lesehöhe wie beim Strahl - so endet die Linie genau
   am letzten betonten Punkt.
   Die Klasse chronik--mitlaufend setzt erst das Skript. Ohne JavaScript
   fehlt sie, und alle Jahreszahlen sind betont - besser, als eine blasse
   Chronik zu zeigen, in der nie etwas aufleuchtet. */
.chronik time {
  display: block; font-family: var(--serif); font-size: 1rem; font-weight: 600;
  color: var(--brand); font-variant-numeric: tabular-nums;
}
.chronik--mitlaufend time { color: var(--ink-3); }
.chronik--mitlaufend li.erreicht time { color: var(--brand); }
.chronik--mitlaufend li::before { transform: scale(.55); }
.chronik--mitlaufend li.erreicht::before {
  background: var(--brand); transform: scale(1);
}
@media (prefers-reduced-motion: no-preference) {
  .chronik--mitlaufend time,
  .chronik--mitlaufend li::before {
    transition: color .35s ease, background-color .35s ease,
                transform .35s ease;
  }
}
.chronik p { margin: .15rem 0 0; }

/* Eingebettete Anwendungen */
.embed {
  margin: 2.1rem 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-1); box-shadow: var(--shadow);
}
.embed iframe { display: block; width: 100%; height: min(78vh, 1100px); border: 0; }
.embed__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  padding: .75rem 1.1rem; border-bottom: 1px solid var(--line);
  background: var(--surface-2); font-size: var(--step--1); color: var(--ink-2);
  margin: 0; max-width: none;
}
.embed__bar a { margin-left: auto; }

/* -------------------------------------------------------------------- Fuss */
.site-footer {
  margin-top: 4rem; padding: 2.8rem 0 3.2rem;
  background: var(--surface-1); border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: .96rem;
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 1.5rem 2.6rem; align-items: start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.3rem; margin-left: auto; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; max-width: 38ch; }
.site-footer b {
  color: var(--ink); display: block; font-family: var(--serif);
  font-size: 1.1rem; font-weight: 600; margin-bottom: .2rem;
}
