/* Hudson Family Tree
   Clean, readable, responsive. Serif for reading, sans for interface.
   ------------------------------------------------------------------ */

:root {
  --bg: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --ink: #1d2024;
  --ink-2: #3a3f46;
  --muted: #535a63;
  --line: #e6e1d7;
  --line-strong: #d3ccbf;
  --accent: #1d4a73;
  --accent-ink: #163a5b;
  --accent-soft: #e9eff5;
  --gold: #9a6b1f;
  --shadow: 0 1px 2px rgba(30, 30, 20, .05), 0 4px 16px rgba(30, 30, 20, .06);
  --radius: 12px;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 42rem;   /* comfortable line length for reading */
  --wide: 64rem;      /* photos, tables and trees */
  --gutter: 1rem;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c;
    --surface: #1b2026;
    --surface-2: #20262d;
    --ink: #e9e6df;
    --ink-2: #cfcbc3;
    --muted: #b5bcc5;
    --line: #2c333b;
    --line-strong: #3a434d;
    --accent: #8dbbe8;
    --accent-ink: #b4d3f2;
    --accent-soft: #1f2d3b;
    --gold: #d9ae62;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;            /* 18px on phones */
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 900px) { body { font-size: 1.1875rem; } }  /* 19px on laptops */

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; top: .5rem; z-index: 100; background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 8px; font-family: var(--sans); }
.skip:focus { left: .5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
/* The top bar is sized in px so it looks the same whichever text size is chosen (it never wraps);
   the list in the phone/tablet menu is sized in rem, so it grows with the text. */
.bar {
  max-width: 1216px; margin: 0 auto; padding: 0 var(--gutter);
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -.005em; margin-right: auto; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }

.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 7px 11px; border-radius: 8px; line-height: 1.2;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.site-nav .nav-search { display: none; }

.bar-actions { display: flex; align-items: center; gap: 4px; order: 3; }
.icon-btn, .menu-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font: 500 15px var(--sans); cursor: pointer; text-decoration: none;
}
.icon-btn:hover, .menu-btn:hover { background: var(--surface-2); color: var(--ink); }
.menu-btn { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s ease; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.nav-open .menu-icon { background: transparent; }
.nav-open .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.nav-open .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 1041px) {
  .site-nav { order: 2; }
  .bar-actions { order: 3; }
}
@media (max-width: 1040px) {
  .js .menu-btn { display: inline-flex; }
  .js .site-nav {
    display: none; order: 4; width: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .25rem 0 .75rem; border-top: 1px solid var(--line);
  }
  .js .nav-open .site-nav { display: flex; }
  .site-nav a { font-size: 1.05rem; padding: .85rem .5rem; border-radius: 8px; }
  .js .site-nav .nav-search { display: block; }
  .brand { font-size: 17.5px; }
}


/* ---------- Page layout ---------- */
main { padding: 0 var(--gutter) 4rem; }
.page { max-width: var(--wide); margin: 0 auto; }

/* Contents / related pages: a collapsible panel above the text on phones and tablets,
   a sticky sidebar on laptops */
.page-aside { font-family: var(--sans); max-width: var(--measure); margin: 0 auto 1.75rem; }
.page-tools { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-tools > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; min-height: 48px;
  padding: .7rem 1rem; font-weight: 600; font-size: .95rem; color: var(--ink);
}
.page-tools > summary::-webkit-details-marker { display: none; }
.page-tools > summary::before {
  content: ""; width: 18px; height: 12px; flex: none; opacity: .75;
  background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 5px / 70% 2px no-repeat, linear-gradient(currentColor 0 0) 0 10px / 85% 2px no-repeat;
}
.page-tools > summary::after {
  content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease;
}
.page-tools[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.page-tools-body { padding: 0 1rem 1rem; display: grid; gap: 1.25rem; }
.aside-title { font-size: .95rem; font-weight: 700; color: var(--ink); margin: 0 0 .4rem; }
.aside-panel ol, .aside-panel ul { list-style: none; margin: 0; padding: 0; }
.aside-panel li { margin: 0; }
.aside-panel a, .aside-panel .current {
  display: block; padding: .6rem .6rem; border-radius: 8px; font-size: .93rem; line-height: 1.35;
  color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere;
}
.aside-panel a:hover { background: var(--surface-2); color: var(--ink); }
.aside-panel .current { color: var(--muted); }
.aside-panel a[aria-current="page"], .toc a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.aside-panel.family ul { max-height: 22rem; overflow-y: auto; }

@media (min-width: 1180px) {
  .page.has-aside { max-width: 74rem; }
  .page.has-aside .page-head { max-width: 50rem; margin-left: 0; }
  .page.has-aside .page-body { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 4rem; align-items: start; }
  .page.has-aside .prose { grid-column: 1; grid-row: 1; min-width: 0; }
  .page.has-aside .prose > * { margin-left: 0; }
  .page.has-aside .prose > .media, .page.has-aside .prose > .blocks, .page.has-aside .prose > .gallery,
  .page.has-aside .prose > .table-wrap, .page.has-aside .prose > .tree, .page.has-aside .prose > section { max-width: 100%; }
  .page-aside {
    grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 1.5rem); margin: 0;
    max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto; overscroll-behavior: contain;
  }
  .page-tools { background: transparent; border: 0; box-shadow: none; }
  .js .page-tools[open] > summary { display: none; }
  .page-tools-body { padding: 0; gap: 1.75rem; }
  .toc li a { border-left: 2px solid var(--line); border-radius: 0 8px 8px 0; padding-left: .8rem; }
  .toc li a.active { border-left-color: var(--accent); }
}

