/* The Jerkovich Chronicles: "Linen and thread".
   Colors are taken from the cross-stitch embroidery (images/background.jpg).
   Fonts: Alegreya and Alegreya Sans, served from this site (SIL Open Font License,
   see assets/fonts/OFL-*.txt). */

@font-face { font-family: "Alegreya"; src: url("/assets/fonts/alegreya-var.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/assets/fonts/alegreya-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/fonts/alegreya-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/fonts/alegreya-sans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/fonts/alegreya-sans-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --linen: #F3F4F1;
  --card: #FFFFFF;
  --ink: #24201E;
  --ink-soft: #3A3431;
  --muted: #5C5652;
  --faint: #B4AFA6;
  --thread: #B5232B;
  --thread-dark: #7E151B;
  --cobalt: #234A93;
  --rule: #D9D7D0;
  --rule-soft: #ECEAE4;
  --edge: #BDB9B0;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--linen); color: var(--ink);
  font-family: var(--serif); font-size: 20px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums;
}
img { max-width: 100%; height: auto; }
a { color: var(--thread); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--thread-dark); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }
.sans { font-family: var(--sans); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 10px 16px;
  background: var(--card); color: var(--ink); font-family: var(--sans); }
.skip:focus { left: 60px; }

/* Frame: the embroidered selvedge down the left edge */
.frame { display: flex; min-height: 100vh; }
.selvedge {
  flex: 0 0 clamp(14px, 3vw, 44px);
  border-right: 3px solid var(--thread);
  background: url("/images/background.jpg") center top / 220px auto repeat-y;
}
.page { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 40px; padding-top: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--rule);
}
.brand { display: block; line-height: 0; flex: 0 1 400px; }
.brand img { width: 400px; max-width: 100%; mix-blend-mode: multiply; }
.header-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 1 1 360px; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 26px; font-size: 18px; line-height: 1.2; }
.site-nav a { color: var(--ink); text-decoration: none; display: inline-block; padding: 10px 0; }
.site-nav a:hover { color: var(--thread); }
.site-nav a[aria-current="page"] { color: var(--thread); box-shadow: inset 0 -2px 0 var(--thread); }
.site-search { display: flex; gap: 6px; width: 100%; max-width: 400px; }

input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--edge); border-radius: 3px; background: var(--card);
  font: 17px/1.2 var(--sans); color: var(--ink);
}
input[type="search"]::placeholder { color: #77706A; }
button {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--thread); border-radius: 3px;
  background: var(--thread); color: #FFFFFF; font: 500 17px/1 var(--sans); cursor: pointer;
}
button:hover { background: var(--thread-dark); border-color: var(--thread-dark); }

/* Main content */
main { flex: 1 0 auto; padding-top: 28px; padding-bottom: 56px; }
h1 { margin: 0 0 12px; font-size: clamp(36px, 5vw, 58px); line-height: 1.06; font-weight: 500; letter-spacing: -0.01em; }
h2 { margin: 0 0 12px; font-size: 28px; line-height: 1.2; font-weight: 500; }
h3 { font-weight: 500; }
.lede { margin: 0 0 28px; max-width: 46em; font-size: 21px; line-height: 1.55; color: var(--ink-soft); }
.lifespan { margin: 0 0 32px; font-size: 24px; color: var(--ink-soft); font-variant-numeric: tabular-nums lining-nums; }
.crumbs { margin: 0 0 22px; font-size: 15px; color: var(--muted); }
.note { color: var(--muted); font-size: 16px; }
p.note { margin: 6px 0 16px; }
.years { margin-left: 6px; font-family: var(--sans); font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }

.columns { display: flex; flex-wrap: wrap; gap: 44px 64px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; }
.col-side { flex: 1 1 280px; min-width: 0; font-size: 16px; line-height: 1.5; }
section { margin-bottom: 40px; }

/* Facts list */
.facts { margin: 0; display: grid; grid-template-columns: minmax(90px, max-content) 1fr; font-size: 18px; border-top: 1px solid var(--rule); }
.facts dt { padding: 12px 24px 12px 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.facts dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.privacy-note { margin-top: 12px; }

/* Family */
.label { margin: 22px 0 6px; font-size: 16px; color: var(--muted); }
.people-line { margin: 0 0 14px; font-size: 20px; line-height: 1.55; }
.card { margin: 0 0 18px; padding: 16px 20px 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; }
.card .spouse { margin: 0 0 6px; font-size: 21px; }
.card .event { margin: 0 0 6px; font-size: 16px; color: var(--ink-soft); }
.children { list-style: none; margin: 8px 0 0; padding: 0; font-size: 17px; }
.children li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 6px 0; border-top: 1px solid var(--rule-soft); }
.children li a { flex: 0 1 260px; }
.children .years { margin-left: 0; }

