/* Family tree page — uses app theme variables. Cards sit on an absolute grid (family.js computes it); lines in SVG. */
.container.family { max-width: none; }
.family .subtitle { margin-bottom: 6px; }


.fam-scroll { overflow-x: auto; padding-bottom: 16px; }
.fam-tree { position: relative; margin: 0 auto; }


.fam-lines { position: absolute; top: 0; overflow: visible; pointer-events: none; }
.fam-lines path { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .7; }
/* Families' lines in a row take these in turn (family.js TINTS), so lines running side by side stay apart. */
.fam-lines .tint-0 { stroke: #8a9bb3; }
.fam-lines .tint-1 { stroke: #b48c6c; }
.fam-lines .tint-2 { stroke: #7fa58c; }
.fam-lines .tint-3 { stroke: #a690b8; }
.fam-lines .fam-couple { stroke: var(--accent); stroke-width: 2; opacity: .6; }
.fam-lines path { transition: opacity .12s; stroke-linejoin: round; }
.fam-lines.focus path { opacity: .12; }
.fam-lines.focus path.on { opacity: 1; stroke: var(--accent); stroke-width: 2.25; }

.fam-card { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-top: 21px; text-align: center; color: var(--text); text-decoration: none; }
.fam-face { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; overflow: hidden;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--muted);
  font-family: Literata, Georgia, serif; font-size: 20px; }
/* Profile pictures are full-length: zoom to the head. */
.fam-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  transform: scale(2.6); transform-origin: 50% 8%; }
.fam-name { font-family: Literata, Georgia, serif; font-size: 14px; line-height: 1.2; }
.fam-also { margin-top: -2px; font-size: 11px; color: var(--muted); line-height: 1.2; }

.fam-card.major { padding-top: 10px; }
.fam-card.major .fam-face { width: 72px; height: 72px; border: 2.5px solid var(--accent); }
.fam-card.major .fam-name { font-size: 16px; font-weight: 600; }
.fam-card.partner .fam-face { border-style: dashed; }
.fam-card.major.partner .fam-face { border-style: solid; }

.fam-credit { margin: -4px 0 20px; font-size: 13px; color: var(--muted); }
.fam-credit a { color: var(--accent); }

/* A folded line: "+N" under its parent; opens on click. */
button.fam-more { border: 0; background: none; font: inherit; cursor: pointer; }
.fam-more .fam-face { border-style: dotted; font-family: Inter, system-ui, sans-serif; font-size: 13px; font-weight: 600; }
.fam-more .fam-name { font-family: Inter, system-ui, sans-serif; font-size: 11px; color: var(--muted); }
.fam-more:hover .fam-face { border-color: var(--accent); color: var(--accent); }


/* A major character opens a panel of the chapters naming them. */
.fam-card[data-open] { cursor: pointer; }
.fam-card[data-open]:hover .fam-name, .fam-card[data-open]:focus-visible .fam-name { color: var(--accent); }
.fam-pop { position: absolute; z-index: 10; width: 320px; max-height: 420px; overflow: auto; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg); box-shadow: 0 12px 32px rgba(0,0,0,.3);
  font-size: 13px; }
.fam-pop-head { display: flex; justify-content: space-between; align-items: center; font-family: Literata, Georgia, serif;
  font-size: 17px; }
.fam-pop-close { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.fam-pop-sub { margin: 2px 0 10px; color: var(--muted); }
.fam-pop-book { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); }
.fam-pop-book > span:first-child { color: var(--text-soft); }
.fam-pop-chs { display: flex; flex-wrap: wrap; gap: 3px; }
.fam-pop-chs a { min-width: 26px; padding: 1px 5px; text-align: center; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface); font-variant-numeric: tabular-nums; }
.fam-pop-chs a:hover { border-color: var(--accent); color: var(--accent); }
.fam-pop-more { margin-top: 10px; }
.fam-pop-more summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.fam-pop-more summary:hover { color: var(--accent); }
