/* The Leoke and Koik Families — website styles.
   Follows the Design and Layout Style Guide 1.2: Source Serif 4 for narrative, Aino for supporting
   information; Beaches palette (Kabli) for the Leokes, National Parks (Vilsandi) for the Koiks,
   Boulders neutrals for shared material. White pages, quiet rules, no shadows or rounded cards. */

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2");
  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+2074,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-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-ext-opsz-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2");
  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+2074,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-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-ext-opsz-italic.woff2) format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Aino"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/AinoWeb-Regular.woff2) format("woff2"); }
@font-face { font-family: "Aino"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/AinoWeb-Bold.woff2) format("woff2"); }
@font-face { font-family: "Aino"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/AinoWeb-Italic.woff2) format("woff2"); }
@font-face { font-family: "Aino"; font-weight: 700; font-style: italic; font-display: swap; src: url(fonts/AinoWeb-BoldItalic.woff2) format("woff2"); }

:root {
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Aino", "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  /* Boulders neutrals */
  --ink: #0F172A; --sec: #3D4B5E; --rule: #CBD5E1; --quiet: #F1F5F9; --med: #64748B; --paper: #FFFFFF;
  /* Leokes: Beaches */
  --l-key: #65264B; --l-dark: #361227; --l-acc: #AF4250; --l-tint: #FFD7B7;
  /* Koiks: National Parks */
  --k-key: #1D4432; --k-dark: #12251C; --k-acc: #2E6347; --k-tint: #D9E3C6;
  --key: var(--ink); --dark: var(--ink); --tint: var(--quiet);
  --measure: 36rem;
  --wide: 60rem;
  --gutter: 16px;
}
.lk { --key: var(--l-key); --dark: var(--l-dark); --tint: var(--l-tint); }
.ko { --key: var(--k-key); --dark: var(--k-dark); --tint: var(--k-tint); }
.sh { --key: var(--ink); --dark: var(--ink); --tint: var(--quiet); }

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 1.1875rem; line-height: 1.6;
  font-optical-sizing: auto; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }
strong, b { font-weight: 600; }
em, i { font-style: italic; }
sup { font-size: 0.68em; line-height: 0; vertical-align: 0.45em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; font-family: var(--sans); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header and footer ---------- */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); position: relative; z-index: 20; }
.site-head .in { max-width: 72rem; margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.2; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand .l { color: var(--l-key); } .brand .k { color: var(--k-key); }
.brand small { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.78rem; color: var(--sec); letter-spacing: 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; font-family: var(--sans); font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--sec); padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.navtoggle { display: none; margin-left: auto; font-family: var(--sans); font-size: 0.95rem; background: none; border: 1px solid var(--rule); color: var(--ink); padding: 6px 12px; cursor: pointer; }
@media (max-width: 880px) {
  .navtoggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; gap: 0; padding: 4px var(--gutter) 12px; margin: 0; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; border-bottom: 1px solid var(--quiet); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--quiet); font-weight: 700; color: var(--ink); }
}
.site-foot { border-top: 1px solid var(--rule); margin-top: 72px; font-family: var(--sans); font-size: 0.9rem; color: var(--sec); }
.site-foot .in { max-width: 72rem; margin: 0 auto; padding: 20px var(--gutter) 40px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.site-foot a { color: var(--sec); }

/* ---------- page frames ---------- */
main { display: block; }
.frame { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.page-head { max-width: 72rem; margin: 0 auto; padding: 44px var(--gutter) 8px; }
.kicker { display: block; font-family: var(--sans); font-weight: 700; font-size: 0.9rem; line-height: 1.3; color: var(--key); margin-bottom: 10px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--dark); }
.page-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); margin: 0 0 12px; max-width: 46rem; }
.page-head .dek { font-size: 1.2rem; line-height: 1.5; color: var(--sec); margin: 0 0 18px; max-width: 40rem; }
.page-head .rule { border: 0; border-top: 1px solid var(--key); margin: 18px 0 0; max-width: var(--wide); }
.lede { max-width: var(--measure); }