/* Line of descent */
.descent { list-style: none; margin: 0; padding: 0; }
.descent li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 6px 0; font-size: 19px; border-top: 1px solid var(--rule-soft); }
.descent .gen { min-width: 1.6em; font-weight: 700; color: var(--thread); font-variant-numeric: tabular-nums lining-nums; }
.descent .years { margin-left: 0; }

/* Side panels */
.panel { padding: 20px 22px; margin-bottom: 22px; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; }
.panel.dashed { background: transparent; border-style: dashed; border-color: var(--edge); }
.panel h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; }
.panel p { margin: 0 0 10px; color: var(--ink-soft); overflow-wrap: anywhere; }
.panel p:last-child { margin-bottom: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 7px 0; border-top: 1px solid var(--rule-soft); }

/* Surname lists */
.roster { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.roster li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.roster .who { flex: 0 1 280px; font-size: 20px; }
.roster .years { flex: 0 0 140px; margin-left: 0; color: var(--ink); }
.roster .rel { flex: 1 1 220px; font-size: 16px; color: var(--muted); }

.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 36px; }
.az a, .az span { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 18px; border-radius: 3px; }
.az a { border: 1px solid var(--rule); background: var(--card); color: var(--ink); text-decoration: none; }
.az a:hover { border-color: var(--thread); color: var(--thread); }
.az span { color: var(--faint); }

.table-scroll { overflow-x: auto; margin-bottom: 44px; }
table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 17px; }
th { padding: 8px 14px 8px 0; text-align: left; font-weight: 500; font-size: 15px; color: var(--muted); border-bottom: 2px solid var(--ink); }
td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); color: var(--ink-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
a.fam { font-family: var(--serif); font-size: 21px; }

.letter { margin: 28px 0 10px; font-size: 26px; scroll-margin-top: 16px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--rule); background: var(--card); border-radius: 3px; color: var(--ink); text-decoration: none; font-size: 16px; }
.chips a:hover { border-color: var(--thread); color: var(--thread); }
.chips .count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums lining-nums; }

/* Search */
.big-search { margin: 0 0 28px; max-width: 640px; }
.big-search label { display: block; margin: 0 0 6px; font-family: var(--sans); font-size: 16px; color: var(--muted); }
.big-search .row { display: flex; gap: 8px; }
.big-search input[type="search"] { min-height: 50px; font-size: 19px; }
.big-search button { min-height: 50px; padding: 0 22px; }
.status { min-height: 1.5em; margin: 0 0 12px; font-size: 17px; color: var(--ink-soft); }
.results { list-style: none; margin: 0 0 28px; padding: 0; border-top: 1px solid var(--rule); }
.results li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.results .who { flex: 0 1 300px; font-size: 20px; }
.results .years { flex: 0 0 130px; margin-left: 0; color: var(--ink); }
.results .where { flex: 1 1 220px; font-family: var(--sans); font-size: 16px; color: var(--muted); }
.results .kind { font-family: var(--sans); font-size: 14px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 40px; padding-top: 24px; padding-bottom: 40px; }
.site-footer p { margin: 0; }

/* Phones: the selvedge becomes a band across the top */
@media (max-width: 700px) {
  body { font-size: 18px; }
  .frame { flex-direction: column; }
  .selvedge { flex: 0 0 14px; border-right: 0; border-bottom: 2px solid var(--thread);
    background: url("/images/background.jpg") left center / 140px auto repeat-x; }
  .wrap { padding-left: 18px; padding-right: 18px; }
  .site-header { padding-top: 14px; }
  .brand { flex-basis: 100%; }
  .brand img { width: 290px; }
  .header-tools { align-items: stretch; }
  .site-nav { justify-content: flex-start; gap: 0 20px; font-size: 17px; }
  .site-search { max-width: none; }
  .lifespan { font-size: 21px; margin-bottom: 24px; }
  .facts { font-size: 17px; }
  .facts dt { padding-right: 16px; }
  .people-line { font-size: 19px; }
  .roster .years, .results .years { flex-basis: auto; }
}

