/* Historie – erzählte Chronik (nur /historie-landgut-dargast/). Erzähltext in Source Serif 4 (selbst gehostet,
   SIL Open Font License, /assets/fonts/SourceSerif4-LICENSE.txt), Überschriften und Jahreszahlen Space Grotesk.
   Ohne JavaScript ist alles sichtbar; Einblenden und Zeitleisten-Füllung nur mit JS und ohne reduced motion. */

@font-face { font-family: "Source Serif 4"; font-style: normal; font-display: swap; font-weight: 200 900; src: url("/assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-display: swap; font-weight: 200 900; src: url("/assets/fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-display: swap; font-weight: 200 900; src: url("/assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-display: swap; font-weight: 200 900; src: url("/assets/fonts/source-serif-4-latin-ext-wght-italic.woff2") format("woff2-variations"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* Ersatzschrift mit angepassten Maßen (Breite/Ober-/Unterlänge gemessen gegen Georgia), damit beim Schriftwechsel
   nichts springt (CLS 0) */
@font-face { font-family: "Source Serif 4 Fallback"; font-style: normal; src: local("Georgia"); size-adjust: 107%; ascent-override: 96.8%; descent-override: 31.3%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif 4 Fallback"; font-style: italic; src: local("Georgia Italic"), local("Georgia-Italic"); size-adjust: 96.5%; ascent-override: 107.4%; descent-override: 34.7%; line-gap-override: 0%; }

.page-historie-landgut-dargast {
  --serif: "Source Serif 4", "Source Serif 4 Fallback", Georgia, "Times New Roman", serif;
  --rail: 200px;        /* Spalte der Jahreszahl (Desktop) */
  --rail-gap: 56px;     /* Linie liegt mitten in dieser Lücke */
  --papier: #fffdf8;    /* Rand der „Fotoabzüge“ */
  --text-mass: 32em;    /* höchstens 66 Zeichen je Zeile bei 19 px (gemessen: tools/e2e-historie.mjs) */
}

/* --- Einstieg: Postkarte „Vorwerk Dargast“, um 1910 ---------------------------------------
   Original nur 1200 × 755 px: Bildfläche höchstens 1200 px breit und 755 px hoch, damit es nie über 100 %
   vergrößert wird (object-fit: cover skaliert dann nur verkleinernd). Breiter: mittig, Ränder laufen in Navy aus.
   Oben ausgerichtet: der Aufdruck „Vorwerk Dargast.“ steht oben mittig, frei über dem Text. */
.hx-hero { position: relative; display: flex; align-items: flex-end; min-height: 420px; height: 75vh; height: 75svh; max-height: 755px; overflow: hidden; background: var(--ink); color: var(--white); }
.hx-hero > picture { position: absolute; top: 0; bottom: 0; left: 50%; width: min(100%, 1200px); translate: -50% 0; }
.hx-hero > .hx-hero-bild, .hx-hero > picture > .hx-hero-bild { position: absolute; inset: 0; width: 100%; height: 100%; }
.hx-hero-bild { object-fit: cover; object-position: 50% 0; }
@media (min-width: 1201px) { .hx-hero > picture { -webkit-mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); } }
/* Verlauf für die helle Postkarte: Schrift ≥ 4,5:1 gegen das hellste Pixel dahinter (gemessen 360–2560 px); oben
   bleibt der Aufdruck „Vorwerk Dargast.“ nur leicht abgedunkelt */
.hx-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(11, 37, 51, .95) 0%, rgba(11, 37, 51, .9) 40%, rgba(11, 37, 51, .8) 62%, rgba(11, 37, 51, .42) 82%, rgba(11, 37, 51, .12) 100%); }
.hx-hero-inhalt { position: relative; z-index: 2; padding-block: 48px 32px; }
.hx-hero .kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--white); }
.hx-hero .kicker::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--accent-l); }
.hx-hero h1 { max-width: 22ch; margin: 0; color: var(--white); font-size: 34px; line-height: 1.08; text-shadow: 0 1px 12px rgba(11, 37, 51, .35); }
.hx-hero-unterzeile { margin: 14px 0 0; max-width: 40ch; font: italic 400 20px/1.45 var(--serif); color: #e6edf1; }
.hx-weiter { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 20px; color: var(--white); font: 600 16px/1.2 var(--font); text-decoration: none; }
.hx-weiter:hover { color: var(--accent-l); }
.hx-weiter svg { transform: rotate(180deg); animation: hx-wippen 2.4s ease-in-out infinite; }
@keyframes hx-wippen { 0%, 100% { translate: 0 0; } 50% { translate: 0 4px; } }
@media (min-width: 768px) {
  .hx-hero { min-height: 560px; } /* niedrige Fenster: Text bleibt unter dem Aufdruck (≤ 755 px, also ohne Vergrößerung) */
  .hx-hero h1 { font-size: 48px; }
  .hx-hero-unterzeile { font-size: 22px; }
  .hx-hero-inhalt { padding-block: 64px 40px; }
}
@media (min-width: 1200px) { .hx-hero h1 { font-size: 60px; } }

/* --- Chronik ------------------------------------------------------------------------------ */
.hx-chronik { padding-block: var(--sec); }
.hx-zeit { position: relative; }
.hx-kap { position: relative; padding-bottom: 64px; }
.hx-kap:last-child { padding-bottom: 0; }
.hx-main { min-width: 0; }
.hx-main > h2 { margin: 0 0 24px; font-size: 30px; line-height: 1.15; text-wrap: balance; }
.hx-h2-jahr { display: block; margin-bottom: 6px; font: 700 40px/1 var(--head); letter-spacing: -.02em; color: var(--accent-d); }
.hx-rail, .hx-linie { display: none; }

/* Erzähltext: alle Absätze gleich (keine .lead mehr), Serif 19 px / 1,7 */
.hx-text { max-width: var(--text-mass); }
.hx-text p, .hx-geblieben { font: 400 19px/1.7 var(--serif); color: var(--ink2); }
.hx-text p { margin: 0 0 1.1em; hyphens: auto; }
.hx-text p:last-child { margin-bottom: 0; }
.hx-initial::first-letter { float: left; margin: .07em .1em 0 0; font: 600 3.55em/.8 var(--serif); color: var(--accent-d); }

/* Kernsatz (bestehender Satz, nur hervorgehoben) */
.hx-kern { max-width: 30em; margin: 40px 0; padding-left: 22px; border-left: 3px solid var(--accent); font: italic 400 23px/1.45 var(--serif); color: var(--ink); text-wrap: pretty; }
@media (min-width: 768px) { .hx-kern { font-size: 26px; } }

/* Fakten: große Zahl und die fünf Vorwerke */
.hx-fakten { display: grid; gap: 32px; margin: 40px 0; }
.hx-fakten .hx-kern { margin: 0; }
.hx-zahl { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; align-content: start; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.hx-zahl-wert { font: 700 54px/1 var(--head); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.hx-zahl-einheit { font: 600 22px/1 var(--head); color: var(--accent-d); }
.hx-zahl-text { grid-column: 1 / -1; margin-top: 10px; font: 400 16px/1.5 var(--font); color: var(--muted); }
.hx-fakten > .hx-zahl { max-width: 440px; }
@media (min-width: 768px) { .hx-zahl-wert { font-size: 64px; } }
/* nebeneinander erst, wenn die Zahl sicher in ihre Spalte passt */
@media (min-width: 1200px) { .hx-fakten { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; } }
.hx-vorwerke { max-width: var(--text-mass); margin: 28px 0 32px; padding: 18px 0; border-block: 1px solid var(--line); }
.hx-vorwerke-titel { margin: 0 0 10px; font: 700 14px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hx-vorwerke ul { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; padding: 0; list-style: none; }
.hx-vorwerke li { margin: 0; font: 600 20px/1.3 var(--head); color: var(--ink); }
.hx-vorwerke li:not(:last-child)::after { content: "·"; margin: 0 14px; color: var(--ctl); }
.hx-vorwerke li.ist-dargast { color: var(--accent-d); }

/* Heute: was geblieben ist */
.hx-geblieben { max-width: var(--text-mass); margin: 0 0 8px; padding: 0; list-style: none; }
.hx-geblieben li { margin: 0; padding: 14px 0 14px 28px; border-bottom: 1px solid var(--line); position: relative; }
.hx-geblieben li::before { content: ""; position: absolute; left: 4px; top: 1.45em; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.hx-geblieben strong { color: var(--ink); font-weight: 650; }

/* --- Bilder im Erzählfluss: Fotoabzüge ----------------------------------------------------------- */
.hx-fig { margin: 40px 0; }
.hx-bild { display: block; padding: 8px; background: var(--papier); border-radius: 3px; box-shadow: 0 1px 2px rgba(11, 37, 51, .1), 0 12px 28px -10px rgba(11, 37, 51, .28); transition: box-shadow .2s, translate .2s; }
.hx-bild:hover { translate: 0 -2px; box-shadow: 0 1px 2px rgba(11, 37, 51, .1), 0 18px 36px -12px rgba(11, 37, 51, .34); }
.hx-bild picture { display: block; }
.hx-bild img { width: 100%; border-radius: 1px; }
.hx-fig figcaption { margin-top: 12px; font: italic 400 16px/1.5 var(--serif); color: var(--muted); text-wrap: pretty; }
.hx-fig--hoch { max-width: 400px; }
.hx-paar { display: grid; gap: 32px; margin: 40px 0; }
.hx-paar .hx-fig { margin: 0; }
@media (min-width: 768px) {
  .hx-bild { padding: 10px; }
  /* links/rechts: Bild 60 %, Unterschrift daneben (unten bündig) */
  .hx-fig--l, .hx-fig--r { display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 28px; align-items: end; }
  .hx-fig--r { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); }
  .hx-fig--r .hx-bild { order: 2; }
  .hx-fig--r figcaption { text-align: right; }
  .hx-fig--l figcaption, .hx-fig--r figcaption { margin: 0 0 6px; }
  .hx-paar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
  .hx-fig { margin: 56px 0; }
}

/* Damals/Heute-Regler (erscheint nur, wenn ein heutiges Foto eingetragen ist) */
.hx-vgl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; position: relative; }
.hx-vgl .hx-bild img { aspect-ratio: 1200 / 755; object-fit: cover; }
.hx-vgl-marke { display: none; }
.hx-vergleich.is-aktiv .hx-vgl { display: block; padding: 10px; background: var(--papier); border-radius: 3px; box-shadow: 0 1px 2px rgba(11, 37, 51, .1), 0 12px 28px -10px rgba(11, 37, 51, .28); }
.hx-vergleich.is-aktiv .hx-bild { padding: 0; box-shadow: none; background: none; translate: none; }
.hx-vergleich.is-aktiv .hx-vgl-damals { position: absolute; inset: 10px; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.hx-vergleich.is-aktiv .hx-vgl::after { content: ""; position: absolute; top: 10px; bottom: 10px; left: calc(10px + (100% - 20px) * var(--pos-zahl, .5)); width: 2px; margin-left: -1px; background: var(--white); box-shadow: 0 0 0 1px rgba(11, 37, 51, .35); pointer-events: none; }
.hx-vergleich.is-aktiv .hx-vgl-marke { display: block; position: absolute; top: 20px; padding: 4px 10px; border-radius: 4px; background: rgba(11, 37, 51, .82); color: var(--white); font: 600 14px/1.3 var(--font); pointer-events: none; }
.hx-vgl-marke--damals { left: 20px; }
.hx-vgl-marke--heute { right: 20px; }
.hx-vgl-steuer { display: block; margin-top: 14px; }
.hx-vgl-steuer input { width: 100%; min-height: 44px; accent-color: var(--accent); cursor: ew-resize; }

/* --- Zeitleiste und Jahreszahlen (Desktop) --------------------------------------------------- */
@media (min-width: 1024px) {
  .hx-kap, .hx-archiv { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); column-gap: var(--rail-gap); }
  .hx-archiv .hx-main { grid-column: 2; }
  .hx-kap { padding-bottom: 96px; }
  .hx-rail { display: block; }
  .hx-jahr { position: sticky; top: 112px; margin: 0; text-align: right; font: 700 48px/1 var(--head); letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
  .hx-kap--heute .hx-jahr { color: var(--accent-d); }
  /* im Text nur für Screenreader, sichtbar ist die große Zahl links */
  .hx-h2-jahr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hx-main > h2 { font-size: 34px; }
  /* senkrechte Linie mitten in der Lücke; füllt sich beim Scrollen (--fill, historie.js) */
  .hx-linie { display: block; position: absolute; top: 20px; bottom: 0; left: calc(var(--rail) + var(--rail-gap) / 2 - 1px); width: 2px; background: var(--line); }
  .hx-linie i { display: block; width: 100%; height: calc(var(--fill, 1) * 100%); background: var(--accent); }
  /* Jahresmarke je Kapitel */
  .hx-kap::before { content: ""; position: absolute; top: 13px; left: calc(var(--rail) + var(--rail-gap) / 2 - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ground); box-shadow: 0 0 0 2px var(--accent); z-index: 1; transition: background-color .3s, box-shadow .3s; }
  .hx-zeit.ist-gesteuert .hx-kap:not(.is-erreicht)::before { background: var(--ground); box-shadow: 0 0 0 2px var(--ctl); }
}

/* --- Brücke ins Heute --------------------------------------------------------------------- */
.hx-bruecke { background: var(--white); }
.hx-bruecke h2 { margin-bottom: 24px; }
.hx-bruecke .teasers { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* --- Lightbox mit Bildunterschrift (site.js) -------------------------------------------------- */
.page-historie-landgut-dargast .lightbox img { max-height: calc(100vh - 160px); }
.page-historie-landgut-dargast .lb-count { padding-inline: 72px; font-size: 16px; line-height: 1.45; text-wrap: balance; }
@media (max-width: 767px) { .page-historie-landgut-dargast .lb-count { padding-inline: 16px; bottom: 12px; } }

/* --- Bewegung: nur mit JS (Klasse hx-bewegt) und ohne reduced motion --------------------------- */
.hx-bewegt .hx-reveal { opacity: 0; translate: 0 18px; transition: opacity .8s ease, translate .8s ease; }
.hx-bewegt .hx-reveal.is-in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .hx-weiter svg { animation: none; }
  .hx-bild, .hx-kap::before { transition: none; }
  .hx-bild:hover { translate: none; }
  .hx-bewegt .hx-reveal { opacity: 1; translate: none; transition: none; }
}

@media print {
  .hx-hero { height: auto; min-height: 0; color: var(--ink); background: none; }
  .hx-hero > picture, .hx-hero-bild, .hx-hero::after, .hx-weiter, .hx-linie, .hx-rail { display: none; }
  .hx-hero h1, .hx-hero-unterzeile { color: #000; text-shadow: none; }
  .hx-bewegt .hx-reveal { opacity: 1; translate: none; }
}
