/* Isabel's Ancestors — 2026 refresh */
:root {
  --paper: #faf6ef;
  --card: #fffdf9;
  --ink: #2b2622;
  --muted: #6b6259;
  --line: #e4dccf;
  --accent: #2f5a3c;      /* deep green */
  --accent-soft: #e4ece3;
  --green: #8a5a2b;        /* warm brown, small labels */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1a18; --card: #24211e; --ink: #ece6dc; --muted: #a99f93;
    --line: #3a3530; --accent: #9cc8a2; --accent-soft: #24332a; --green: #d2a679;
  }
  img { filter: brightness(.92); }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--sans); line-height: 1.2; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.6rem); margin: .2em 0 .3em; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 0 0 .5rem; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(1.25rem, 3vw, 2.5rem); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem 1rem; z-index: 9; }
.muted { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 68ch; text-wrap: balance; }
.eyebrow { font: 600 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 0; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a::before { content: "← "; }

/* header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .9rem; padding-bottom: .9rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 44px; height: 44px; flex: none; border-radius: 11px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.brand-name { display: block; font: 600 1.3rem/1.1 var(--serif); }
.brand-sub { display: block; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem .3rem; }
nav a { display: block; padding: .35rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .95rem; }
nav a:hover { background: var(--accent-soft); }
nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main { padding-bottom: 4rem; min-height: 60vh; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: .9rem; padding: 1.5rem 0; }
.site-footer p { margin: .2rem 0; }

/* buttons + cards */
.btn { display: inline-block; background: var(--accent); color: var(--card); padding: .6rem 1.1rem; border-radius: 999px; text-decoration: none; font-weight: 600; margin: .2rem .3rem .2rem 0; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cards { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.cards a { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.cards a:hover { border-color: var(--accent); transform: translateY(-2px); }
.cards strong { font: 700 1.05rem/1.25 var(--sans); color: var(--accent); }
.cards span { color: var(--muted); font-size: .95rem; }
.tag { margin-top: auto; padding-top: .4rem; font-style: normal; font-size: .78rem; color: var(--green); font-weight: 600; }
.callout { background: var(--accent-soft); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 2.5rem 0 1rem; }
.callout h2 { margin-top: 0; }

/* home */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: center; padding: 2.5rem 0 1rem; }
.hero-photo { justify-self: center; }
.hero-photo img { border-radius: var(--radius); box-shadow: 0 10px 30px rgba(40,50,40,.18); max-height: 480px; width: auto; max-width: 100%; }
.hero-photo figcaption, figure figcaption { font-size: .88rem; color: var(--muted); margin-top: .45rem; font-style: italic; }
figure { margin: 0; }
.photo-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); gap: 1.2rem; margin: 2rem 0; }
.photo-strip img { aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: var(--radius); width: 100%; }
.photo-strip figcaption { font-style: normal; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 1.2rem; padding-top: 1.5rem; }
  .hero-photo { order: -1; max-width: 320px; }
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
}