@media print {
  .selvedge, .site-search, .skip, .site-nav { display: none; }
  body { background: #FFFFFF; }
}

/* A person page without a date line under the name */
h1 + .columns { margin-top: 28px; }

/* ------------------------------------------------------------------
   Bob's pages: stories, photographs, home
   ------------------------------------------------------------------ */
.story { max-width: 42em; }
.story > p { margin: 0 0 1.05em; font-size: 20px; line-height: 1.68; }
.story h2 { margin: 1.8em 0 0.5em; font-size: 28px; scroll-margin-top: 16px; }
.byline { margin: 0 0 28px; font-size: 16px; color: var(--muted); }
.figure { margin: 1.6em 0 1.8em; }
.figure img { display: block; border: 10px solid var(--card); box-shadow: 0 1px 0 var(--rule); }
.figure figcaption { margin-top: 8px; font-family: var(--sans); font-size: 15px; color: var(--muted); }
.toc { margin: 0 0 32px; padding: 16px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; font-size: 16px; }
.toc p { margin: 0 0 6px; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.4em; columns: 2 220px; column-gap: 32px; }
.toc li { padding: 3px 0; break-inside: avoid; }
.pioneers { list-style: none; margin: 0 0 1.2em; padding: 0; font-size: 17px; border-top: 1px solid var(--rule); }
.pioneers li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums lining-nums; }
.reports { list-style: none; margin: 0 0 1.4em; padding: 0; columns: 2 260px; column-gap: 32px; font-size: 18px; }
.reports li { padding: 9px 0; border-bottom: 1px solid var(--rule-soft); break-inside: avoid; }
.copyright { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.flag { width: 36px; height: auto; margin-right: 10px; vertical-align: -3px; border: 1px solid var(--rule); }

/* Stories index */
.story-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.story-list li { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.story-list h2 { margin: 0 0 6px; font-size: 26px; }
.story-list .teaser { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-soft); }

/* Family Treasures gallery */
.treasures .lede { margin-bottom: 24px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 24px; align-items: start; }
.photo { margin: 0; padding: 12px 12px 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; }
.photo img { display: block; margin: 0 auto; max-height: 420px; width: auto; }
.photo figcaption { margin-top: 10px; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink-soft); }

/* Home */
.hero { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-start; margin: 8px 0 48px; }
.hero-photo { flex: 0 1 320px; margin: 0; }
.hero-photo img { display: block; width: 100%; border: 10px solid var(--card); box-shadow: 0 1px 0 var(--rule); }
.hero-photo figcaption { margin-top: 8px; font-family: var(--sans); font-size: 15px; color: var(--muted); }
.hero-text { flex: 1 1 420px; min-width: 0; }
.hero-text h1 { font-size: clamp(34px, 4.4vw, 52px); }
.memorial { margin: 0 0 18px; font-size: 17px; color: var(--ink-soft); }
.dedication { margin: 0 0 28px; padding: 4px 0 4px 22px; border-left: 3px solid var(--thread); }
.dedication p { margin: 0; font-size: 22px; line-height: 1.55; font-style: italic; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border: 1px solid var(--thread); border-radius: 3px; background: var(--thread); color: #FFFFFF; font: 500 18px/1 var(--sans); text-decoration: none; }
.button:hover { background: var(--thread-dark); border-color: var(--thread-dark); color: #FFFFFF; }
.button.secondary { background: var(--card); color: var(--ink); border-color: var(--edge); }
.button.secondary:hover { border-color: var(--thread); color: var(--thread); background: var(--card); }
.intro p { margin: 0 0 1.05em; font-size: 20px; line-height: 1.68; max-width: 42em; }
.col-side .chips { margin-bottom: 10px; }

@media (max-width: 700px) {
  .story > p, .intro p { font-size: 18px; }
  .hero-text { order: -1; }
  .hero-photo { flex-basis: 100%; max-width: 240px; }
  .dedication p { font-size: 19px; }
  .gallery { grid-template-columns: 1fr; }
}
.story-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; max-width: 840px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 17px; }

/* Places */
.countries a { width: auto; padding: 0 14px; }
.letter .count { margin-left: 8px; font-size: 16px; color: var(--muted); font-weight: 400; }
.roster .couple { flex: 0 1 520px; font-size: 20px; }
a.place { color: inherit; text-decoration-color: var(--edge); }
a.place:hover { color: var(--thread); text-decoration-color: currentColor; }

/* Photographs */
.in-photo { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--rule-soft); font-size: 14px; line-height: 1.5; color: var(--muted); }
.person-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; align-items: start; margin-bottom: 8px; }
.person-photos .photo img { max-height: 260px; }
.photo { scroll-margin-top: 16px; }
.photo:target { border-color: var(--thread); box-shadow: 0 0 0 2px var(--thread); }
