/* Layout: ruhige, zentrierte Lesespalte (ca. 68ch) mit Kopfzeile, großzügigem Weißraum
   und einer Zeitleiste als einzigem gestalterischen Akzent. Keine externen Schriften (DSGVO). */
:root {
  --bg: #fbfcfb;
  --surface: #f1f4f2;
  --fg: #1b2420;
  --muted: #5a6761;
  --line: #dde3df;
  --accent: #2c5443;      /* Tannengrün */
  --accent-soft: #e3ece7;
  --wheat: #a8812f;       /* Getreide-Ocker, nur für kleine Details */
  --mark: #fff1b8;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2.1rem, 5vw, 3.2rem);
  --measure: 68ch;
  --wide: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121715; --surface: #1a211e; --fg: #e6ece8; --muted: #9daaa3; --line: #2b3531;
    --accent: #8cc4a8; --accent-soft: #1f2d27; --wheat: #d6b468; --mark: #4a4220;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121715; --surface: #1a211e; --fg: #e6ece8; --muted: #9daaa3; --line: #2b3531;
  --accent: #8cc4a8; --accent-soft: #1f2d27; --wheat: #d6b468; --mark: #4a4220;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 700px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* Kopfzeile */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; padding-block: 1.1rem; }
.brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--fg); text-decoration: none; letter-spacing: 0.01em; }
.brand small { display: block; font-family: var(--font-body); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; font-size: var(--step--1); }
.nav a { color: var(--muted); text-decoration: none; padding-block: 0.3rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

/* Typografie */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--wheat); font-weight: 600; }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--fg); max-width: 40ch; }
.muted { color: var(--muted); }
.flow > * + * { margin-top: 1.1em; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; }
.prose em { font-style: italic; }

/* Startseite: Kopfbereich */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; } }
.hero-text { display: grid; gap: 1.4rem; min-width: 0; }
.quote { font-family: var(--font-display); font-style: italic; font-size: var(--step-1); color: var(--muted); border-left: 2px solid var(--wheat); padding-left: 1rem; max-width: 36ch; }
.quote span { display: block; font-style: normal; font-family: var(--font-body); font-size: var(--step--1); margin-top: 0.3rem; }
.button { display: inline-flex; align-items: center; gap: 0.5rem; justify-self: start; background: var(--accent); color: var(--bg); text-decoration: none; padding: 0.7rem 1.2rem; border-radius: 3px; font-size: var(--step--1); font-weight: 600; }
.button:hover { filter: brightness(1.08); }

figure { margin: 0; }
figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.6rem; line-height: 1.5; }
figcaption .sig { font-family: var(--font-mono); font-size: 0.78rem; }
.doc-figure img { border: 1px solid var(--line); background: var(--surface); padding: 0.75rem; }

/* Abschnitte */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 0.5rem; margin-bottom: 2rem; max-width: var(--measure); }
.split { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; } }
.split > * { min-width: 0; }

/* Zeitleiste */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 52rem; }
.timeline li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.25rem; padding-block: 1rem; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .year { font-family: var(--font-display); font-size: var(--step-1); color: var(--accent); font-variant-numeric: tabular-nums lining-nums; line-height: 1.3; }
.timeline p { min-width: 0; }

/* Spuren heute */
.traces { display: grid; gap: 1.5rem; list-style: none; padding: 0; margin-bottom: 0; }
.traces li { display: grid; gap: 0.25rem; }
.traces strong { font-weight: 600; }