.prose > *, .page-head, .intro { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.prose > .media, .prose > .blocks, .prose > .gallery, .prose > .table-wrap, .prose > .tree, .prose > section { max-width: var(--wide); }
.prose .card, .prose > .chips { max-width: var(--measure); }

.page-head { padding: 2.25rem 0 1rem; }
.crumbs { font-family: var(--sans); font-size: .95rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; }
.crumbs a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; display: inline-block; padding: .5rem 0; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { color: var(--line-strong); }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.2; letter-spacing: -.01em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); margin: 2.6em auto .6em; }
h3 { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.35rem); margin: 2em auto .5em; }
h4 { font-size: 1.1rem; margin: 1.8em auto .4em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: .75em; }

.byline { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin: .25rem 0 0; }
.prose > .byline { margin-top: 1rem; }

p { margin: 0 0 1.05em; }
.prose p, .prose li { text-wrap: pretty; hyphens: manual; overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }
.center { text-align: center; }
ul, ol { padding-left: 1.4em; }
li { margin: .3em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem auto; }
blockquote { margin: 1.5em auto; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--serif); font-size: 1em; margin: 0 auto 1.05em; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

.intro { padding: 0 0 .5rem; }
.kicker { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.15rem; margin: 0 0 .5rem; }
.lead { font-size: 1.2em; line-height: 1.6; color: var(--ink-2); }

/* ---------- Blocks: text + photo, cards, galleries ---------- */
.blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin: 2rem auto; }
.media, .card, .gallery {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 2rem auto; padding: 1.25rem;
}
.blocks > .media, .blocks > .card, .blocks > .gallery { margin: 0; }
.media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 1.75rem; align-items: start; }
.media > * { min-width: 0; }
@media (min-width: 760px) {
  .media { grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); padding: 1.75rem; }
  .media-body { grid-column: 1; grid-row: 1 / span 4; }
  .media-fig { grid-column: 2; }
}
.media-body > :last-child, .card > :last-child { margin-bottom: 0; }
.media-body > :first-child, .card > :first-child { margin-top: 0; }
.media-fig, .gallery figure { margin: 0; }
.media-fig img, .gallery img { width: 100%; border-radius: 8px; background: var(--surface-2); }
.media-fig .caption, .media-fig p { margin-top: .6rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.block-title { font-size: 1.2rem; margin: 0 0 .6rem; }
.card { max-width: var(--measure); }

a.zoom { display: block; cursor: zoom-in; border-radius: 8px; }
a.zoom img { transition: opacity .15s ease; }
a.zoom:hover img { opacity: .92; }

.caption, figcaption {
  font-family: var(--sans); font-size: .94rem; line-height: 1.5; color: var(--ink-2); font-style: normal;
}
.caption i, .caption em { font-style: normal; }

/* ---------- Family section index ---------- */
.section-index { margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--sans); }
.section-index h2 { margin-top: 0; }
.section-index h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--ink-2); margin: 1.75rem 0 .6rem; }
.index-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .5rem; }
.index-list li { margin: 0; }
.index-list a {
  display: flex; align-items: center; min-height: 48px; height: 100%; padding: .65rem .9rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .95rem; line-height: 1.3;
}
.index-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Link bars (chips) ---------- */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.25rem auto; font-family: var(--sans); }
.chips-label { font-size: .95rem; font-weight: 700; color: var(--ink-2); margin-right: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--accent-soft); color: var(--ink-2); border-radius: 999px; font-size: .9rem; line-height: 1.2; padding: 0; }
.chip a { display: inline-block; padding: .5rem .9rem; color: var(--accent); text-decoration: none; font-weight: 500; border-radius: 999px; }
.chip a:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); }
.chip > :not(a) { padding-right: .8rem; color: var(--muted); }
.chip-current { padding: .5rem .9rem; background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); font-weight: 500; }
.chip b, .chip strong, .chip i, .chip em { font-weight: inherit; font-style: normal; }

