/* ==========================================================================
   Stapel is de Naam – design system
   Kleuren: donkergroen #183D32 · gebroken wit #F7F5EF · warm beige #E8DFCE
            donkergrijs #303532 · goud #B49A65 · wit #FFFFFF
   Letters: Cormorant Garamond (titels) · Source Sans 3 (tekst)
   Raster: 8px-basis; vaste maximale breedte 1200px
   ========================================================================== */

:root {
  --green: #183D32;
  --green-ink: #12302a;
  --green-soft: #2a5446;
  --offwhite: #F7F5EF;
  --beige: #E8DFCE;
  --beige-soft: #F1EBDF;
  --ink: #303532;
  --ink-soft: #5d625f;
  --gold: #B49A65;
  --gold-dark: #8a7444;
  --white: #FFFFFF;
  --line: rgba(48, 53, 50, 0.16);
  --line-strong: rgba(48, 53, 50, 0.32);

  --font-title: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-text: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --radius: 2px;
  --max: 1200px;
  --shadow: 0 1px 2px rgba(24, 61, 50, 0.06), 0 4px 16px rgba(24, 61, 50, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--offwhite); color: var(--ink);
  font-family: var(--font-text); font-size: 1.0625rem; line-height: 1.6;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-soft); text-decoration-color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--font-title); font-weight: 600; color: var(--green); line-height: 1.15; margin: 0 0 var(--s4); letter-spacing: 0.005em; }
h1 { font-size: clamp(2.25rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 2.5vw, 2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.2em; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--ink); max-width: 46em; }
.eyebrow { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: var(--s2); }
.note { font-size: 0.9rem; color: var(--ink-soft); border-left: 2px solid var(--gold); padding-left: var(--s3); margin-top: var(--s5); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s4); top: -60px; background: var(--gold); color: var(--green-ink); padding: var(--s2) var(--s4); z-index: 100; font-weight: 600; }
.skip-link:focus { top: var(--s2); }
code { font-size: 0.9em; background: var(--beige-soft); padding: 0 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--s5); }
.container.narrow { max-width: 760px; }

/* ---------- Kop ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar { background: var(--green); color: var(--beige); font-size: 0.85rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: var(--s4); }
.topbar-note { letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; color: var(--gold); }
.topbar-nav { display: flex; gap: var(--s5); align-items: center; }
.topbar-nav a, .topbar-nav .linklike { color: var(--beige); text-decoration: none; }
.topbar-nav a:hover, .topbar-nav .linklike:hover, .topbar-nav a[aria-current] { color: var(--white); text-decoration: underline; text-decoration-color: var(--gold); }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--green); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }

.masthead { display: flex; align-items: center; gap: var(--s5); padding-top: var(--s4); padding-bottom: var(--s4); }
.wordmark { display: flex; align-items: center; gap: var(--s3); color: var(--green); text-decoration: none; margin-right: auto; }
.wordmark:hover { color: var(--green); }
.wordmark-mark { color: var(--gold); display: flex; }
.wordmark-text { display: flex; flex-direction: column; }
.wordmark-title { font-family: var(--font-title); font-size: 1.75rem; font-weight: 600; line-height: 1; letter-spacing: 0.02em; }
.wordmark-sub { font-size: 0.8rem; color: var(--ink-soft); letter-spacing: 0.04em; margin-top: 4px; }
.header-search { display: flex; border: 1px solid var(--line-strong); background: var(--offwhite); }
.header-search input { border: 0; background: transparent; padding: 8px 12px; font: inherit; font-size: 0.95rem; width: 260px; color: var(--ink); }
.header-search input:focus { outline: none; }
.header-search:focus-within { outline: 3px solid var(--gold); outline-offset: 1px; }
.header-search button { border: 0; background: transparent; color: var(--green); padding: 0 12px; cursor: pointer; }
.nav-toggle { display: none; }

.main-nav { border-top: 1px solid var(--line); }
.main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: var(--s1); }
.main-nav a { display: block; padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.98rem; border-bottom: 3px solid transparent; }
.main-nav li:first-child a { padding-left: 0; }
.main-nav a:hover { color: var(--green); border-bottom-color: var(--beige); }
.main-nav a[aria-current] { color: var(--green); border-bottom-color: var(--gold); }
.mobile-only { display: none; }

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px 20px; border: 1px solid var(--green); background: var(--white); color: var(--green);
  font: 600 0.95rem/1.2 var(--font-text); text-decoration: none; cursor: pointer; border-radius: var(--radius);
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--beige-soft); color: var(--green); }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-soft); color: var(--white); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--green-ink); }
.btn-gold:hover { background: #c4ab78; color: var(--green-ink); }
.btn-ghost { background: transparent; border-color: rgba(232, 223, 206, 0.6); color: var(--beige); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.btn-light { background: var(--offwhite); border-color: var(--offwhite); color: var(--green); }
.btn-quiet { border-color: var(--line-strong); color: var(--ink); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-danger { border-color: #7a2e22; color: #7a2e22; }
.arrow-link { font-weight: 600; text-decoration: none; }
.arrow-link::after { content: ' →'; color: var(--gold-dark); }
.arrow-link:hover { text-decoration: underline; }

/* ---------- Paginakop ---------- */
.page-head { background: var(--white); border-bottom: 1px solid var(--line); padding: var(--s6) 0 var(--s6); margin-bottom: var(--s6); }
.page-head h1 { margin-bottom: var(--s3); }
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: var(--s4); }
.breadcrumb a { color: var(--ink-soft); }

