/*
Theme Name: Morrill Online
Theme URI: https://morrillonline.com
Description: Custom theme for morrillonline.com — Morrill / Morrell / Morrel / Morrall genealogy.
Version: 1.0.0
Author: Jeffrey Morrill
Author URI: https://morrillonline.com
License: All Rights Reserved
Text Domain: morrillonline
*/

/* ------------------------------------------------------------------ */
/* Design tokens                                                       */
/* ------------------------------------------------------------------ */
:root {
  --bg:         #f6f4ee;
  --surface:    #ffffff;
  --ink:        #23282b;
  --muted:      #6c726f;
  --accent:     #33523f;
  --accent-dk:  #274030;
  --gold:       #b08d57;
  --line:       #e5e1d6;
  --link:       #2f6d4e;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
  --maxw: 920px;
}

/* ------------------------------------------------------------------ */
/* Reset / base                                                        */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Layout wrapper                                                      */
/* ------------------------------------------------------------------ */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------------------------------------------ */
/* Site header                                                         */
/* ------------------------------------------------------------------ */
header.site {
  background: var(--accent);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
}
.brand b {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .2px;
  color: #fff;
}
.brand span {
  font-size: 12.5px;
  color: #cfe0d4;
  text-transform: uppercase;
  letter-spacing: .12em;
}
nav.main {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 15px;
}
nav.main a { color: #e7efe8; }
nav.main a:hover { color: #fff; text-decoration: none; }
nav.main a[aria-current] {
  color: #fff;
  font-weight: 500;
  border-bottom: 2px solid var(--gold);
}

/* ------------------------------------------------------------------ */
/* Ad slots                                                            */
/* ------------------------------------------------------------------ */
.ad {
  margin: 18px auto;
  max-width: 728px;
  min-height: 90px;
  border: 1px dashed #c8c2b3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a59e8c;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: #fbfaf6;
}

/* ------------------------------------------------------------------ */
/* Family page: breadcrumb + title + lifespan                         */
/* ------------------------------------------------------------------ */
nav.crumb {
  font-size: 14px;
  color: var(--muted);
  margin: 22px 0 4px;
}
nav.crumb a { color: var(--muted); }
nav.crumb a:hover { color: var(--ink); }
h1.fam-title {
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  margin: .1em 0 .15em;
}
p.lifespan {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 6px;
}

/* ------------------------------------------------------------------ */
/* Couple cards                                                        */
/* ------------------------------------------------------------------ */
.couple {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 22px 0;
}
.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.person .role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-weight: 600;
}
.person h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 4px 0 14px;
}

/* ------------------------------------------------------------------ */
/* Facts definition list (shared: parent + child cards)               */
/* ------------------------------------------------------------------ */
dl.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 15.5px;
}
dl.facts dt { color: var(--muted); white-space: nowrap; }
dl.facts dd { margin: 0; }
.place {
  color: var(--muted);
  font-size: 14.5px;
}

/* ------------------------------------------------------------------ */
/* Footnote references (inline superscripts)                          */
/* ------------------------------------------------------------------ */
sup a.fn {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: help;
}
sup a.fn:hover { color: var(--accent); }

/* ------------------------------------------------------------------ */
/* Footnote hover tooltip                                             */
/* ------------------------------------------------------------------ */
#fn-tip {
  position: absolute;
  z-index: 200;
  max-width: 360px;
  background: #262b28;
  color: #eef2ee;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 13px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,.20);
  pointer-events: none;
  white-space: pre-line;
  overflow-wrap: break-word;
}
#fn-tip em  { color: #dfe6df; }
#fn-tip a   { color: #bcd5c4; }
#fn-tip[hidden] { display: none; }

/* ------------------------------------------------------------------ */
/* Bio section (narrative paragraphs between couple and children)     */
/* ------------------------------------------------------------------ */
section.bio { margin: 30px 0; }
section.bio p { margin: 0 0 1em; max-width: 70ch; }
p.bio-inline { font-size: 15px; color: var(--muted); margin: 6px 0; }