/* ---------- Data tables ---------- */
.table-wrap {
  margin: 1.75rem auto; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); position: relative;
}
.table-wrap.scrolls {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.14), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) right / 12px 100% no-repeat scroll,
    var(--surface);
}
table.data { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .9rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
table.data td, table.data th { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
table.data th { background: var(--surface-2); font-weight: 600; color: var(--ink); white-space: nowrap; position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.data p { margin: 0 0 .4em; }
table.data p:last-child { margin: 0; }
table.data td + td, table.data th + th { border-left: 1px solid var(--line); }
table.data img { max-width: 260px; }
table.data table { border-collapse: collapse; }
table.data table td { padding: .3rem .5rem; }

/* ---------- Descendant trees ---------- */
.tree {
  margin: 1.75rem auto; padding: .75rem 0; font-family: var(--sans); font-size: .95rem; line-height: 1.45;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.person {
  --step: 1.4rem;
  display: flex; gap: .7rem; align-items: baseline;
  padding: .45rem 1rem .45rem calc(1rem + var(--d) * var(--step));
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px var(--step));
  background-size: calc(var(--d) * var(--step)) 100%;
  background-position: calc(1rem + .45rem) 0;
  background-repeat: no-repeat;
}
.person:hover { background-color: var(--surface-2); }
.person:target { background-color: var(--accent-soft); }
.gen {
  flex: none; font-size: .8rem; font-weight: 700; letter-spacing: .01em; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: .15rem .4rem; min-width: 3.1rem; text-align: center;
  font-variant-numeric: tabular-nums;
}
.who strong { font-weight: 600; color: var(--ink); }
.life { color: var(--muted); font-variant-numeric: tabular-nums; }
.spouse { color: var(--ink-2); }
.spouse::before { content: "\2022"; color: var(--line-strong); margin: 0 .45rem 0 .15rem; }
@media (max-width: 600px) {
  .person { --step: .8rem; padding-right: .75rem; flex-wrap: wrap; row-gap: .15rem; }
  .gen { min-width: 0; }
  .who { flex: 1 1 12rem; }
  .spouse { display: block; }
  .spouse::before { content: "m. "; content: none; }
}

/* ---------- Home ---------- */
.hero { max-width: var(--measure); margin: 0 auto; padding: 3.5rem 0 1.5rem; text-align: left; }
.hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 3.6rem); margin-bottom: .75rem; }
.hero .lead { margin-bottom: 1.75rem; max-width: 40rem; }
.hero-search { max-width: 40rem; }
.hero-search { display: flex; gap: .5rem; font-family: var(--sans); }
.hero-search input {
  flex: 1; min-width: 0; font: 1rem var(--sans); padding: .85rem 1rem; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
}
.hero-search input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.hero-search button, .button {
  font: 600 1rem var(--sans); padding: .85rem 1.25rem; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .hero-search button, .button { color: #0f1a24; } }
.hero-search button:hover { filter: brightness(1.08); }

.families { max-width: var(--wide); margin: 2rem auto 0; }
.families > h2 { max-width: none; margin: 1rem 0 1rem; font-size: 1.5rem; }
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1.25rem; }
.family-card {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.family-card:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--ink); }
.family-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface-2); }
.family-card-body { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.15rem 1.15rem; flex: 1; }
.family-card-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.family-card-sub { font-family: var(--sans); font-size: .92rem; font-weight: 600; color: var(--gold); }
.family-card-text { font-size: 1rem; line-height: 1.55; color: var(--ink-2); margin-top: .35rem; flex: 1; }
.family-card-more { font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--accent); margin-top: .6rem; }
.popular { margin-top: 1.75rem; }
.about { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.about > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.about > .media, .about > .blocks, .about > .table-wrap, .about > .gallery, .about > .chips, .about > .tree { max-width: var(--wide); }

/* ---------- Family tree page ---------- */
.hero-more { margin: 1.25rem 0 0; font-family: var(--sans); }
.button-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; padding: .75rem 1.1rem; min-height: 48px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.button-link:hover { border-color: var(--accent); text-decoration: none; }

.prose > .ft-app { max-width: var(--wide); }
/* tree and search pages: heading lines up with the full-width tool below it */
.sec-tree .page-head, .sec-search .page-head, .sec-tree .prose > *, .sec-search .prose > * { max-width: var(--wide); }
.sec-tree .page-head h1, .sec-tree .prose > .lead { max-width: 40rem; }
.ft-app { font-family: var(--sans); }
.ft-app .card { max-width: none; margin: 0; }
.ft-controls { display: grid; gap: .9rem 1rem; margin: 1.5rem 0 1.25rem; padding: 1rem; }
@media (min-width: 900px) { .ft-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: end; padding: 1.25rem; } }
.ft-row-2 { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.ft-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.ft-field[hidden] { display: none; }
.ft-field label, .ft-label { font-size: .95rem; font-weight: 700; color: var(--ink); }
.ft-field input, .ft-field select {
  width: 100%; min-width: 0; font: 1rem var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: .7rem .8rem; min-height: 48px;
}
.ft-field select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23646b74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px; }
.ft-field input:focus, .ft-field select:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.ft-seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.ft-seg button { font: 500 .95rem var(--sans); min-height: 42px; padding: 0 1rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.ft-seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ft-combo { position: relative; }
.ft-matches {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
  max-height: min(60vh, 26rem); overflow-y: auto;
}
.ft-matches li { padding: .6rem .65rem; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: .1rem; margin: 0; }
.ft-matches li:hover, .ft-matches li.active { background: var(--accent-soft); }
.ft-matches .ft-none { cursor: default; color: var(--muted); }
.ft-m-name { font-weight: 600; color: var(--ink); }
.ft-m-sp { font-weight: 400; color: var(--ink-2); }
.ft-m-ctx { font-size: .9rem; color: var(--muted); }

.ft-trail { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin: 0 0 .75rem; }
.ft-trail[hidden] { display: none; }
.ft-trail-label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.ft-crumbs { display: flex; flex-wrap: wrap; gap: .35rem; }
.ft-crumb, .ft-trail-more {
  font: 500 .88rem/1.35 var(--sans); color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 16px;
  padding: .5rem .8rem; min-height: 38px; display: inline-block; text-align: left; text-decoration: none; cursor: pointer;
}
.ft-crumb span { color: var(--ink-2); font-weight: 400; }
.ft-crumb:hover, .ft-trail-more:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.ft-crumb + .ft-crumb::before, .ft-trail-more + .ft-crumb::before { content: none; }
.ft-trail:not(.expanded) .ft-trail-mid { display: none; }
.ft-trail.expanded .ft-trail-more { display: none; }

.ft-focus { margin: 0 0 1.25rem !important; padding: 1.1rem 1.25rem; }
.ft-kicker { font-size: .95rem; font-weight: 600; color: var(--gold); margin: 0 0 .35rem; }
.ft-title { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); margin: 0 0 .35rem; }
.ft-title .ft-yrs { font-family: var(--sans); font-size: 1rem; font-weight: 500; }
.ft-spouse { margin: 0 0 .35rem; color: var(--ink-2); font-size: 1rem; }
.ft-spouse strong { font-weight: 600; color: var(--ink); }
.ft-stats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 .75rem; }
.ft-stats span { font-size: .85rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: .3rem .7rem; }
.ft-src { margin: 0; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.ft-yrs { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* family view */
.ft-group { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--ink-2); margin: 1.5rem 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.ft-group span { background: var(--surface-2); border-radius: 999px; padding: .1rem .5rem; letter-spacing: 0; }
.ft-family > .ft-group:first-child { margin-top: .25rem; }
.ft-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .75rem; align-items: start; }
.ft-card {
  position: relative; display: flex; flex-direction: column; gap: .15rem; min-height: 64px;
  padding: .85rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow); line-height: 1.35;
}
a.ft-card:hover { border-color: var(--accent); color: var(--ink); }
a.ft-card:hover .ft-card-go { color: var(--accent); transform: translateX(2px); }
.ft-card.ft-leaf { box-shadow: none; background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.ft-card.ft-hl { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.ft-card-name { font-weight: 600; font-size: 1rem; }
.ft-card-yrs { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ft-card-sp { font-size: .9rem; color: var(--ink-2); margin-top: .15rem; }
.ft-card-sp strong { font-weight: 500; color: var(--ink); }
.ft-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--accent); }
.ft-card-go { display: inline-flex; color: var(--muted); transition: transform .15s ease; }

/* outline view */
.ft-tools { display: flex; gap: .5rem; margin: 0 0 .75rem; }
.ft-tools[hidden] { display: none; }
.ft-btn { font: 500 .9rem var(--sans); padding: .5rem .9rem; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.ft-btn:hover { border-color: var(--accent); color: var(--accent); }
ul.ft, ul.ft ul { list-style: none; margin: 0; padding: 0; }
ul.ft { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; }
ul.ft[hidden], ul.ft:empty { display: none; }
ul.ft ul { margin-left: 1.05rem; padding-left: .75rem; border-left: 1px solid var(--line-strong); }
ul.ft li { margin: 0; }
.ft-node.collapsed > ul { display: none; }
.ft-row { display: flex; align-items: flex-start; gap: .5rem; padding: .45rem .5rem; border-radius: 8px; }
.ft-row:hover { background: var(--surface-2); }
.ft-row.ft-hl { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ft-tog, .ft-tog-spacer { flex: none; width: 40px; height: 40px; margin-top: -8px; }
.ft-tog { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.ft-tog:hover { background: var(--line); color: var(--ink); }
.ft-tog svg { transition: transform .15s ease; transform: rotate(90deg); }
.ft-node.collapsed > .ft-row .ft-tog svg { transform: rotate(0deg); }
.ft-who { flex: 1; min-width: 0; line-height: 1.4; font-size: .95rem; }
.ft-nm { font-weight: 600; color: var(--ink); }
a.ft-nm { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: .2em; }
.ft-sp { color: var(--ink-2); font-size: .9rem; margin-top: .1rem; }
.ft-sp strong { font-weight: 500; color: var(--ink); }
.ft-gap { display: inline-block; font-size: .85rem; font-style: italic; color: var(--gold); margin-bottom: .1rem; }
.ft-cnt { flex: none; font-size: .82rem; font-weight: 600; border-radius: 6px; padding: .15rem .4rem; margin-top: .15rem; color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ft-grp { font-size: .92rem; font-weight: 600; color: var(--ink-2); padding: .6rem .5rem .2rem 3.1rem; }
.ft-note { margin-top: 1.25rem; }
@media (max-width: 600px) {
  .ft-controls { padding: .9rem; }
  .ft-view { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .ft-row-2 { width: 100%; }
  .sec-tree .prose > .lead { font-size: 1.05rem; }
  .ft-focus { padding: 1rem; }
  ul.ft { padding: .25rem; border-radius: 10px; }
  ul.ft ul { margin-left: .8rem; padding-left: .45rem; }
  .ft-row { gap: .35rem; padding: .45rem .3rem; }
  .ft-cards { gap: .6rem; }
}

/* ---------- Search page (Pagefind UI) ---------- */
.search-ui {
  --pagefind-ui-scale: 1;
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--surface);
  --pagefind-ui-border: var(--line-strong);
  --pagefind-ui-tag: var(--accent-soft);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 10px;
  --pagefind-ui-font: var(--sans);
  max-width: var(--wide); margin: 0 auto;
}
.prose > .search-ui { max-width: var(--wide); }
.search-ui .pagefind-ui__result-title { font-family: var(--serif); font-size: 1.15rem; }
.search-ui .pagefind-ui__result-excerpt { font-family: var(--serif); line-height: 1.6; }
.search-ui mark { background: color-mix(in srgb, var(--gold) 30%, transparent); color: inherit; border-radius: 2px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); font-family: var(--sans); font-size: .9rem; color: var(--ink-2); }
.footer-inner { max-width: 76rem; margin: 0 auto; padding: 2.5rem var(--gutter) 3rem; display: grid; gap: 1.5rem 3rem; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.footer-brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink); margin-bottom: .4rem; }
.footer-inner p { max-width: 36rem; }
.muted { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-content: start; }
.footer-links a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; padding: .35rem 0; font-size: 1rem; }
@media (max-width: 600px) { .footer-inner { padding-bottom: 5.5rem; } }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; padding: 0 1rem;
  font: 600 .9rem var(--sans); color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); }