/* ---------- Home ---------- */
.hero { background: var(--green); color: var(--beige); padding: var(--s8) 0; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 63px, rgba(180, 154, 101, 0.07) 63px 64px); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s8); align-items: end; position: relative; z-index: 1; }
.hero h1 { color: var(--white); font-size: clamp(2.75rem, 6vw, 4.5rem); font-weight: 500; margin-bottom: var(--s2); }
.hero .eyebrow { color: var(--gold); }
.hero-sub { font-family: var(--font-title); font-style: italic; font-size: 1.6rem; color: var(--gold); margin-bottom: var(--s5); }
.hero-lead { font-size: 1.15rem; max-width: 36em; color: var(--beige); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0; }
.hero-search { max-width: 520px; }
.hero-search label { display: block; font-size: 0.85rem; letter-spacing: 0.04em; margin-bottom: var(--s2); color: var(--beige); }
.field-inline { display: flex; gap: var(--s2); }
.field-inline input { flex: 1; min-width: 0; }
.hero-search input { border: 1px solid rgba(232, 223, 206, 0.5); background: rgba(255, 255, 255, 0.06); color: var(--white); padding: 10px 14px; font: inherit; }
.hero-search input::placeholder { color: rgba(232, 223, 206, 0.7); }
.hero-facts { border: 1px solid rgba(180, 154, 101, 0.45); padding: var(--s5); }
.hero-facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s4); margin: 0; }
.hero-facts dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--beige); }
.hero-facts dd { margin: 0; font-family: var(--font-title); font-size: 2.6rem; line-height: 1.1; color: var(--white); }
.hero-facts-note { margin: var(--s5) 0 0; padding-top: var(--s4); border-top: 1px solid rgba(180, 154, 101, 0.35); font-size: 0.9rem; color: var(--beige); }

.section { padding: var(--s8) 0; }
.section-tint { background: var(--beige-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-block { margin: var(--s7) 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); align-items: start; }
.two-col-wide { grid-template-columns: 1.5fr 1fr; }

.lineage-panel { background: var(--white); border: 1px solid var(--line); padding: var(--s6); box-shadow: var(--shadow); }
.lineage { list-style: none; padding: 0; margin: 0 0 var(--s5); counter-reset: none; }
.lineage li { position: relative; padding: 0 0 var(--s4) var(--s6); display: flex; flex-direction: column; }
.lineage li::before { content: ''; position: absolute; left: 7px; top: 8px; width: 9px; height: 9px; border: 2px solid var(--gold); background: var(--white); transform: rotate(45deg); }
.lineage li::after { content: ''; position: absolute; left: 11px; top: 22px; bottom: 0; width: 1px; background: var(--line-strong); }
.lineage li:last-child::after { display: none; }
.lineage-gen { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); }
.lineage a { font-family: var(--font-title); font-size: 1.35rem; font-weight: 600; text-decoration: none; }
.lineage a:hover { text-decoration: underline; }
.lineage-dates { font-size: 0.9rem; color: var(--ink-soft); }

.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.branch-card { display: flex; flex-direction: column; gap: var(--s2); background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--green); padding: var(--s5); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.branch-card:hover { border-top-color: var(--gold); box-shadow: var(--shadow); color: var(--ink); }
.branch-card-region { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); }
.branch-card-name { font-family: var(--font-title); font-size: 1.45rem; font-weight: 600; color: var(--green); line-height: 1.15; }
.branch-card-summary { font-size: 0.95rem; flex: 1; }
.branch-card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 0.85rem; padding-top: var(--s3); border-top: 1px solid var(--line); }

