/* haedge.com: person pages (people/<id>.html) and the people index (people.html), both built by build_people.py.
   Sits on site.css (the look) and v2.css (tabs, chips); the record viewer is lightbox.css. Only site.css tokens.
   A person page works without JavaScript: the four panels stack, each under its own heading. js/person.js adds
   .tabbed to <main> and shows one panel at a time. */

/* ── person: head ─────────────────────────────────────────────── */
main.person{padding-top:44px;padding-bottom:64px}
.p-head.has-img{display:grid;grid-template-columns:1fr 232px;gap:36px;align-items:start}
.p-head .person-img{margin:6px 0 0}
.p-head .person-img a{display:block;cursor:zoom-in}
.p-head .person-img img{max-height:340px;width:100%;height:auto;object-fit:contain}
.p-head .note{margin:18px 0 0}
.p-head .lede{margin-bottom:0}

/* ── person: tabs (v2.css .tabs, made sticky so 20+ records stay navigable) ── */
.person .tabs{position:sticky;top:0;z-index:5;background:var(--paper);margin-top:34px;
  flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;
  box-shadow:0 0 0 100vmax var(--paper);clip-path:inset(0 -100vmax)}   /* paper band across the breakout figures */
.person .tabs::-webkit-scrollbar{display:none}
.person .tabs a{white-space:nowrap}
.person .tabs .n.zero{opacity:.55}

/* panels: stacked under their own headings without JS, one at a time with it */
.panel{position:relative;padding:0;border:0;scroll-margin-top:52px}
.panel[hidden]{display:none}
.panel .empty{color:var(--ink-2);font-style:italic}
.person .panel>h2{margin-top:34px}
.person .panel-story>h2{margin-top:6px;border-top:0}
.tabbed .panel{padding-top:30px}
.tabbed .panel>h2{position:absolute;width:1px;height:1px;margin:0;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.tabbed .panel>h2+*{margin-top:0}

/* story */
.panel-story .facts{margin-top:30px}
.panel-story .story-fig{margin:32px 0 8px}
.panel-story .story-fig>a{display:block;cursor:zoom-in}
.panel-story .story-fig img{width:100%;height:auto}

/* family */
.kin-kids{font-size:19px;margin:0 0 22px;padding:12px 16px;background:var(--paper-2);border-left:3px solid var(--accent)}
.kin-kids .eyebrow{display:block;font-size:11.5px;margin-bottom:2px}
.fam td .via{font-size:13.5px;color:var(--ink-2);font-style:italic}
.fam td .conf{margin-left:4px}
.fam-more{margin:24px 0 0}
.fam-more p{font-size:17px}
.panel-family .tree-link{margin:22px 0 0}
.panel .note{margin:30px 0 0}

/* evidence: the figures are site.css .evidence, unchanged; this adds the index and the record numbers */
.ev-intro{font-size:16px;color:var(--ink-2);margin:0 0 18px}
.ev-index,.ev-list{margin-left:calc(50% - min(530px, 50vw - 28px));margin-right:calc(50% - min(530px, 50vw - 28px))}
.ev-index{list-style:none;padding:0 0 26px;margin-top:0;margin-bottom:34px;border-bottom:1px solid var(--rule);
  display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px 18px}
.ev-index a{display:grid;grid-template-columns:22px 64px 1fr;gap:10px;align-items:center;text-decoration:none;color:var(--ink);
  padding:5px 6px 5px 0;border-radius:2px;line-height:1.3}
.ev-index a:hover{background:var(--paper-2)}
.ev-index a:hover .t{color:var(--accent)}
.ev-index .no{font-size:13px;color:var(--ink-2);text-align:right}
.ev-index .th{width:64px;height:48px;background:#fff;border:1px solid var(--rule);overflow:hidden;display:block}
.ev-index .th img{width:100%;height:100%;object-fit:cover;object-position:center 30%}
.ev-index .t{font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ev-index .t b{font-weight:normal;color:var(--accent);margin-right:5px}
.ev-list{counter-reset:ev}
.ev-list .evidence{margin-left:0;margin-right:0;counter-increment:ev;scroll-margin-top:64px}
.ev-list .evidence>a{cursor:zoom-in}
.ev-list .evidence img{height:auto}
.ev-list .evidence figcaption:before{content:"Record " counter(ev);display:block;font-style:normal;font-size:11.5px;
  letter-spacing:.16em;text-transform:uppercase;color:var(--accent);margin-bottom:4px}
.ev-top{display:inline-block;margin:0 0 10px;font-size:15px;text-decoration:none}

/* ── people index ─────────────────────────────────────────────── */
main.people{padding-top:48px;padding-bottom:64px}
.ptools{position:relative;margin:30px 0 26px;display:grid;gap:14px}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.psearch{font:inherit;font-size:17px;width:100%;max-width:540px;padding:10px 14px;border:1px solid var(--rule);border-radius:2px;background:#fffdf8;color:var(--ink)}
.psearch[hidden]{display:none}
.psearch::placeholder{color:#8f8170}
.psearch:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.ptools .chip small{font-size:12px;opacity:.7}
.pcount{font-size:14.5px;color:var(--ink-2);margin:0}
.pgroup{scroll-margin-top:12px}
.pgroup[hidden]{display:none}
.pgroup h2 .gn{font-size:15px;color:var(--ink-2);margin-left:8px;letter-spacing:.02em}
.pgroup.kids{border-top:2px solid var(--ink)}
.pgroup.kids h2 .swatch+.swatch{margin-left:-4px}
.plist li[hidden]{display:none}
.plist .recs{font-size:12.5px;letter-spacing:.04em;color:var(--gold);white-space:nowrap;margin-left:4px}
.pnone{padding:30px 0;border-top:1px solid var(--rule);color:var(--ink-2)}
.pnone[hidden]{display:none}

@media (max-width:860px){
  .p-head.has-img{grid-template-columns:1fr 150px;gap:20px}
}
@media (max-width:600px){
  main.person{padding-top:30px}
  .p-head.has-img{grid-template-columns:1fr}
  .p-head .person-img{max-width:260px}
  .p-head .person-img img{max-height:300px}
  .person .tabs{gap:4px 20px;margin-top:26px}
  .person .tabs a{font-size:14.5px}
  .fam,.fam tbody,.fam tr,.fam th,.fam td{display:block;width:auto}
  .fam tr{border-bottom:1px solid var(--rule);padding:8px 0}
  .fam th,.fam td{border:0;padding:0}
  .fam th{font-size:13px;letter-spacing:.08em;text-transform:uppercase}
  .ev-index{grid-template-columns:1fr;gap:2px}
  .ev-index a{grid-template-columns:20px 56px 1fr}
  .ev-index .th{width:56px;height:42px}
  .kin-kids{font-size:17px}
  .ptools .chips{gap:6px;flex-wrap:nowrap;overflow-x:auto;margin:0 -28px;padding:0 28px 2px;scrollbar-width:none}
  .ptools .chips::-webkit-scrollbar{display:none}
  .ptools .chip{font-size:13.5px;padding:3px 10px;white-space:nowrap;flex:none}
}