/* Unterseite: Artikel mit Inhaltsverzeichnis */
.page-head { padding-block: clamp(2.5rem, 7vw, 4.5rem) 2rem; display: grid; gap: 1rem; max-width: var(--measure); }
.article { display: grid; gap: 2.5rem; padding-bottom: 4rem; }
@media (min-width: 1000px) { .article { grid-template-columns: 14rem minmax(0, 1fr); gap: 4rem; } }
.toc { font-size: var(--step--1); align-self: start; }
@media (min-width: 1000px) { .toc { position: sticky; top: 1.5rem; } }
.toc p { font-weight: 600; margin-bottom: 0.5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; color: var(--muted); }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.prose figure { margin-block: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.5rem; }
.sources { font-size: var(--step--1); }
.sources h3 { font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 1.8rem; }
.sources a { word-break: break-word; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.people li { padding-block: 0.9rem; border-top: 1px solid var(--line); display: grid; gap: 0.15rem; }
.people li:last-child { border-bottom: 1px solid var(--line); }
.people .dates { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }

.placeholder { background: var(--mark); padding: 0 0.25em; border-radius: 2px; }
.note { background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.2rem; border-radius: 3px; font-size: var(--step--1); }

/* Fußzeile */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; padding-block: 1.75rem; }
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
html { scroll-behavior: smooth; }

/* Stammbaum */
.ruf { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }
.stammlinie { list-style: none; margin: 0; padding: 0; max-width: 52rem; position: relative; }
.stammlinie li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding-bottom: 1.4rem; position: relative; }
.stammlinie li::before { content: ""; position: absolute; left: calc(1.25rem - 0.5px); top: 2.2rem; bottom: 0.2rem; width: 1px; background: var(--line); }
.stammlinie li:last-child::before { display: none; }
.stammlinie .gen { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-variant-numeric: tabular-nums lining-nums; background: var(--bg); }
.line-body { min-width: 0; padding-top: 0.3rem; display: grid; gap: 0.15rem; }
.line-name { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.3; }
.line-name .linklike { color: var(--fg); }
.line-name .linklike:hover { color: var(--accent); }
.line-meta, .line-spouse { font-size: var(--step--1); color: var(--muted); }
.line-spouse span { white-space: nowrap; }
.line-note { font-size: var(--step--1); color: var(--wheat); font-weight: 600; }

.tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-size: var(--step--1); color: var(--muted); margin-bottom: 1rem; }
.tree-tools .sep { color: var(--line); }
.tree-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); padding: 1rem; }
.tree { display: grid; grid-template-columns: repeat(4, minmax(10.5rem, 1fr)); gap: 0.75rem; min-width: 45rem; }
.tcol { display: flex; flex-direction: column; justify-content: space-around; gap: 0.5rem; }
.pcard { display: grid; gap: 0.15rem; text-align: left; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 3px; padding: 0.55rem 0.7rem; cursor: pointer; min-height: 3.6rem; }
.pcard.m { border-left-color: var(--accent); }
.pcard.f { border-left-color: var(--wheat); }
.pcard:hover { border-color: var(--accent); }
.pcard.focus { background: var(--accent-soft); }
.pcard.empty { cursor: default; color: var(--muted); border-style: dashed; border-left-width: 1px; font-size: var(--step--1); align-content: center; }
.pcard .kek { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }
.pcard .pname { font-size: 0.92rem; line-height: 1.3; font-weight: 600; }
.tcol[data-depth="3"] .pname { font-size: 0.82rem; font-weight: 500; }
.pcard .plife { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard .more { font-size: 0.75rem; color: var(--accent); }
.tree-layout { display: grid; gap: 1.5rem; }
.tree-layout > * { min-width: 0; }
@media (min-width: 1400px) { .tree-layout { grid-template-columns: minmax(0, 1fr) 18rem; align-items: start; } }
@media (min-width: 700px) and (max-width: 1399px) { .person-detail { max-width: var(--measure); } }
.person-detail { border-top: 2px solid var(--accent); padding-top: 1rem; display: grid; gap: 0.75rem; font-size: var(--step--1); }
.person-detail h3 { font-size: var(--step-1); }
.facts { margin: 0; display: grid; gap: 0.5rem; }
.facts div { display: grid; grid-template-columns: 6rem 1fr; gap: 0.5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: var(--step--1); color: var(--muted); margin-top: 0.75rem; }
.legend span::before { content: ""; display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.4rem; vertical-align: -0.1rem; border-left: 3px solid; }
.legend .lm::before { border-color: var(--accent); }
.legend .lf::before { border-color: var(--wheat); }

/* Nicht urkundlich gesicherte Generationen */
.tag-unsicher { display: inline-block; font-family: var(--font-body); font-style: italic; font-size: 0.8rem; color: var(--muted); border: 1px dashed var(--muted); border-radius: 2px; padding: 0 0.35rem; line-height: 1.5; vertical-align: 0.15em; white-space: nowrap; }
.stammlinie li.unsicher .gen { border-style: dashed; opacity: 0.75; }
.stammlinie li.unsicher .line-name .linklike { color: var(--muted); }
.pcard.unsicher { border-style: dashed; border-left-style: dashed; }
.pcard .tag-unsicher { justify-self: start; font-size: 0.7rem; margin-top: 0.15rem; }
.stammlinie-hinweis { max-width: var(--measure); margin-bottom: 1.5rem; }
/* ===== Entwurf D „Archiv“ (v2, gediegen): Anthrazit, Papierweiß, Steingrau, gedecktes Siegelrot ===== */
@font-face { font-family: "UnifrakturMaguntia"; src: url(../fonts/unifrakturmaguntia-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(../fonts/eb-garamond-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(../fonts/eb-garamond-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(../fonts/eb-garamond-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
:root:not(#_) {
  --bg: #14181c; --surface: #1b2025; --fg: #e3dfd7; --muted: #9a958c; --line: #2d3339;
  --accent: #bdb5a6; --accent-soft: #22282d; --wheat: #9e5a50; --mark: #4a4436;
  --font-display: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  --font-body: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  --font-fraktur: "UnifrakturMaguntia", "EB Garamond", Georgia, serif;
  --step-0: 1.2rem; color-scheme: dark;
}
body { font-variant-numeric: oldstyle-nums; }
.brand { font-family: var(--font-fraktur); font-size: 1.9rem; color: var(--fg); }
.brand small { font-family: var(--font-body); font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.14em; font-size: 0.95rem; color: var(--muted); }
.nav { font-size: 1.05rem; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
h1 { font-family: var(--font-fraktur); font-weight: 400; font-size: clamp(2.6rem, 6.5vw, 4.4rem); line-height: 1.1; }
h2, h3 { font-style: italic; font-weight: 400; }
h2 { font-size: 2rem; }
.eyebrow { font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.16em; font-size: 1rem; font-weight: 400; color: var(--muted); }
.lead { font-size: 1.4rem; }
.quote { color: var(--fg); border-left: 0; padding-left: 0; font-size: 1.5rem; }
.quote span { font-family: var(--font-body); font-style: italic; color: var(--muted); font-size: 1rem; }
.button { background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 0; font-family: var(--font-body); font-size: 1.05rem; font-weight: 400; letter-spacing: 0.05em; }
.button:hover { background: var(--accent); color: var(--bg); filter: none; }
.doc-figure img { border: 1px solid var(--line); padding: 0.9rem; background: #101316; outline: 1px solid var(--line); outline-offset: 6px; }
.section { border-top: 0; position: relative; }
.section::before { content: "❦"; position: absolute; top: -0.75em; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 1.2rem; background: var(--bg); padding-inline: 0.8rem; }
.section { background-image: linear-gradient(var(--line), var(--line)); background-size: 100% 1px; background-repeat: no-repeat; }
.timeline .year { color: var(--accent); font-variant-numeric: oldstyle-nums; font-size: 1.6rem; }
.timeline li, .people li, .timeline li:last-child { border-color: var(--line); }
a { color: var(--fg); text-decoration-color: var(--muted); }
a:hover { text-decoration-color: var(--fg); }
.site-header, .site-footer { border-color: var(--line); }
.pcard { background: var(--surface); }
.pcard.m { border-left-color: var(--accent); } .pcard.f { border-left-color: var(--wheat); }
.pcard .pname { font-weight: 600; font-size: 1rem; }
.stammlinie .gen { font-variant-numeric: oldstyle-nums; }
.legend .lf::before { border-color: var(--wheat); }