.mini-timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line-strong); }
.mini-timeline li { display: grid; grid-template-columns: 72px 1fr; gap: var(--s3); padding: var(--s2) 0 var(--s3) var(--s4); position: relative; }
.mini-timeline li::before { content: ''; position: absolute; left: -4px; top: 15px; width: 7px; height: 7px; background: var(--gold); }
.mini-timeline-year { font-family: var(--font-title); font-size: 1.25rem; font-weight: 600; color: var(--green); }
.mini-timeline-body { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mini-timeline-title { font-weight: 600; }

.featured-list { display: grid; gap: var(--s4); }
.featured-person { background: var(--white); border: 1px solid var(--line); padding: var(--s4) var(--s5); }
.featured-person h3 { margin-bottom: 2px; font-size: 1.3rem; }
.featured-person h3 a { text-decoration: none; }
.featured-person p { margin-bottom: var(--s2); font-size: 0.95rem; }

.change-list { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.change-list li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.callout { background: var(--green); color: var(--beige); padding: var(--s6); }
.callout h2 { color: var(--white); }
.callout .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--green-ink); }

/* ---------- Documentkaarten ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.doc-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: box-shadow .15s; }
.doc-card:hover { box-shadow: var(--shadow); color: var(--ink); }
.doc-card-visual { height: 132px; display: flex; align-items: center; justify-content: center; background: var(--beige); color: var(--gold-dark); border-bottom: 1px solid var(--line); overflow: hidden; }
.doc-card-visual img { width: 100%; height: 100%; object-fit: cover; }
.doc-card-body { padding: var(--s4); display: flex; flex-direction: column; gap: 4px; }
.doc-card-cat { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-dark); }
.doc-card-title { font-weight: 600; line-height: 1.35; color: var(--green); }
.doc-card-rights { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Statussen en labels ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; line-height: 1; padding: 4px 8px 4px 6px; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); white-space: nowrap; vertical-align: middle; }
.status-mark { width: 10px; height: 10px; display: inline-block; flex: none; }
.status-geverifieerd { border-color: var(--green); color: var(--green); }
.status-geverifieerd .status-mark { background: var(--green); }
.status-aanwijzingen { border-color: var(--green-soft); color: var(--green-soft); }
.status-aanwijzingen .status-mark { border: 2px solid var(--green-soft); }
.status-waarschijnlijk { border-color: var(--gold); color: var(--gold-dark); }
.status-waarschijnlijk .status-mark { background: var(--gold); border-radius: 50%; }
.status-onbevestigd { border-style: dashed; color: var(--ink-soft); }
.status-onbevestigd .status-mark { border: 2px dashed var(--ink-soft); border-radius: 50%; }
.status-betwist { background: var(--ink); border-color: var(--ink); color: var(--white); }
.status-betwist .status-mark { background: linear-gradient(45deg, transparent 40%, var(--gold) 40% 60%, transparent 60%); border: 1px solid var(--gold); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; background: var(--beige-soft); border: 1px solid var(--line); color: var(--ink); text-transform: none; vertical-align: middle; white-space: nowrap; }
.tag-row, .legend-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.legend-row { margin: 0 0 var(--s5); }
.rel-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border: 1px solid; white-space: nowrap; }
.rel-own { background: var(--green); border-color: var(--green); color: var(--white); }
.rel-none { border-color: var(--line-strong); color: var(--ink); background: var(--white); }
.rel-hyp { border-color: var(--gold); border-style: dashed; color: var(--gold-dark); background: var(--white); }
.rel-unknown { border-color: var(--line); color: var(--ink-soft); background: var(--beige-soft); }
.doc-level { font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border: 1px solid var(--line-strong); background: var(--white); display: inline-block; }
.doc-uitgebreid { border-color: var(--green); color: var(--green); }
.doc-gedeeltelijk { border-color: var(--gold); color: var(--gold-dark); }
.consulted { font-weight: 600; }
.consulted-origineel, .consulted-index { color: var(--green); }
.consulted-secundair { color: var(--gold-dark); }
.consulted-niet { color: var(--ink-soft); }
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; font-size: 0.75rem; font-family: var(--font-text); font-weight: 600; background: var(--beige); color: var(--ink); text-align: center; vertical-align: middle; }
.ref { display: inline-block; min-width: 1.4em; padding: 0 4px; margin-left: 2px; font-size: 0.72rem; font-weight: 600; text-align: center; text-decoration: none; background: var(--beige); color: var(--green); vertical-align: super; line-height: 1.5; }
.ref:hover { background: var(--gold); color: var(--green-ink); }

/* ---------- Panelen, tabellen, feiten ---------- */
.panel { background: var(--white); border: 1px solid var(--line); padding: var(--s5) var(--s5) var(--s4); margin-bottom: var(--s5); }
.panel > h2 { font-size: 1.5rem; margin-bottom: var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.prose p, .prose li { max-width: 44em; }
.prose h3 { margin-top: var(--s5); }
.source-note { background: var(--beige-soft); border-left: 3px solid var(--gold); padding: var(--s3) var(--s4); font-size: 0.95rem; margin: var(--s4) 0; }
.notice { background: var(--beige-soft); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: var(--s4) var(--s5); margin: var(--s4) 0; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice-error { border-left-color: #7a2e22; background: #f7efe9; }
.notice-ok { border-left-color: var(--green); }

.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 220px 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 600; color: var(--ink-soft); font-size: 0.92rem; }
.facts dd { margin: 0; }

.table-wrap { overflow-x: auto; margin-bottom: var(--s5); border: 1px solid var(--line); background: var(--white); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { background: var(--beige-soft); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.data-table tbody tr:hover { background: #fbfaf6; }
.data-table tbody th { font-weight: 600; }
.data-table tbody th a { text-decoration: none; }
.data-table tbody th a:hover { text-decoration: underline; }
.data-table tr:last-child td, .data-table tr:last-child th { border-bottom: 0; }
.panel .table-wrap { border: 0; }

.plain { list-style: none; padding: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.source-list li { padding: 6px 0; }
.source-list li:target { background: var(--beige-soft); }

/* ---------- Persoonskaarten ---------- */
.person-card { display: flex; flex-direction: column; gap: 2px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); padding: 10px 14px; text-decoration: none; color: var(--ink); margin-bottom: var(--s2); transition: box-shadow .15s, border-color .15s; }
.person-card:hover { box-shadow: var(--shadow); color: var(--ink); }
.person-card.is-m { border-left-color: var(--green); }
.person-card.is-f { border-left-color: var(--gold); }
.person-card-name { font-weight: 600; color: var(--green); line-height: 1.3; }
.person-card-dates { font-size: 0.88rem; color: var(--ink); }
.person-card-meta { font-size: 0.8rem; color: var(--ink-soft); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2) var(--s3); }
.card-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.card-row .person-card { min-width: 220px; margin: 0; }
.card-stack .person-card:last-child { margin-bottom: 0; }

/* ---------- Persoonsprofiel ---------- */
.person-head { display: flex; justify-content: space-between; gap: var(--s5); align-items: end; flex-wrap: wrap; }
.person-head h1 { margin-bottom: var(--s1); }
.person-lifespan { font-size: 1.2rem; margin: 0 0 var(--s1); }
.person-actions { display: flex; flex-wrap: wrap; gap: var(--s2); max-width: 520px; justify-content: flex-end; }
.lineage-crumb { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 4px; }
.person-layout, .branch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.person-aside .panel > h2, .branch-aside .panel > h2 { font-size: 1.3rem; }
.research-note { border: 1px dashed var(--gold); padding: var(--s4); margin-bottom: var(--s3); background: var(--white); }
.research-note h3 { font-size: 1.15rem; font-family: var(--font-text); font-weight: 600; color: var(--ink); margin-bottom: var(--s2); }
.research-note p { font-size: 0.95rem; margin: 0; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }

/* ---------- Familietakken ---------- */
.branch-table th a { font-family: var(--font-title); font-size: 1.2rem; }
.branch-grid-large { margin-top: var(--s6); }
.branch-block { background: var(--white); border: 1px solid var(--line); padding: var(--s5); }
.branch-block h2 { font-size: 1.45rem; }
.branch-block h2 a { text-decoration: none; }
.generation { margin-bottom: var(--s5); }
.generation-label { font-family: var(--font-text); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); border-bottom: 1px solid var(--line); padding-bottom: var(--s2); }
.place-list li { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }

/* ---------- Formulieren ---------- */
.form .field, .filter-panel .field, .field { margin-bottom: var(--s4); }
label, legend { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
input[type=text], input:not([type]), input[type=search], input[type=email], input[type=number], input[type=password], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--green); }
textarea { resize: vertical; min-height: 120px; }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 400; font-size: 0.95rem; margin-bottom: var(--s2); }
.check input { margin-top: 5px; flex: none; }
.help { font-size: 0.85rem; color: var(--ink-soft); margin: 6px 0 0; }
.req { font-size: 0.75rem; font-weight: 400; color: var(--ink-soft); margin-left: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.field-pair { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.field-pair legend { width: 100%; }
.field-pair input { flex: 1; min-width: 70px; width: auto; }
.hp { position: absolute; left: -9999px; }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: var(--s3); }

.filter-panel { background: var(--white); border: 1px solid var(--line); padding: var(--s5); position: sticky; top: var(--s4); }
.filter-actions { display: flex; gap: var(--s2); }
.filter-bar { display: flex; gap: var(--s4); align-items: end; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line); padding: var(--s4) var(--s5); margin-bottom: var(--s6); }
.filter-bar .field { margin: 0; min-width: 200px; }
.inline-filter select { width: auto; }
.register-layout, .archive-layout, .map-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s5); align-items: start; margin-bottom: var(--s7); }
.result-count { margin-bottom: var(--s3); color: var(--ink-soft); }
.pagination { display: flex; gap: var(--s1); flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border: 1px solid var(--line); background: var(--white); text-decoration: none; }
.pagination a[aria-current] { background: var(--green); color: var(--white); border-color: var(--green); }
.big-search { display: flex; gap: var(--s2); max-width: 640px; }
.big-search input { font-size: 1.1rem; }