/* ------------------------------------------------------------------ */
/* Children section                                                   */
/* ------------------------------------------------------------------ */
section.fam-children { margin: 34px 0; }
h3.sec {
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.children {
  column-width: 330px;
  column-gap: 14px;
  margin-top: 14px;
}
.child {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 14px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.child .hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.child .nm { font-size: 19px; font-weight: 600; }
.child .yr { color: var(--muted); font-size: 14px; white-space: nowrap; }
.child dl.facts { font-size: 14.5px; gap: 5px 14px; }
.child .sub { color: var(--muted); font-size: 13.5px; }
p.marr { margin: 0 0 6px; }
p.marr:last-child { margin-bottom: 0; }
.ord { color: var(--gold); font-weight: 600; }

/* "family page →" badge */
a.tofam {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 0 9px;
  margin-left: 6px;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: 1px;
}
a.tofam:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Sources section                                                     */
/* ------------------------------------------------------------------ */
section.sources-section { margin: 34px 0; }
ol.src {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  padding-left: 20px;
}
ol.src li { margin-bottom: 7px; }

/* ------------------------------------------------------------------ */
/* Index pages                                                         */
/* ------------------------------------------------------------------ */
h1.idx-title {
  font-size: 32px;
  font-weight: 600;
  margin: 18px 0 2px;
}
p.count { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
p.count b { color: var(--ink); font-weight: 600; }
ul.idx-list {
  list-style: none;
  padding: 0;
  columns: 3;
  column-gap: 20px;
}
ul.idx-list li { margin-bottom: 6px; break-inside: avoid; }
ul.idx-list a { font-weight: 500; }

.tbl {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.index {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.index th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: 2px solid var(--line);
}
.index td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.index tbody tr:last-child td { border-bottom: 0; }
.index tbody tr:hover { background: #faf8f3; }
.index .nm  { font-weight: 500; }
.index .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.index .sub { color: var(--muted); font-size: 14px; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.pager a {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
}
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager .where { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Home page                                                           */
/* ------------------------------------------------------------------ */
.hero { background: var(--accent-dk); color: #fff; }
.hero .wrap { padding: 46px 20px 40px; }
.hero h1 { font-size: 38px; font-weight: 600; line-height: 1.12; margin: 0 0 12px; max-width: 18ch; }
.hero p  { font-size: 18px; color: #dbe6dd; max-width: 60ch; margin: 0 0 24px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; border-radius: 8px; padding: 12px 20px; font-size: 15px; font-weight: 500; }
.btn-primary { background: var(--gold); color: #2a2410; text-decoration: none; }
.btn-primary:hover { background: #c39c63; text-decoration: none; }
.btn-ghost { border: 1px solid #6f8b78; color: #fff; }
.btn-ghost:hover { background: #3c5a45; text-decoration: none; }

.stats { background: var(--surface); border-bottom: 1px solid var(--line); }
.stats .wrap { display: flex; flex-wrap: wrap; gap: 8px 36px; padding: 16px 20px; }
.stat b { font-size: 20px; font-weight: 600; color: var(--accent); }
.stat span { color: var(--muted); font-size: 14px; margin-left: 6px; }

section.home-sec { margin: 36px 0; }
h2.sec { font-size: 24px; font-weight: 600; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 64ch; }
.prose p { margin: 0 0 1em; max-width: 68ch; }

.lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.line  { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.line .who   { font-size: 18px; font-weight: 600; margin: 0; }
.line .where { color: var(--gold); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 2px 0 8px; }
.line p      { font-size: 14.5px; color: var(--muted); margin: 0 0 10px; }

.join {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.join h2 { margin: 0 0 6px; font-size: 21px; }
.join p  { margin: 0; color: var(--muted); max-width: 52ch; }
.price   { text-align: center; white-space: nowrap; }
.price b { font-size: 34px; font-weight: 600; color: var(--accent); }
.price span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* ------------------------------------------------------------------ */
/* Site footer                                                         */
/* ------------------------------------------------------------------ */
footer.site {
  background: #262b28;
  color: #b7bdb8;
  font-size: 13.5px;
  margin-top: 40px;
}
footer.site .wrap { padding: 26px 20px; text-align: center; }
footer.site a { color: #cfe0d4; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 680px) {
  body { font-size: 16px; }
  h1.fam-title { font-size: 27px; }
  .couple { grid-template-columns: 1fr; }
  nav.main { gap: 14px; font-size: 14px; }
  ul.idx-list { columns: 2; }
  .join { grid-template-columns: 1fr; text-align: left; }
  .hero h1 { font-size: 29px; }

  /* Stacked index table on mobile */
  .index thead { display: none; }
  .index tbody tr {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .index tbody tr:hover { background: transparent; }
  .index td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border: 0;
    padding: 3px 0;
    text-align: right;
  }
  .index td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .index td:first-child { font-size: 17px; padding-bottom: 6px; }
  .index td:first-child::before { content: ""; }
}