.js .to-top:not(.show) { visibility: hidden; }
html:not(.js) .to-top { display: none; }

/* ---------- Photo viewer ---------- */
.viewer { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); max-height: 94vh; overflow: visible; }
.viewer::backdrop { background: rgba(10, 12, 14, .88); }
.viewer figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.viewer img { max-width: min(96vw, 1100px); max-height: 80vh; width: auto; border-radius: 8px; background: #222; }
.viewer figcaption { color: #f1efea; font-family: var(--sans); font-size: 1rem; max-width: 60ch; text-align: center; }
.viewer-close {
  position: fixed; top: .75rem; right: .75rem; min-height: 48px; padding: 0 1.1rem 0 .9rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid rgba(255,255,255,.45); background: rgba(20,22,25,.72); color: #fff; font: 600 1.05rem var(--sans); cursor: pointer;
}
.viewer-close span { font-size: 1.6rem; line-height: 1; margin-top: -2px; }
.viewer-close:hover { background: rgba(255,255,255,.26); }

/* ---------- Descendant list controls (long lists on phones) ---------- */
.tree-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem auto .5rem; font-family: var(--sans); }
.tree-tools a, .tree-tools button { font: 500 .9rem var(--sans); min-height: 44px; padding: .55rem .9rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tree-tools a { color: var(--accent); }
.pt-tog { flex: none; width: 40px; height: 40px; margin: -9px -8px -6px -12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pt-tog svg { transition: transform .15s ease; transform: rotate(90deg); }
.person.pt-closed .pt-tog svg { transform: rotate(0deg); }
.person.pt-hidden { display: none; }
.pt-more { font-size: .8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 .35rem; margin-left: .35rem; white-space: nowrap; }

/* ---------- Phones: tables become cards, photos stay in proportion ---------- */
@media (max-width: 700px) {
  .table-wrap:has(table.stack) { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:first-child:has(th) { display: none; }
  table.stack tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    padding: .45rem .75rem; margin-bottom: .45rem;
  }
  table.stack tr.em-row { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
  table.stack tbody tr:nth-child(even) td, table.stack td { background: transparent !important; border: 0 !important; }
  .table-wrap table.stack td { display: grid; grid-template-columns: minmax(6rem, 36%) minmax(0, 1fr); gap: .6rem; padding: .12rem 0; font-size: .9rem; line-height: 1.4; }
  .table-wrap table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; font-weight: 600; padding-top: .1rem; }
  .table-wrap table.stack td.empty, .table-wrap table.stack td:not([data-label]), table.stack tr.empty-row { display: none; }
  .media-fig img, .gallery img, .card img { max-height: 340px; width: auto; margin: 0 auto; }
  .media-fig a.zoom, .gallery a.zoom { background: var(--surface-2); border-radius: 8px; }
  .family-card { flex-direction: row; }
  .family-card img { width: 108px; aspect-ratio: 1; flex: none; }
  .family-card-body { padding: .8rem .9rem; }
  .family-card-title { font-size: 1.15rem; }
  .family-card-text { font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: .2rem; }
  .family-card-more { display: none; }
  .family-grid { gap: .75rem; }
}

/* ---------- Small screens (phones) ---------- */
@media (max-width: 600px) {
  :root { --gutter: 1.125rem; --header-h: 56px; }
  body { font-size: 1.0625rem; line-height: 1.65; }          /* 17px reading size on phones */
  h1 { font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.1rem); }
  h2 { font-size: 1.4rem; margin-top: 2.2em; }
  h3 { font-size: 1.18rem; }
  .lead { font-size: 1.05rem; line-height: 1.6; }

  /* header always on one line */
  .bar { gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 16.5px; gap: 8px; min-width: 0; white-space: nowrap; }
  .brand span { overflow: hidden; text-overflow: ellipsis; }
  .brand-mark { width: 26px; height: 26px; }
  .bar-actions { gap: 0; margin-right: -6px; }
  .menu-btn { padding: 0 9px; gap: 6px; }

  .page-head { padding-top: 1.25rem; padding-bottom: .75rem; }
  .byline { font-size: .85rem; }
  .media, .card, .gallery { padding: 1rem; border-radius: 12px; }
  .media-fig { order: -1; }
  .table-wrap, .tree { border-radius: 10px; }
  table.data { font-size: .85rem; }
  table.data td, table.data th { padding: .5rem .6rem; }

  /* home */
  .hero { padding: 1.75rem 0 .5rem; }
  .hero .kicker { font-size: 1rem; margin-bottom: .35rem; }
  .hero h1 { font-size: 2.1rem; margin-bottom: .6rem; }
  .hero .lead { font-size: 1rem; color: var(--muted); margin-bottom: 1.25rem; }
  .hero-search { flex-direction: row; gap: .4rem; }
  .hero-search input { padding: .75rem .85rem; font-size: 1rem; min-width: 0; }
  .hero-search button { padding: .75rem 1rem; flex: none; }
  .hero-more { margin-top: .9rem; }
  .button-link { width: 100%; justify-content: center; }
  .families { margin-top: 1.75rem; }
  .families > h2 { font-size: 1.3rem; margin-bottom: .75rem; }
  .family-card img { width: 92px; }
  .family-card-body { padding: .7rem .85rem; gap: .1rem; }
  .family-card-title { font-size: 1.1rem; }
  .family-card-sub { font-size: .85rem; line-height: 1.35; }
  .family-card-text { font-size: .88rem; line-height: 1.45; -webkit-line-clamp: 2 !important; }

  .popular { gap: .4rem; }
  .popular .chip { border-radius: 10px; font-size: .92rem; }
  .popular .chip a { padding: .6rem .85rem; border-radius: 10px; }

  .to-top { padding: 0 .9rem; right: .75rem; bottom: .75rem; }
}
@media (max-width: 360px) {
  .menu-btn { font-size: 0; gap: 0; }       /* very narrow phones: icon-only menu button */
  .menu-btn .menu-icon { margin: 0 2px; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .to-top, .skip, .crumbs, .hero-search, .chips { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .media, .card, .tree, .table-wrap, .family-card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  a { color: #000; }
}

/* ---------- Journeys page ---------- */
.sec-journeys .page-head, .sec-journeys .prose > *, .sec-photos .page-head, .sec-photos .prose > * { max-width: var(--wide); }
.sec-journeys .page-head h1, .sec-journeys .prose > .lead, .sec-photos .prose > .lead { max-width: 44rem; }
.jr-app { font-family: var(--sans); margin-top: 1rem; }
.jr-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.jr-chip {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .4rem .85rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 500 .9rem var(--sans); cursor: pointer;
}
.jr-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.jr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); display: inline-block; flex: none; }
.jr-layout { display: grid; gap: 1.25rem; }
@media (min-width: 1100px) {
  .jr-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 1.75rem; }
  .jr-mapcol { position: sticky; top: calc(var(--header-h) + 1rem); }
  .jr-listcol { max-height: none; }
}
.jr-tabs, .jr-listtabs { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: .6rem; flex-wrap: wrap; }
.jr-tabs button, .jr-listtabs button { font: 500 .9rem var(--sans); min-height: 40px; padding: 0 .9rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.jr-tabs button[aria-selected="true"], .jr-listtabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.jr-listtabs button span { font-size: .85rem; color: var(--muted); margin-left: .25rem; }
.jr-maps { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.jr-svg { display: block; width: 100%; height: auto; }
.jr-sea { fill: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.jr-land { fill: var(--surface); stroke: var(--line-strong); stroke-width: .6; }
.jr-route { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .8; cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.jr-route:hover { stroke-width: 3.6; opacity: 1; }
.jr-route.off { opacity: 0; pointer-events: none; }
.has-selection .jr-route:not(.active) { opacity: .14; }
.jr-route.active { stroke-width: 4; opacity: 1; }
.jr-place { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; cursor: pointer; }
.jr-place.approx { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.4; }
.jr-place.off, .jr-label.off { opacity: 0; pointer-events: none; }
.has-selection .jr-place:not(.active) { opacity: .3; }
.jr-place.active { fill: var(--accent); }
.jr-label { font-family: var(--sans); font-weight: 600; fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.has-selection .jr-label { opacity: .45; }
.jr-info { margin-top: .75rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: .95rem; }
.jr-info p { margin: 0 0 .5rem; }
.jr-info p:last-child { margin-bottom: 0; }
.jr-info-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.jr-meta { display: flex; align-items: center; gap: .45rem; font-size: .92rem; font-weight: 600; color: var(--ink-2); margin: 0 0 .35rem; }
.jr-ship { font-size: .88rem; color: var(--ink-2); font-style: italic; }
.jr-actions { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin: .5rem 0 0; font-size: .9rem; }
.jr-actions a { font-weight: 600; text-decoration: none; }
.jr-show, .jr-clear { font: 600 .88rem var(--sans); min-height: 38px; padding: .35rem .8rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.jr-show:hover, .jr-clear:hover { border-color: var(--accent); color: var(--accent); }
.jr-place-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.jr-pick { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; font: 500 .92rem var(--sans); padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.jr-pick:hover { border-color: var(--accent); }
.jr-yrs { color: var(--muted); font-size: .85rem; margin-left: auto; white-space: nowrap; }
.jr-note { margin-top: .6rem; }
.jr-panel { display: grid; gap: .75rem; }
.jr-card { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; background: var(--surface); padding: .9rem 1rem; box-shadow: var(--shadow); }
.jr-card.active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); }
.jr-card h3 { font-size: 1.12rem; margin: .1rem 0 .35rem; }
.jr-card p { margin: 0 0 .45rem; font-size: .95rem; line-height: 1.5; }
.jr-stops { font-size: .85rem !important; color: var(--muted); }
.jr-decade { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 1rem 0 .15rem; }
.jr-events { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.jr-event { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: .75rem; padding: .75rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); margin: 0; }
.jr-event.active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); }
.jr-year { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.jr-ev-title { font-weight: 600; margin: 0 0 .2rem; color: var(--ink); line-height: 1.35; }
.jr-ev-text { margin: 0; font-size: .92rem; color: var(--ink-2); line-height: 1.45; }
.jr-event .jr-actions { margin-top: .4rem; font-size: .85rem; }
.button-link.subtle { box-shadow: none; color: var(--ink-2); }
.hero-more { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 600px) {
  .hero-more { flex-direction: column; }
  .jr-chip { padding: .4rem .75rem; }
  .jr-tabs { display: flex; width: 100%; }
  .jr-tabs button { flex: 1; padding: 0 .4rem; font-size: .85rem; }
  .jr-maps { margin-left: calc(var(--gutter) * -.5); margin-right: calc(var(--gutter) * -.5); border-radius: 10px; }
}
.jr-svg[data-view="world"] .jr-place { r: 6px; }
@media (min-width: 700px) {
  .jr-svg { max-height: calc(100vh - 15rem); min-height: 320px; }
  .jr-svg[data-view="world"] .jr-label { font-size: 14px; }
  .jr-svg[data-view="world"] .jr-place { r: 4px; }
  .jr-svg[data-view="uk"] .jr-label { font-size: 14px; }
  .jr-svg[data-view="anz"] .jr-label { font-size: 14px; }
}

/* ---------- Send an update ---------- */
.update-note { margin: 3rem auto 0; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); font-family: var(--sans); font-size: .98rem; line-height: 1.5; max-width: var(--measure); }
.update-note p { margin: 0; }
.update-note a { font-weight: 600; }
.cf { font-family: var(--sans); display: grid; gap: 1.25rem; max-width: 40rem; margin: 1.5rem 0 0; }
.cf-kind { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.cf-kind legend, .cf-field label { font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: .5rem; padding: 0; }
.cf-choice { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 1.02rem; font-weight: 500 !important; margin: 0 !important; }
.cf-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cf-choice input { width: 22px; height: 22px; margin: .1rem 0 0; accent-color: var(--accent); flex: none; }
.cf-choice small { display: block; font-size: .9rem; color: var(--muted); font-weight: 400; margin-top: .1rem; }
.cf-field { display: flex; flex-direction: column; }
.cf-opt { font-weight: 400; color: var(--muted); }
.cf-hint { margin: -.2rem 0 .5rem; font-size: .95rem; color: var(--ink-2); }
.cf input[type="text"], .cf input[type="email"], .cf textarea {
  font: 1.05rem/1.5 var(--sans); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: .8rem .9rem; width: 100%;
}
.cf textarea { resize: vertical; min-height: 10rem; }
.cf input:focus, .cf textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.cf-two { display: grid; gap: 1.25rem; }
@media (min-width: 700px) { .cf-two { grid-template-columns: 1fr 1fr; } }
.cf-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-submit { justify-self: start; font: 600 1.1rem var(--sans); min-height: 52px; padding: .8rem 1.6rem; border: 0; border-radius: 12px; background: var(--accent); color: #fff; cursor: pointer; }
@media (prefers-color-scheme: dark) { .cf-submit { color: #0f1a24; } }
.cf-submit:disabled { opacity: .7; cursor: wait; }
.cf-msg { font-family: var(--sans); padding: .9rem 1rem; border-radius: 10px; font-weight: 600; max-width: 40rem; }
.cf-error { background: #fdecea; color: #8a1c12; border: 1px solid #f3b8b0; }
@media (prefers-color-scheme: dark) { .cf-error { background: #3a1714; color: #ffb4a9; border-color: #6b2a22; } }
.cf-done { max-width: 40rem; margin: 1.5rem 0 0 !important; font-family: var(--sans); }
.cf-done h2 { margin-top: 0; }
.cf-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
button.button-link { font: inherit; font-weight: 600; cursor: pointer; }
.sec-contribute .page-head, .sec-contribute .prose > * { max-width: 40rem; }
.ft-print { font: 600 .9rem var(--sans); color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
@media print {
  .ft-controls, .ft-tools, .ft-trail-more, .ft-src, .ft-note, .update-note, .page-aside, .tree-tools, .pt-tog, .jr-filters, .jr-tabs, .jr-listtabs, .jr-info, .jr-actions, .cf, .hero-more { display: none !important; }
  .ft-trail:not(.expanded) .ft-trail-mid { display: inline-block !important; }
  .ft-card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .ft-cards { grid-template-columns: 1fr 1fr; }
  .person.pt-hidden { display: flex !important; }
  .prose .tree[hidden] { display: block !important; }
  .jr-panel[hidden] { display: grid !important; }
  .jr-mapcol { position: static !important; }
  details.page-tools { display: none; }
}

/* ---------- Photo gallery ---------- */
.ph-jump { max-width: var(--wide) !important; }
.sec-photos .prose > h2 { max-width: var(--wide); margin-top: 2.2em; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 1rem; max-width: var(--wide) !important; }
.ph-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ph-item a.zoom { display: flex; align-items: center; justify-content: center; background: var(--surface-2); aspect-ratio: 4 / 3; border-radius: 0; overflow: hidden; min-height: 0; }
.ph-item img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.ph-item figcaption { padding: .7rem .85rem .85rem; display: flex; flex-direction: column; gap: .25rem; font-family: var(--sans); }
.ph-item .caption { font-size: .92rem; color: var(--ink); font-weight: 500; line-height: 1.4; }
.ph-credit { font-size: .88rem; color: var(--muted); line-height: 1.35; }
.ph-page { font-size: .88rem; font-weight: 600; margin-top: .2rem; }
@media (max-width: 600px) { .ph-grid { grid-template-columns: 1fr 1fr; gap: .6rem; } .ph-item figcaption { padding: .55rem .6rem .7rem; } .ph-credit { display: none; } }

/* ---------- People A–Z ---------- */
.sec-people .page-head, .sec-people .prose > * { max-width: var(--wide); }
.sec-people .prose > .lead { max-width: 44rem; }
.az-jump { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 1.5rem; font-family: var(--sans); }
.az-jump a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.az-jump a:hover { border-color: var(--accent); background: var(--accent-soft); }
.az-letter { font-family: var(--sans); padding: .25rem 0 1rem; border-top: 1px solid var(--line); }
.az-letter h2 { font-family: var(--serif); font-size: 1.6rem; margin: .8rem 0 .5rem; }
.az-surnames { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.az-surnames a { display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: .4rem .8rem; border-radius: 999px; background: var(--accent-soft); font-weight: 600; text-decoration: none; }
.az-surnames a span, .az-group h3 span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.az-all { margin-top: 2.5rem; }
.az-group { font-family: var(--sans); border-top: 1px solid var(--line); padding: 1rem 0 .5rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.az-group h3 { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 .6rem; }
.az-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .15rem 1.5rem; }
.az-list li { margin: 0; padding: .45rem 0; border-bottom: 1px dashed var(--line); line-height: 1.35; }
.az-list a { font-size: 1rem; text-decoration: none; }
.az-list a strong { font-weight: 600; }
.az-years { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.az-note { display: block; color: var(--muted); font-size: .85rem; }
.az-top { margin: .5rem 0 0; font-size: .9rem; }

/* ---------- Comfort for older readers ---------- */
/* Text size buttons (A / A / A): the whole site scales, the choice is remembered on this device */
html.ts-large { font-size: 112.5%; }
html.ts-larger { font-size: 125%; }
.ts { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--sans); }
html:not(.js) .ts { display: none; }
.ts-label { font-size: .9rem; color: var(--ink-2); margin-right: .2rem; white-space: nowrap; }
.ts-btn {
  min-width: 44px; min-height: 44px; padding: 0 .35rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: 600 15px/1 var(--sans);
}
.ts-btn.ts-2 { font-size: 19px; }
.ts-btn.ts-3 { font-size: 23px; }
.ts-btn:hover { border-color: var(--accent); color: var(--accent); }
.ts-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .6rem; }
.head-row .ts { margin-left: auto; }
html.ts-large .search-ui { --pagefind-ui-scale: 1.125; }
html.ts-larger .search-ui { --pagefind-ui-scale: 1.25; }
.nav-extra { display: none; }
@media (max-width: 1040px) {
  .js .nav-extra { display: block; border-top: 1px solid var(--line); margin-top: .35rem; padding: .85rem .5rem .1rem; }
}
.footer-side { display: grid; gap: 1.25rem; align-content: start; }
/* Visible "Search" word next to the magnifying glass where there is room */
.search-btn .btn-label { display: none; }
.search-btn, .menu-btn { border: 1px solid var(--line-strong); }
@media (min-width: 601px) and (max-width: 1040px), (min-width: 1200px) {
  .search-btn { padding: 0 14px 0 11px; }
  .search-btn .btn-label { display: inline; }
}
@media (max-width: 600px) {
  .head-row { margin-bottom: .35rem; }
  .ts-label { font-size: .85rem; }
  .page-head .ts-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page-head .ts { gap: .25rem; }
  html.ts-large .hero-search, html.ts-larger .hero-search { flex-direction: column; }
}
.home-row { justify-content: flex-end; margin: -1.5rem 0 1.25rem; }
.hero-help { margin: 1rem 0 0; font-family: var(--sans); font-size: 1rem; }
.hero-help a { font-weight: 600; }
@media (max-width: 600px) { .home-row { margin: -.5rem 0 1rem; } }

/* What's new (home page teaser and whats-new.html) */
.whats-new { max-width: var(--wide); margin: 2.75rem auto 0; font-family: var(--sans); }
.wn-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.wn-head h2 { margin: 0 0 .75rem; }
.wn-date { margin: 0; color: var(--muted); font-size: .95rem; }
.wn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.whats-new .wn-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.wn-item { margin: 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.wn-title { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 .35rem; }
.wn-item p { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.wn-item a { font-weight: 600; white-space: nowrap; }
.wn-all { margin: .9rem 0 0; font-weight: 600; }
.sec-whats-new .prose .wn-list { font-family: var(--sans); }
.wn-foot { margin-top: 2rem; }

/* How to use this site */
.help-example { margin: 1rem auto 1.25rem; }
.sec-help .prose li { margin-bottom: .55em; }
kbd { font: 600 .85em var(--sans); padding: .1em .45em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--ink); white-space: nowrap; }