/* family tree */
.tree { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem 1.2rem; margin: 1.5rem 0 1rem; overflow-x: auto; }
.tree > figcaption { font: 600 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-style: normal; margin: 0 0 .9rem; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 1.4rem; position: relative; }
.tree > ul.tree-root { padding-left: 0; }
.tree li { position: relative; padding: .22rem 0 .22rem 1rem; }
.tree-root > li { padding-left: 0; }
.tree ul ul > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--line); }
.tree ul ul > li:last-child::before { bottom: auto; height: 1.15rem; }
.tree ul ul > li::after { content: ""; position: absolute; left: 0; top: 1.15rem; width: .8rem; border-top: 1.5px solid var(--line); }
.tnode { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .25rem .6rem; font-size: .95rem; }
.tnode.spouse { background: transparent; border-style: dashed; }
.tp { font-weight: 600; }
a.tp { text-decoration: none; }
a.tp:hover { text-decoration: underline; }
.dates { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.m { color: var(--muted); font-style: italic; font-size: .85rem; margin: 0 .15rem; }
.unknown { color: var(--muted); font-weight: 400; }

/* people */
.people-h { border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.person { display: grid; grid-template-columns: 1fr; gap: 1.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1rem 0; scroll-margin-top: 1rem; }
.person.has-photo { grid-template-columns: 1fr 200px; }
.person:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.person h3 { color: var(--accent); }
.person dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.person dt { font-weight: 600; color: var(--muted); font-size: .9rem; padding-top: .12rem; }
.person dd { margin: 0; }
.person p { margin: .8rem 0 0; }
.person figure + figure { margin-top: 1rem; }
.person figure img { border-radius: 8px; }
@media (max-width: 640px) {
  .person.has-photo { grid-template-columns: 1fr; }
  .person figure { max-width: 240px; }
  .person dl { grid-template-columns: 1fr; gap: 0; }
  .person dd { margin-bottom: .5rem; }
}

/* tables */
.table-scroll { overflow-x: auto; margin: .8rem 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td p { margin: 0; }

/* records */
.record-top { display: grid; gap: 1rem; margin: 1.5rem 0 2rem; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.toc h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.toc ul { margin: 0; padding-left: 1.1rem; columns: 2 260px; column-gap: 2rem; }
.toc li { break-inside: avoid; margin: .15rem 0; }
.others summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.cols { columns: 3 180px; padding-left: 1.1rem; font-size: .93rem; }
.record { border-top: 1px solid var(--line); padding: 1.5rem 0 .5rem; scroll-margin-top: 1rem; }
.record h3 { color: var(--accent); }
.record:target h3 { background: var(--accent-soft); display: inline-block; padding: 0 .3rem; border-radius: 4px; }
.top { font-size: .85rem; }
.top a { color: var(--muted); }

/* name index */
.search { margin: 1.5rem 0 1rem; }
.search label { display: block; font-weight: 600; margin-bottom: .3rem; }
.search input { width: 100%; max-width: 420px; font: inherit; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.search input:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.5rem; }
.chips a { padding: .25rem .65rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: .85rem; color: var(--ink); }
.chips a:hover { border-color: var(--accent); }
.surname h2 { font-size: 1.25rem; margin: 1.6rem 0 .5rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.fam-link { font: 600 .85rem var(--sans); }
.surname ul { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.surname li { display: flex; flex-wrap: wrap; gap: .2rem 1rem; padding: .45rem .9rem; border-bottom: 1px solid var(--line); }
.surname li:last-child { border-bottom: 0; }
.nm { font-weight: 600; min-width: 15rem; }
.yr { color: var(--muted); min-width: 4.5rem; }
.pl { color: var(--muted); }
[hidden] { display: none !important; }

/* misc */
.question { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .2rem 1.3rem 1rem; margin: 1rem 0; }
.link-list li { margin: .4rem 0; }

@media print {
  .site-header nav, .site-footer, .top, .search, .chips, .btn { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .person, .tree, .toc { border-color: #ccc; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  details.others { display: block; }
}
.yr-tag { font: 600 .8rem var(--sans); color: var(--green); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; margin-left: .4rem; vertical-align: middle; white-space: nowrap; }
.ref { font-size: .85rem; color: var(--muted); margin: -.2rem 0 .6rem; }
@media (max-width: 640px) {
  .tree { padding: .8rem .7rem; }
  .tree ul { padding-left: .55rem; }
  .tree li { padding-left: .75rem; }
  .tree ul ul > li::after { width: .6rem; }
  .tnode { font-size: .88rem; padding: .2rem .45rem; }
  .hero-photo img { max-height: 280px; }
  .hero-photo { max-width: 240px; }
  .nm { min-width: 0; }
  .tree-root > li { padding-left: 0; }
}

/* site health dots */
.dot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; margin: 0 .35em; vertical-align: .05em; background: #b9b0a5; box-shadow: 0 0 0 2px var(--card); }
.dot-ok { background: #3c9a5f; }
.dot-warn { background: #e0a526; }
.dot-down { background: #c9413a; }
.health-link { white-space: nowrap; }
.health-link .dot { margin-left: 0; }
.health-list { list-style: none; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.health-list li { padding: .5rem .9rem; border-bottom: 1px solid var(--line); }
.health-list li:last-child { border-bottom: 0; }
.health-list .dot { margin-left: 0; }

/* ---------- wide screens (laptops & monitors) ---------- */
/* keep running text at a comfortable reading width */
main > p, .record > p, .question p, .person p, .link-list, .callout p { max-width: 75ch; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.people { display: grid; grid-template-columns: 1fr; gap: 0 1.2rem; align-items: start; }
.surnames { column-gap: 1.8rem; }
.surnames .surname { break-inside: avoid; margin-bottom: 1.4rem; }
.surnames .surname h2 { margin-top: 0; padding-top: .2rem; }
@media (min-width: 1000px) {
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people .person.has-photo { grid-template-columns: 1fr 160px; }
  .surnames { columns: 2; }
  .record-top { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .tree { max-width: none; }
}
@media (min-width: 1500px) {
  .surnames { columns: 3; }
}

/* family line pages */
.family { margin-top: 2.5rem; scroll-margin-top: 1rem; }
.family .tree { margin-top: .5rem; }
.fam-place { font-size: .95rem; font-weight: 400; color: var(--muted); margin-left: .5rem; letter-spacing: 0; }
.line-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.line-cards strong { font-size: 1.2rem; }
.fam-list { font-size: .82rem !important; letter-spacing: .03em; margin-top: .2rem; }

/* name index: surname titles are the links */
.surname-link { color: inherit; text-decoration: none; }
.surname-link:hover, .surname-link:focus-visible { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }

.checks li { margin: .55rem 0; }
.checks { padding-left: 1.2rem; max-width: 80ch; }

/* search in the main menu */
.nav-search a { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); }
.nav-search a:hover { border-color: var(--accent); }
.nav-icon { flex: none; }

/* family pages: "On this page" list beside the people on wide screens */
.toc { display: none; }
@media (min-width: 1200px) {
  .with-toc { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 2.5rem; align-items: start; }
  .toc { display: block; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; margin-top: 2.5rem; padding: .9rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: .88rem; }
  .toc-h { margin: 0 0 .5rem; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .toc ul { list-style: none; margin: 0; padding: 0; }
  .toc ul ul { margin: .15rem 0 .6rem; padding-left: .7rem; border-left: 2px solid var(--line); }
  .toc a { display: block; padding: .12rem .3rem; border-radius: 4px; color: var(--ink); text-decoration: none; line-height: 1.3; }
  .toc a:hover { background: var(--accent-soft); color: var(--accent); }
  .toc .toc-fam { font-weight: 700; color: var(--accent); letter-spacing: .03em; }
}
@media print { .toc { display: none; } }

/* home page: keep the opening screen compact so it fits on a PC screen */
@media (min-width: 761px) {
  .hero { padding: 1.5rem 0 .5rem; gap: 2rem; }
  .hero-photo img { max-height: 340px; }
  .photo-strip { grid-template-columns: repeat(3, minmax(0, 190px)); margin: 1.2rem 0 1.5rem; }
}
/* phones: show the search as just the magnifier so the menu stays on one line */
@media (max-width: 460px) {
  nav a { padding: .35rem .5rem; }
  .nav-search span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-search a { padding: .45rem .55rem; }
}

/* wide screens: let intro paragraphs use the page width */
.lede { max-width: 110ch; text-wrap: pretty; }
main > p, .record > p, .question p, .callout p { max-width: 100ch; }
@media (min-width: 761px) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; }
}
/* one shared right-hand edge for intro and body paragraphs */
.lede, main > p, .record > p, .question p, .callout p { max-width: 64rem; }
.checks, .link-list { max-width: 64rem; }

/* family tree chart (drawn by scripts/draw_trees.py from the list) */
.tree-chart { display: none; overflow-x: auto; padding-bottom: .3rem; }
.tree-chart svg { display: block; max-width: none; height: auto; font-family: var(--sans); }
.fc-box { fill: var(--paper); stroke: var(--ink); stroke-opacity: .55; stroke-width: 1; }
.fc-line { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.2; }
.fc-name { font-size: 13px; font-weight: 600; fill: var(--ink); }
.fc-link .fc-name { fill: var(--accent); }
.fc-dates { font-size: 12px; fill: var(--muted); }
.fc-eq { font-size: 16px; font-weight: 600; fill: var(--ink); }
.fc-link:hover .fc-box, .fc-link:focus-visible .fc-box { stroke: var(--accent); stroke-opacity: 1; stroke-width: 2; }
.fc-link:hover .fc-name { text-decoration: underline; }
.tree-switch { float: right; margin: -.3rem 0 0; font: 500 .85rem/1 var(--sans); color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .6rem; cursor: pointer; }
.tree-switch:hover { border-color: var(--accent); }
@media (min-width: 761px) {
  .tree.has-chart .tree-chart { display: block; }
  .tree.has-chart .tree-root { display: none; }
  .tree.has-chart.show-list .tree-chart { display: none; }
  .tree.has-chart.show-list .tree-root { display: block; }
}
@media (max-width: 760px) { .tree-switch { display: none; } }
@media print { .tree.has-chart .tree-chart { display: block; } .tree.has-chart .tree-root, .tree-switch { display: none; } }
.tree-hint { margin: .4rem 0 0; font-size: .85rem; color: var(--muted); }
.tree.show-list .tree-hint { display: none; }
@media (max-width: 760px) { .tree-hint { display: none; } }