.category-nav { background: var(--white); border: 1px solid var(--line); padding: var(--s5); position: sticky; top: var(--s4); }
.category-nav ul { list-style: none; padding: 0; margin: 0 0 var(--s5); }
.category-nav li a { display: flex; justify-content: space-between; padding: 6px 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.category-nav li a[aria-current] { color: var(--green); font-weight: 600; }
.legend-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: var(--s2); }

/* ---------- Stamboom ---------- */
.tree-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s5); align-items: start; margin-bottom: var(--s7); }
.tree-controls { background: var(--white); border: 1px solid var(--line); padding: var(--s5); position: sticky; top: var(--s4); }
.segmented { display: grid; gap: 0; border: 1px solid var(--line-strong); }
.segmented legend { margin-bottom: 6px; }
.segmented label { margin: 0; font-weight: 400; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.segmented label:last-child span { border-bottom: 0; }
.segmented input:checked + span { background: var(--green); color: var(--white); font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: -3px; }
.tree-legend { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s4); }
.tree-legend ul { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.tree-legend li { display: flex; align-items: center; gap: var(--s2); margin-bottom: 6px; }
.legend-swatch { width: 14px; height: 14px; border: 1px solid var(--line-strong); flex: none; }
.sw-m { border-left: 4px solid var(--green); }
.sw-f { border-left: 4px solid var(--gold); }
.legend-line { width: 22px; height: 0; border-top: 2px solid var(--green-soft); flex: none; }
.ln-dash { border-top-style: dashed; border-color: var(--ink-soft); }
.legend-more { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 16px; border-radius: 8px; background: var(--gold); color: var(--green-ink); font-size: 0.75rem; font-weight: 700; flex: none; }
.tree-stage { position: relative; min-width: 0; }
.tree-toolbar { display: flex; align-items: center; gap: var(--s2); background: var(--white); border: 1px solid var(--line); border-bottom: 0; padding: var(--s2) var(--s3); flex-wrap: wrap; }
.tool-btn { min-width: 36px; height: 34px; border: 1px solid var(--line-strong); background: var(--white); color: var(--green); font: 600 1.1rem/1 var(--font-text); cursor: pointer; }
.tool-btn:hover { background: var(--beige-soft); }
.tool-wide { font-size: 0.85rem; padding: 0 12px; }
.tool-hint { font-size: 0.8rem; color: var(--ink-soft); margin-left: auto; }
.tree-canvas { height: 640px; background: var(--offwhite); background-image: radial-gradient(rgba(48, 53, 50, 0.08) 1px, transparent 1px); background-size: 24px 24px; border: 1px solid var(--line); overflow: hidden; cursor: grab; touch-action: none; position: relative; }
.tree-canvas.is-dragging { cursor: grabbing; }
.tree-svg { width: 100%; height: 100%; display: block; }
.tree-loading { padding: var(--s6); color: var(--ink-soft); }
.link { fill: none; stroke: var(--green-soft); stroke-width: 1.5; }
.link-weak { stroke: var(--ink-soft); stroke-dasharray: 5 4; }
.node { cursor: pointer; }
.node-box { fill: var(--white); stroke: var(--line-strong); stroke-width: 1; }
.node-bar { fill: var(--line-strong); }
.node-m .node-bar { fill: var(--green); }
.node-f .node-bar { fill: var(--gold); }
.node-root .node-box { stroke: var(--green); stroke-width: 2; }
.node:hover .node-box, .node:focus .node-box { fill: var(--beige-soft); }
.node:focus { outline: none; }
.node:focus .node-box, .node.is-selected .node-box { stroke: var(--gold); stroke-width: 3; }
.node-name { font: 600 14px var(--font-text); fill: var(--green); }
.node-dates { font: 13px var(--font-text); fill: var(--ink); }
.node-sub { font: italic 12px var(--font-text); fill: var(--ink-soft); }
.node-hidden .node-name { fill: var(--ink-soft); }
.band { fill: rgba(232, 223, 206, 0.45); }
.gen-label rect { fill: rgba(255, 255, 255, 0.92); stroke: var(--line); }
.gen-title { font: 600 14px var(--font-text); fill: var(--green); }
.gen-years { font: 12px var(--font-text); fill: var(--ink-soft); }
.node-toggle { cursor: pointer; }
.node-toggle rect { fill: var(--white); stroke: var(--green); stroke-width: 1.5; }
.node-toggle text { font: 700 12px var(--font-text); fill: var(--green); }
.node-toggle.is-folded rect { fill: var(--gold); stroke: var(--gold-dark); }
.node-toggle.is-folded text { fill: var(--green-ink); }
.node-toggle:hover rect, .node-toggle:focus rect { stroke: var(--green-ink); stroke-width: 2.5; }
.node-toggle:focus { outline: none; }
.link.on-path { stroke: var(--gold-dark); stroke-width: 3.5; stroke-dasharray: none; }
.node.on-path .node-box { stroke: var(--gold); stroke-width: 2; fill: #fffaf0; }
.tree-summary { margin: 0 0 var(--s2); font-weight: 600; color: var(--green); min-height: 1.6em; }
.tool-group { display: inline-flex; gap: 4px; padding-right: var(--s2); margin-right: var(--s1); border-right: 1px solid var(--line); }
.tool-group:last-of-type { border-right: 0; }
.ln-path { border-top: 3px solid var(--gold-dark); }
.legend-less { background: var(--white); border: 1.5px solid var(--green); color: var(--green); }
.legend-text { font-size: 0.78rem; font-style: italic; color: var(--ink-soft); min-width: 44px; flex: none; }
.legend-more { width: auto; min-width: 26px; padding: 0 5px; }
.tree-howto { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); font-size: 0.88rem; }
.tree-howto summary { cursor: pointer; font-weight: 600; color: var(--green); }
.tree-howto ul { padding-left: 1.1em; margin: var(--s2) 0 0; }
.tree-howto li { margin-bottom: 6px; }
.panel-dates { font-size: 1.05rem; color: var(--ink); margin-bottom: var(--s3) !important; }
.panel-head { font-weight: 600; margin: var(--s3) 0 0 !important; }
.tree-panel { position: absolute; right: var(--s3); top: 60px; width: 300px; max-width: calc(100% - 24px); background: var(--white); border: 1px solid var(--line-strong); box-shadow: var(--shadow); padding: var(--s5); z-index: 5; }
.tree-panel h2 { font-size: 1.5rem; margin-bottom: 4px; }
.tree-panel p { font-size: 0.95rem; margin-bottom: var(--s2); }
.panel-close { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft); padding: 4px 8px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.tree-text { margin-top: var(--s4); background: var(--white); border: 1px solid var(--line); padding: var(--s3) var(--s5); }
.tree-text summary { cursor: pointer; font-weight: 600; color: var(--green); padding: var(--s2) 0; }
.text-tree, .text-tree ul { list-style: none; padding-left: var(--s5); border-left: 1px solid var(--line); margin: 0; }
.text-tree { padding-left: 0; border: 0; }
.text-tree li { padding: 3px 0; }
.family-view { background: var(--white); border: 1px solid var(--line); padding: var(--s5); }
.family-row { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.family-focus { background: var(--beige-soft); margin: 0 calc(var(--s5) * -1); padding: var(--s4) var(--s5); }
.family-label { font-family: var(--font-text); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: var(--s3); }

/* ---------- Kaart ---------- */
.map-canvas { height: 600px; border: 1px solid var(--line); background: var(--beige); }
.map-legend ul { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.map-legend li { display: flex; gap: var(--s2); align-items: center; margin-bottom: 6px; }
.map-legend .mk { width: 16px; height: 16px; flex: none; }
.mk { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--green); }
.mk-family { background: var(--green); }
.mk-context { background: var(--gold); box-shadow: 0 0 0 1px var(--gold-dark); }
.mk-historic { border-radius: 2px; transform: rotate(45deg); }
.mk-approx { opacity: 0.75; border-style: dashed; }
.map-legend .mk-historic { background: var(--white); box-shadow: 0 0 0 2px var(--green); }
.map-legend .mk-approx { background: var(--beige); box-shadow: 0 0 0 1px var(--ink-soft); }
.map-popup-title { font-family: var(--font-title); font-size: 1.3rem; font-weight: 600; color: var(--green); margin: 0 0 4px; }
.map-popup ul { padding-left: 1em; margin: 6px 0; font-size: 0.9rem; }
.leaflet-container { font-family: var(--font-text); }
.place-index { columns: 3 220px; list-style: none; padding: 0; }
.place-index li { break-inside: avoid; padding: 3px 0; }

/* ---------- Tijdlijn ---------- */
.timeline { list-style: none; padding: 0; margin: 0 0 var(--s7); position: relative; }
.timeline::before { content: ''; position: absolute; left: 150px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline-period h2 { margin: var(--s6) 0 var(--s4); padding-left: 176px; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: var(--s5); margin-bottom: var(--s4); position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 145px; top: 20px; width: 11px; height: 11px; background: var(--green); transform: rotate(45deg); }
.timeline-item.is-context::before { background: var(--white); border: 2px solid var(--gold); }
.timeline-date { text-align: right; padding: 14px var(--s4) 0 0; font-family: var(--font-title); font-size: 1.15rem; font-weight: 600; color: var(--green); line-height: 1.25; }
.timeline-card { background: var(--white); border: 1px solid var(--line); padding: var(--s4) var(--s5); }
.is-context .timeline-card { background: var(--beige-soft); }
.timeline-card h3 { font-size: 1.3rem; margin-bottom: var(--s2); }
.timeline-card p { margin-bottom: var(--s2); font-size: 0.97rem; }
.timeline-kind { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-dark); font-weight: 600; }
.timeline-meta { font-size: 0.88rem; }
.timeline-persons { font-size: 0.92rem; font-weight: 600; }

/* ---------- Geschiedenis / over ---------- */
.history-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s7); align-items: start; margin-bottom: var(--s7); }
.toc { position: sticky; top: var(--s4); border-left: 2px solid var(--gold); padding-left: var(--s4); }
.toc ol { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.toc li { margin-bottom: var(--s2); }
.toc a { text-decoration: none; font-weight: 600; }
.period { padding-bottom: var(--s6); margin-bottom: var(--s6); border-bottom: 1px solid var(--line); scroll-margin-top: var(--s4); }
.period:last-child { border-bottom: 0; }
.period-events { background: var(--white); border: 1px solid var(--line); padding: var(--s4) var(--s5); margin-top: var(--s5); }
.period-events h3 { font-family: var(--font-text); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark); }