/* ---------- chapter layout: narrative column + rail ---------- */
.chapter { max-width: 72rem; margin: 0 auto; padding: 24px var(--gutter) 0; display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); column-gap: 56px; }
.chapter .text { grid-column: 1; min-width: 0; }
.chapter .rail { grid-column: 2; font-family: var(--sans); font-size: 0.92rem; line-height: 1.45; color: var(--sec); min-width: 0; }
.rail .sticky { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; padding-bottom: 12px; }
.rail h2 { font-family: var(--sans); font-size: 0.85rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.rail ul { list-style: none; margin: 0 0 26px; padding: 0; }
.rail li { margin: 0 0 5px; }
.rail a { text-decoration: none; }
.rail a:hover { text-decoration: underline; }
.rail .pl a { color: var(--key); font-weight: 700; }
.rail .pl .d { color: var(--sec); font-weight: 400; }
@media (max-width: 1020px) {
  .chapter { grid-template-columns: minmax(0, 1fr); }
  .chapter .text { max-width: var(--measure); }
  .chapter .rail { grid-column: 1; grid-row: 2; margin-top: 40px; border-top: 1px solid var(--rule); padding-top: 18px; max-width: var(--measure); }
  .rail .sticky { position: static; max-height: none; }
}

/* ---------- narrative ---------- */
.text p { margin: 0; hyphens: auto; }
.text p + p { text-indent: 1.4em; }
.text h2 { font-size: 1.55rem; margin: 2.2em 0 0.55em; color: var(--key); }
.text h2:first-child { margin-top: 0.4em; }
.text h3 { font-size: 1.22rem; margin: 1.8em 0 0.45em; color: var(--key); }
.text h2 .fam, .text h3 .fam { display: block; font-family: var(--sans); font-size: 0.82rem; font-weight: 700; color: var(--key); margin-bottom: 3px; }
.text ul, .text ol { margin: 0.6em 0 1em; padding-left: 1.3em; }
.text li { margin-bottom: 0.45em; }
.text li p + p { text-indent: 0; }
.text blockquote { margin: 1.1em 0 1.3em; padding: 0 0 0 1.1em; border-left: 2px solid var(--rule); font-size: 1.08rem; }
.text blockquote p + p { text-indent: 0; margin-top: 0.6em; }
.text blockquote .by { display: block; font-family: var(--sans); font-size: 0.9rem; line-height: 1.4; color: var(--sec); margin-top: 8px; }
.text p.lead-in + * { margin-top: 0.5em; }
.text .note { background: var(--tint); color: var(--dark); padding: 14px 18px; margin: 1.3em 0; font-family: var(--sans); font-size: 0.98rem; line-height: 1.5; }
.text .note p { text-indent: 0; }
.text .note strong { font-weight: 700; }
.text .joining { font-family: var(--sans); font-size: 1rem; line-height: 1.5; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 10px 0; margin: 1.2em 0; }
.text .joining b { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.text .joining .l { color: var(--l-key); } .text .joining .k { color: var(--k-key); }
sup a.footnote-ref, sup a { text-decoration: none; font-family: var(--sans); color: var(--sec); font-weight: 700; padding: 0 1px; }
.text table, .tbl { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-family: var(--sans); font-size: 0.93rem; line-height: 1.4; font-variant-numeric: tabular-nums lining-nums; }
.text th, .tbl th { text-align: left; font-weight: 700; border-bottom: 1px solid var(--ink); padding: 7px 12px 7px 0; vertical-align: bottom; }
.text td, .tbl td { border-bottom: 1px solid var(--rule); padding: 7px 12px 7px 0; vertical-align: top; }
.text td:first-child { white-space: nowrap; }
.tblwrap { overflow-x: auto; margin: 0 0 0.4em; }
.tblwrap table { min-width: 34rem; }

/* wide elements break out across the rail on large screens */
.text .wide-out { margin-right: calc(-1 * (100% * 0)); }
@media (min-width: 1021px) {
  .text .breakout { width: calc(100% + 56px + (72rem - 2 * var(--gutter) - var(--measure) - 56px)); max-width: calc(100vw - 2 * var(--gutter)); }
}

/* ---------- figures ---------- */
figure { margin: 1.6em 0 1.7em; }
figure a.lb { display: block; cursor: zoom-in; }
figure img { display: block; background: var(--quiet); }
figcaption { font-family: var(--sans); font-size: 0.92rem; line-height: 1.45; color: var(--sec); margin-top: 8px; max-width: var(--measure); }
figcaption .lead { color: var(--key); font-weight: 700; }
figcaption .tag { color: var(--key); font-weight: 700; }
figcaption .credit { display: block; margin-top: 3px; font-size: 0.86rem; }
figure.single img { max-height: 34rem; width: auto; }
figure.portrait img { max-height: 30rem; width: auto; }
figure.wide img { width: 100%; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 1.6em 0 1.7em; align-items: start; }
.pair figure { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 26px 22px; margin: 1.6em 0 1.8em; align-items: start; }
.gallery figure { margin: 0; }
.gallery .gimg { height: 13rem; display: flex; align-items: flex-end; }
.gallery .gimg img { max-height: 100%; width: auto; max-width: 100%; }
.gallery figcaption { font-size: 0.88rem; }
@media (max-width: 560px) {
  .pair { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .gimg { height: auto; }
  figure.single img, figure.portrait img { max-height: none; width: 100%; }
}
.mapfig { margin: 2em 0; }
.mapfig img { width: 100%; max-width: 40rem; border: 1px solid var(--rule); background: #fff; }
.mapfig .maplinks { font-family: var(--sans); font-size: 0.95rem; margin-top: 8px; }
.treefig { margin: 1.4em 0 0.6em; overflow-x: auto; }
.treefig svg { display: block; width: 100%; min-width: 40rem; height: auto; }
details.textalt { font-family: var(--sans); font-size: 0.95rem; margin: 0.4em 0 1.4em; }
details.textalt summary { cursor: pointer; color: var(--sec); }
details.textalt ul { font-family: var(--serif); font-size: 1rem; }

/* ---------- notes ---------- */
.notes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--rule); }
.notes h2 { font-size: 1.2rem; color: var(--ink); margin: 0 0 0.6em; }
.footnote { font-size: 0.95rem; line-height: 1.5; }
.footnote hr { display: none; }
.footnote ol { padding-left: 1.6em; margin: 0; }
.footnote li { margin-bottom: 0.7em; }
.footnote li::marker { font-family: var(--sans); color: var(--sec); font-weight: 700; }
.footnote li p { text-indent: 0 !important; }
.footnote a.footnote-backref { font-family: var(--sans); text-decoration: none; color: var(--sec); margin-left: 4px; }
.footnote a { word-break: break-word; }
ul.sources { list-style: none; padding-left: 1.2em; }
ul.sources li { text-indent: -1.2em; font-size: 1rem; }

/* ---------- chapter navigation ---------- */
.chapnav { max-width: 72rem; margin: 56px auto 0; padding: 18px var(--gutter) 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-family: var(--sans); }
.chapnav a { text-decoration: none; display: block; border-top: 1px solid var(--ink); padding-top: 10px; }
.chapnav .dir { display: block; font-size: 0.85rem; color: var(--sec); }
.chapnav .t { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.chapnav .next { text-align: right; }

/* ---------- contents (history index) ---------- */
.toc { max-width: var(--wide); margin: 10px 0 0; }
.toc a.row { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.toc .k { font-family: var(--sans); font-weight: 700; font-size: 0.9rem; color: var(--key); }
.toc .t { font-size: 1.2rem; font-weight: 600; display: block; }
.toc .s { display: block; font-family: var(--sans); font-size: 0.92rem; color: var(--sec); margin-top: 2px; }
@media (max-width: 560px) { .toc a.row { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- home ---------- */
.cover { max-width: 72rem; margin: 0 auto; padding: 48px var(--gutter) 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cover .eyebrow { font-family: var(--sans); font-weight: 700; font-size: 0.92rem; color: var(--sec); }
.cover h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); line-height: 1.08; margin: 12px 0 14px; color: var(--ink); }
.cover h1 .l { color: var(--l-key); } .cover h1 .k { color: var(--k-key); }
.cover .sub { font-size: 1.3rem; line-height: 1.45; color: var(--sec); margin: 0 0 24px; }
.cover .intro { margin: 0 0 22px; max-width: 34rem; }
.keys { font-family: var(--sans); font-weight: 700; font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 0 0 26px; }
.keys .l { color: var(--l-key); } .keys .k { color: var(--k-key); }
.keys span::before { content: ""; display: inline-block; width: 22px; height: 0; border-top: 2px solid currentColor; vertical-align: middle; margin-right: 8px; }
.btn { display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 1rem; text-decoration: none; color: #fff; background: var(--ink); padding: 11px 18px; margin: 0 12px 10px 0; }
.btn:hover { background: var(--sec); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--ink); padding: 10px 17px; }
.btn.ghost:hover { background: var(--quiet); }
.cover figure { margin: 6px 0 0; }
.cover .edition { font-family: var(--sans); font-size: 0.9rem; color: var(--sec); border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 18px; }
@media (max-width: 880px) { .cover { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; } .cover figure { order: -1; } }
.explore { max-width: 72rem; margin: 64px auto 0; padding: 0 var(--gutter); }
.explore h2 { font-size: 1.5rem; margin: 0 0 6px; color: var(--ink); }
.explore .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--ink); }
.explore a.item { display: block; text-decoration: none; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.explore .item .t { font-weight: 600; font-size: 1.2rem; display: block; }
.explore .item .s { font-family: var(--sans); font-size: 0.95rem; color: var(--sec); display: block; margin-top: 3px; line-height: 1.45; }
.explore .item:hover .t { text-decoration: underline; text-decoration-color: var(--rule); }
@media (max-width: 880px) { .explore .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .explore .grid { grid-template-columns: 1fr; } }
.twofam { max-width: 72rem; margin: 56px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.twofam section { border-top: 2px solid var(--key); padding-top: 14px; }
.twofam h2 { font-size: 1.45rem; margin: 0 0 8px; color: var(--dark); }
.twofam p { margin: 0 0 12px; }
.twofam .people-chips { font-family: var(--sans); font-size: 0.95rem; }
.twofam .people-chips a { color: var(--key); font-weight: 700; text-decoration: none; }
.twofam .people-chips a:hover { text-decoration: underline; }
@media (max-width: 760px) { .twofam { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- people ---------- */
.filterbar { font-family: var(--sans); display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 8px 0 24px; }
.filterbar input[type=search] { font: inherit; font-size: 1rem; padding: 9px 12px; border: 1px solid var(--med); min-width: 16rem; max-width: 100%; color: var(--ink); background: #fff; }
.filterbar label { font-size: 0.95rem; color: var(--sec); }
.pgroup { margin: 0 0 36px; }
.pgroup h2 { font-size: 1.3rem; margin: 0 0 4px; color: var(--key); }
.pgroup .gnote { font-family: var(--sans); font-size: 0.92rem; color: var(--sec); margin: 0 0 8px; max-width: 44rem; }
.plist { list-style: none; margin: 0; padding: 0; columns: 2 22rem; column-gap: 40px; border-top: 1px solid var(--key); }
.plist li { break-inside: avoid; border-bottom: 1px solid var(--rule); }
.plist a { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; text-decoration: none; }
.plist .n { font-weight: 600; }
.plist .d { font-family: var(--sans); font-size: 0.9rem; color: var(--sec); margin-left: auto; white-space: nowrap; }
.plist .id { font-family: var(--sans); font-size: 0.78rem; color: var(--med); }
.plist a:hover .n { text-decoration: underline; text-decoration-color: var(--rule); }
.person-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; }
.person-head .portrait { width: 13rem; }
.person-head .portrait img { display: block; width: 100%; }
.person-head .portrait figcaption { font-size: 0.85rem; }
@media (max-width: 640px) { .person-head { grid-template-columns: 1fr; } .person-head .portrait { width: 10rem; } }
.facts { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.97rem; line-height: 1.45; margin: 0 0 1.4em; }
.facts th { width: 9rem; text-align: left; font-weight: 700; color: var(--key); vertical-align: top; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--rule); }
.facts td { padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
@media (max-width: 560px) { .facts th { width: 6.5rem; } }
.fam-links { font-family: var(--sans); font-size: 0.98rem; margin: 0 0 1.4em; }
.fam-links div { padding: 6px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 9rem 1fr; gap: 14px; }
.fam-links .r { font-weight: 700; color: var(--sec); }
.fam-links a { color: var(--ink); font-weight: 700; }
.fam-links .q { color: var(--sec); font-weight: 400; }
@media (max-width: 560px) { .fam-links div { grid-template-columns: 1fr; gap: 0; } }
.timeline td.date { white-space: nowrap; font-weight: 700; color: var(--key); }
.timeline td.src { font-size: 0.86rem; color: var(--sec); max-width: 16rem; }
@media (max-width: 760px) {
  .timeline thead { display: none; }
  .timeline tr { display: block; border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .timeline td { display: block; border: 0; padding: 2px 0; max-width: none !important; }
  .timeline td.date { white-space: normal; }
}
.research-banner { font-family: var(--sans); font-size: 0.93rem; line-height: 1.5; color: var(--sec); background: var(--quiet); padding: 12px 16px; margin: 0 0 1.6em; max-width: var(--measure); }
.person h2.sec { font-size: 1.3rem; margin: 2em 0 0.6em; color: var(--key); padding-bottom: 6px; border-bottom: 1px solid var(--key); }
.person .notes-list { padding-left: 1.2em; }
.person .notes-list li { margin-bottom: 0.6em; }
.qlist { list-style: none; padding: 0; margin: 0; font-family: var(--sans); font-size: 0.97rem; }
.qlist li { padding: 7px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 12px; }
.qlist .qid { font-weight: 700; color: var(--key); }
.qlist .st { color: var(--sec); font-size: 0.88rem; }
.saaga { font-family: var(--sans); font-size: 0.95rem; list-style: none; padding: 0; }
.saaga li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.saaga .ref { color: var(--sec); }
.withheld { font-family: var(--sans); background: var(--quiet); padding: 14px 18px; max-width: var(--measure); }

/* ---------- thumbnails grid (photos, records, person documents) ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 22px 18px; margin: 0.6em 0 1.6em; }
.thumbs figure { margin: 0; }
.thumbs .ti { height: 11rem; display: flex; align-items: center; justify-content: center; background: var(--quiet); overflow: hidden; }
.thumbs .ti img { max-height: 100%; max-width: 100%; width: auto; height: auto; background: none; }
.thumbs figcaption { font-size: 0.85rem; line-height: 1.38; margin-top: 6px; }
.thumbs figcaption .code { font-weight: 700; color: var(--key); }
.thumbs a { text-decoration: none; }
.masonry { columns: 4 15rem; column-gap: 22px; margin: 0.8em 0 2em; }
.masonry figure { break-inside: avoid; margin: 0 0 24px; }
.masonry img { width: 100%; }
.masonry figcaption { font-size: 0.86rem; }
.secnav { font-family: var(--sans); font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 30px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.secnav a { color: var(--sec); text-decoration: none; }
.secnav a:hover { color: var(--ink); text-decoration: underline; }
.collection { margin: 0 0 40px; }
.collection > h2 { font-size: 1.35rem; margin: 0 0 4px; color: var(--key); }
.collection > .cnote { font-family: var(--sans); font-size: 0.93rem; color: var(--sec); margin: 0 0 12px; max-width: 46rem; }
.record-view { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.record-view .img a { display: block; cursor: zoom-in; }
.record-view .img img { width: 100%; background: var(--quiet); }
.record-view .meta { font-family: var(--sans); font-size: 0.98rem; line-height: 1.5; }
.record-view .meta dl { margin: 0; }
.record-view .meta dt { font-weight: 700; color: var(--key); margin-top: 12px; }
.record-view .meta dd { margin: 2px 0 0; }
@media (max-width: 880px) { .record-view { grid-template-columns: 1fr; } }
.zoomhint { font-family: var(--sans); font-size: 0.85rem; color: var(--sec); margin-top: 6px; }

/* ---------- lightbox ---------- */
.lbx { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.95); z-index: 1000; display: none; flex-direction: column; color: #fff; }
.lbx.open { display: flex; }
.lbx .stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 50px 56px 8px; }
.lbx .stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; cursor: zoom-in; }
.lbx .stage.zoom { display: block; padding: 50px 16px 8px; }
.lbx .stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.lbx .cap { font-family: var(--sans); font-size: 0.95rem; line-height: 1.45; padding: 10px 56px 18px; max-width: 64rem; margin: 0 auto; color: #E2E8F0; }
.lbx .cap a { color: #fff; }
.lbx button { position: absolute; background: none; border: 1px solid rgba(255,255,255,0.4); color: #fff; font-family: var(--sans); font-size: 0.95rem; padding: 7px 12px; cursor: pointer; }
.lbx button:hover { background: rgba(255,255,255,0.12); }
.lbx .x { top: 10px; right: 12px; }
.lbx .zm { top: 10px; right: 92px; }
.lbx .pv { left: 8px; top: 50%; } .lbx .nx { right: 8px; top: 50%; }
@media (max-width: 560px) { .lbx .stage { padding: 52px 6px 6px; } .lbx .cap { padding: 8px 12px 14px; } .lbx .pv, .lbx .nx { top: auto; bottom: 8px; } }

/* ---------- family tree explorer ---------- */
.tree-tools { font-family: var(--sans); display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 14px; }
.tree-tools select, .tree-tools input { font: inherit; font-size: 1rem; padding: 8px 10px; border: 1px solid var(--med); background: #fff; color: var(--ink); max-width: 100%; }
.tree-legend { font-family: var(--sans); font-size: 0.88rem; color: var(--sec); display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 12px; }
.tree-legend .sw { display: inline-block; width: 18px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.tree-legend .dash { border-top: 1.5px dashed var(--sec); }
.tree-scroll { overflow: auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: #fff; -webkit-overflow-scrolling: touch; }
.tree-canvas { position: relative; margin: 0 auto; }
.tree-canvas svg.lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.tcard { position: absolute; width: 156px; padding: 7px 9px 8px; background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--key); font-family: var(--sans); font-size: 0.82rem; line-height: 1.3; color: var(--sec); cursor: pointer; text-align: left; }
.tcard:hover { border-color: var(--med); border-top-color: var(--key); }
.tcard .nm { display: block; font-weight: 700; color: var(--key); font-size: 0.88rem; margin-bottom: 2px; }
.tcard.focus { border: 2px solid var(--key); border-top-width: 4px; background: var(--quiet); }
.tcard.more::after { content: "▸"; position: absolute; right: 6px; top: 5px; color: var(--med); }
.tcard .lnk { display: inline-block; margin-top: 4px; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--rule); }
.tcard.restricted { border-top-color: var(--med); }
.genlabel { position: absolute; left: 6px; font-family: var(--sans); font-size: 0.76rem; color: var(--med); }
.tree-side { font-family: var(--sans); font-size: 0.95rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 8px 32px; margin-top: 16px; }
.tree-side h3 { font-family: var(--sans); font-size: 0.9rem; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.tree-side a { color: var(--key); font-weight: 700; cursor: pointer; }
.outline { font-size: 1.02rem; }
.outline ul { list-style: none; margin: 0; padding-left: 1.4em; border-left: 1px solid var(--rule); }
.outline > ul { padding-left: 0; border-left: 0; }
.outline li { margin: 4px 0; }
.outline .who a { font-weight: 600; text-decoration: none; color: var(--key); }
.outline .who a:hover { text-decoration: underline; }
.outline .dt { font-family: var(--sans); font-size: 0.88rem; color: var(--sec); }
.outline .sp { font-family: var(--sans); font-size: 0.92rem; color: var(--sec); }
.outline .sp a { color: var(--ink); }
.outline details > summary { cursor: pointer; list-style: none; }
.outline details > summary::-webkit-details-marker { display: none; }
.outline details > summary::before { content: "+"; display: inline-block; width: 1.1em; font-family: var(--sans); color: var(--med); }
.outline details[open] > summary::before { content: "–"; }
.outline .leaf::before { content: ""; display: inline-block; width: 1.1em; }

/* ---------- map ---------- */
.mapshell { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
#map { height: 72vh; min-height: 30rem; background: var(--quiet); }
.mappanel { font-family: var(--sans); font-size: 0.93rem; line-height: 1.45; border-left: 1px solid var(--rule); padding: 14px 16px; overflow: auto; max-height: 72vh; }
.mappanel h2 { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 4px; }
.mappanel h3 { font-family: var(--sans); font-size: 0.9rem; font-weight: 700; margin: 14px 0 6px; color: var(--ink); }
.mappanel .ev { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.mappanel .ev b { color: var(--key); }
.mappanel .plist2 a { color: var(--key); font-weight: 700; }
.mappanel img { display: block; width: 100%; margin: 8px 0 4px; }
.viewbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; font-family: var(--sans); }
.viewbtns button { font: inherit; font-size: 0.95rem; background: #fff; border: 1px solid var(--med); color: var(--ink); padding: 8px 14px; cursor: pointer; }
.viewbtns button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.maplegend { font-family: var(--sans); font-size: 0.88rem; color: var(--sec); display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 0; align-items: center; }
.maplegend .c, .maplegend .s { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-right: 6px; }
.maplegend .c { border-radius: 50%; background: var(--l-key); } .maplegend .s { background: var(--k-key); }
.maplegend .d { display: inline-block; width: 11px; height: 11px; transform: rotate(45deg); background: var(--ink); margin-right: 6px; vertical-align: -1px; }
.maplegend .ln { display: inline-block; width: 26px; border-top: 2px solid var(--sec); vertical-align: middle; margin-right: 6px; }
.maplegend .ln.dsh { border-top-style: dashed; }
.leaflet-container { font-family: var(--sans); }
.leaflet-tooltip.plabel { background: rgba(255,255,255,0.92); border: 0; box-shadow: none; padding: 0 3px; font-family: var(--sans); font-weight: 700; font-size: 12px; color: var(--ink); }
.leaflet-tooltip.plabel::before { display: none; }
@media (max-width: 880px) { .mapshell { grid-template-columns: 1fr; } .mappanel { border-left: 0; border-top: 1px solid var(--rule); max-height: none; } #map { height: 60vh; } }

/* ---------- misc ---------- */
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 0.9em; }
.prose h2 { font-size: 1.4rem; margin: 1.8em 0 0.5em; color: var(--key); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.small { font-family: var(--sans); font-size: 0.92rem; color: var(--sec); }
.pill { font-family: var(--sans); font-size: 0.8rem; font-weight: 700; color: var(--key); }
@media print {
  .site-head, .site-foot, .rail, .chapnav, .navtoggle { display: none !important; }
  .chapter { display: block; }
}
.tree-tools .zoom { display: inline-flex; gap: 0; margin-left: auto; }
.tree-tools .zoom button { font: inherit; font-size: 0.95rem; min-width: 2.6rem; background: #fff; border: 1px solid var(--med); color: var(--ink); padding: 8px 10px; cursor: pointer; margin-left: -1px; }
.tree-tools .zoom button:hover { background: var(--quiet); }
.tcard .lnk { display: block; }
.chapter.onecol { grid-template-columns: minmax(0, 1fr); }
.chapter.onecol .text { max-width: none; }
.chapter.onecol .text > :not(.treefig):not(.mapfig):not(.notes) { max-width: var(--measure); }
.chapter.onecol .treefig { max-width: 60rem; }
.chapter.onecol .treefig svg { min-width: 44rem; }
.chapter.onecol .rail { grid-column: 1; grid-row: 2; margin-top: 40px; border-top: 1px solid var(--rule); padding-top: 18px; }
.chapter.onecol .rail .sticky { position: static; max-height: none; }
.chapter.onecol .rail ul.pl { columns: 3 15rem; column-gap: 32px; }
.chapter.onecol .rail li { break-inside: avoid; }
.masonry { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 30px 24px; align-items: start; }
.masonry figure { margin: 0; }
.masonry .mi { height: 15rem; display: flex; align-items: flex-end; }
.masonry .mi img { width: auto; max-width: 100%; max-height: 100%; }
.masonry figcaption .ctx { display: block; margin-top: 4px; color: var(--sec); }
@media (max-width: 560px) { .masonry { grid-template-columns: 1fr; } .masonry .mi { height: auto; } .masonry .mi img { width: 100%; max-height: none; } }
.treefig svg { overflow: visible; }
.treefig { padding: 0 8px; }
.gallery .gimg a.lb { height: 100%; display: flex; align-items: flex-end; }
.gallery .gimg a.lb img { max-height: 100%; width: auto; max-width: 100%; }
@media (max-width: 560px) { .gallery .gimg a.lb { height: auto; } .gallery .gimg a.lb img { max-height: none; width: 100%; } }
.tcard { height: 96px; overflow: hidden; }
.tree-page-overview { max-width: 52rem; }