/* ---------- Bronnen ---------- */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s3); margin-bottom: var(--s6); }
.stat-cell { background: var(--white); border: 1px solid var(--line); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
a.stat-cell { text-decoration: none; color: var(--ink); }
a.stat-cell:hover { box-shadow: var(--shadow); color: var(--ink); }
.stat-num { font-family: var(--font-title); font-size: 2.2rem; line-height: 1; color: var(--green); font-weight: 600; }
.sources-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s5); align-items: start; }
.cite-list li { display: block; }

/* ---------- Archiefstuk ---------- */
.media-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s5); align-items: start; margin-bottom: var(--s7); }
.media-figure { margin: 0; background: var(--white); border: 1px solid var(--line); padding: var(--s5); }
.media-placeholder { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); color: var(--gold-dark); padding: var(--s6) var(--s4); background: var(--beige-soft); border: 1px dashed var(--gold); }
.media-placeholder p { color: var(--ink); font-size: 0.95rem; max-width: 30em; }

/* ---------- Voet ---------- */
.site-footer { background: var(--green); color: var(--beige); margin-top: var(--s8); padding: var(--s7) 0 var(--s5); font-size: 0.95rem; }
.site-footer a { color: var(--beige); }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s6); }
.footer-title { font-family: var(--font-title); font-size: 1.6rem; color: var(--white); margin-bottom: var(--s2); }
.footer-head { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-base { border-top: 1px solid rgba(180, 154, 101, 0.3); margin-top: var(--s5); padding-top: var(--s4); font-size: 0.85rem; color: rgba(232, 223, 206, 0.85); }

/* ---------- Beheer ---------- */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); align-items: start; margin-bottom: var(--s7); }
.admin-nav { background: var(--white); border: 1px solid var(--line); padding: var(--s4); position: sticky; top: var(--s4); }
.admin-nav ul { list-style: none; padding: 0; margin: 0; }
.admin-nav a { display: flex; justify-content: space-between; padding: 7px 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.admin-nav a[aria-current] { color: var(--green); font-weight: 600; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.admin-form .field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.admin-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s4); }
.danger-zone { border-color: #c9b6ae; }
.sub-table td, .sub-table th { padding: 8px 10px; font-size: 0.9rem; }
.inline-add { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: end; background: var(--beige-soft); padding: var(--s3); border: 1px solid var(--line); margin-top: var(--s3); }
.inline-add .field { margin: 0; flex: 1; min-width: 140px; }
.inline-add .field-narrow { flex: 0 0 120px; }
.flash { margin-top: 0; }

/* ---------- Responsief ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .person-layout, .branch-layout, .sources-layout { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .header-search input { width: 200px; }
}
@media (max-width: 900px) {
  .two-col, .two-col-wide, .media-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .register-layout, .archive-layout, .map-layout, .tree-layout, .history-layout, .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .filter-panel, .tree-controls, .category-nav, .toc, .admin-nav { position: static; }
  .toc { border-left: 0; border-top: 2px solid var(--gold); padding: var(--s3) 0 0; }
  .toc ol { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
  .tree-canvas { height: 520px; }
  .tree-stage { order: -1; }
  .tree-legend, .tree-howto { display: none; }
  .tree-controls .field { margin-bottom: var(--s3); }
  .timeline::before { left: 8px; }
  .timeline-item { grid-template-columns: 1fr; gap: var(--s2); padding-left: var(--s6); }
  .timeline-item::before { left: 3px; top: 6px; }
  .timeline-date { text-align: left; padding: 0; }
  .timeline-period h2 { padding-left: var(--s6); }
}
@media (max-width: 760px) {
  body { font-size: 1rem; }
  .container { padding: 0 var(--s4); }
  .topbar-nav { display: none; }
  .topbar-inner { justify-content: center; }
  .masthead { flex-wrap: wrap; gap: var(--s3); }
  .wordmark-title { font-size: 1.45rem; }
  .wordmark-mark svg { width: 32px; height: 32px; }
  .header-search { order: 3; width: 100%; }
  .header-search input { width: 100%; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); background: var(--white); cursor: pointer; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 20px; height: 2px; background: var(--green); position: relative; content: ''; }
  .nav-toggle-bars::before { position: absolute; top: -6px; }
  .nav-toggle-bars::after { position: absolute; top: 6px; }
  .main-nav { display: none; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li a, .main-nav li:first-child a { padding: 12px 0; border-bottom: 1px solid var(--line); border-left: 0; }
  .main-nav a[aria-current] { border-bottom-color: var(--line); color: var(--green); box-shadow: inset 4px 0 0 var(--gold); padding-left: 12px; }
  .mobile-only { display: block; }
  .main-nav .mobile-logout { display: block; width: 100%; padding: 12px 0; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
  .hero { padding: var(--s7) 0; }
  .hero-facts dd { font-size: 2rem; }
  .section { padding: var(--s7) 0; }
  .page-head { padding: var(--s5) 0; margin-bottom: var(--s5); }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .field-row, .admin-form .field-row-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .person-actions { justify-content: flex-start; }
  .tree-canvas { height: 460px; }
  .tool-hint { display: none; }
  .tree-panel { position: static; width: auto; max-width: none; margin-top: var(--s3); }
  .map-canvas { height: 440px; }
  .data-table th, .data-table td { padding: 10px; }
  .panel { padding: var(--s4); }
  .register-table thead th:nth-child(4), .register-table td:nth-child(4), .register-table thead th:nth-child(5), .register-table td:nth-child(5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header, .site-footer, .tree-controls, .filter-panel, .person-actions, .tree-toolbar { display: none; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}

/* Bekende Stapels */
.famous-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s4); }
.famous-list li { display: flex; flex-direction: column; gap: var(--s2); }
.famous-list p { margin: 0; }
