/* Bible Family Tree: styles for bible.html and About.html (version listen4) */
  :root {
    --bg: #f4f1ea;
    --ink: #006abc;
    --muted: #006abc;
    --pane: #fffdf8;
    --sel: #006abc;
    --line: #bdb5a2;
    --blue: #006abc;
  }
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { height: 100%; margin: 0; }
  body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow: hidden;
  }

  /* ---------- two panes: people on the left, Bible text on the right ---------- */
  #app {
    display: grid;
    grid-template-columns: minmax(300px, 42%) 1fr;
    height: 100vh;
    height: 100dvh;
  }
  #tree {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid #c9c2b2;
  }
  #reader {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--pane);
  }

  /* ---------- generation bands (one colour per generation) ---------- */
  .band {
    --h: 205;
    background: hsl(var(--h) 70% 94%);
    border-bottom: 2px solid hsl(var(--h) 55% 70%);
    padding: 8px 10px 12px;
  }
  .band[data-alt="1"] { background: hsl(var(--h) 65% 84%); border-bottom-color: hsl(var(--h) 55% 62%); }
  .band > h2 {
    margin: 0 0 4px;
    font-size: .74rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--blue);
  }
  .group > h3 {
    margin: 8px 0 4px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--blue);
  }
  .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  /* ---------- sections for people who are not traced to Adam and Eve ---------- */
  .banner { padding: 14px 12px 11px; background: #2b2b2b; color: #f4f1ea; }
  .banner h2 { margin: 0 0 4px; font-size: .95rem; }
  .banner p { margin: 0; font-size: .78rem; color: #d8d2c3; line-height: 1.35; }
  .famhead {
    margin: 0; padding: 8px 10px 6px;
    font-size: .86rem; font-weight: 650;
    background: #e6e0d1; color: #2b2b2b;
    border-top: 3px solid var(--line);
  }

  /* ---------- one person ---------- */
  .tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    min-height: 66px;
    padding: 6px 3px 5px;
    border: 2px solid transparent;
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tile svg { width: 30px; height: 30px; color: var(--blue); flex: none; }
  .tile .name { font-size: .82rem; font-weight: 650; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
  .tile .sub { font-size: .68rem; color: var(--muted); line-height: 1.1; text-align: center; }
  .tile.main { border-color: var(--blue); }
  .tile.main::after {
    content: "\2605";
    position: absolute; top: 2px; right: 5px;
    font-size: .75rem; color: var(--blue);
  }
  .tile.nation { border-style: dashed; border-color: var(--blue); }
  .tile[aria-pressed="true"] { outline: 3px solid var(--sel); outline-offset: 1px; background: #fff; }
  .tile:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }

  #sentinel { height: 1px; }
  #status { padding: 14px; font-size: .85rem; color: var(--muted); }

  /* ---------- reader ---------- */
  #who { padding: 8px 14px 7px; border-bottom: 1px solid #e3dccb; flex: none; }
  #who .top { display: flex; align-items: center; gap: 8px; }
  #who h1 { margin: 0; font-size: 1.25rem; flex: 1; min-width: 0; }
  #who h1 small { font-weight: 400; color: var(--muted); font-size: .8rem; }
  .step {
    flex: none; width: 38px; height: 34px;
    border: 1px solid var(--line); border-radius: 0;
    background: #fff; color: var(--blue); font-size: 1rem; cursor: pointer;
  }
  #search::placeholder { color: var(--blue); opacity: .7; }
  .step:disabled { opacity: .35; cursor: default; }
  .meta { margin-top: 4px; font-size: .78rem; color: var(--muted); }
  /* each row of chips is one line that you can swipe sideways, so the Bible text keeps most of the height */
  .chips {
    display: flex; flex-wrap: nowrap; gap: 5px; margin-top: 5px; align-items: center;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips:empty { display: none; }
  .chips .lbl { font-size: .74rem; color: var(--muted); margin-right: 2px; flex: none; }
  .chip {
    flex: none; white-space: nowrap;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 0; padding: 2px 9px; font: inherit; font-size: .76rem; cursor: pointer;
  }
  .chip[aria-current="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

  #text {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 24px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    line-height: 1.55;
  }
  #text h2 { margin: 0 0 8px; font-size: 1rem; font-family: system-ui, sans-serif; color: var(--muted); }
  #text p.v { margin: 0 0 6px; padding: 2px 6px; border-radius: 0; }
  #text p.v sup { font-family: system-ui, sans-serif; font-size: .62em; color: var(--muted); margin-right: 3px; }
  /* the verse number of the verse on screen is the Listen button; so is the highlighted verse button above */
  #text p.v sup.listen {
    cursor: pointer; background: var(--blue); color: #fff;
    font-size: .72em; padding: 2px 6px 2px 4px; margin-right: 5px; vertical-align: .35em;
  }
  #text p.v sup.listen::before { content: "\25B6\00A0"; }
  #text p.v sup.listen:hover { background: #fff; color: var(--blue); outline: 1px solid var(--blue); }
  html.listening #text p.v sup.listen::before { content: "\25A0\00A0"; }
  #verses .chip[aria-current="true"]::before { content: "\25B6\00A0"; }
  html.listening #verses .chip[aria-current="true"]::before { content: "\25A0\00A0"; }
  #text p.v.hit { background: #d6e8f7; border-left: 4px solid var(--blue); padding-left: 8px; }
  #text .note { font-family: system-ui, sans-serif; font-size: .85rem; color: var(--muted); }

  /* ---------- the bar at the foot of the reader: Traceable, search, About ---------- */
  #credit {
    flex: none; position: relative;
    display: flex; align-items: center;
    min-height: 46px; padding: 0;
    font-size: .68rem; color: var(--muted);
    border-top: 1px solid #e3dccb;
  }
  #credit a { color: inherit; }
  #bar {
    width: 100%;
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px;
    background: var(--pane);
  }

  .switch {
    display: flex; align-items: center; gap: 6px; flex: none;
    height: 36px; padding: 0 10px 0 6px;
    border: 1px solid var(--line); border-radius: 0;
    background: #fff; color: var(--ink);
    font: inherit; font-size: .8rem; cursor: pointer;
  }
  .switch .track { position: relative; width: 34px; height: 20px; border-radius: 0; background: #8f8977; flex: none; transition: background .15s; }
  .switch .track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 0; background: #fff; transition: transform .15s;
  }
  .switch[aria-checked="true"] .track { background: var(--blue); }
  .switch[aria-checked="true"] .track::after { transform: translateX(14px); }
  .switch .state { font-size: .72rem; color: var(--muted); min-width: 1.7em; }
  #search {
    flex: 1; min-width: 0; height: 36px;
    border: 1px solid var(--line); border-radius: 0;
    padding: 0 12px; font: inherit; font-size: 16px;   /* 16px stops phones from zooming in on focus */
    background: #fff; color: var(--ink);
  }
  .creditsBtn {
    flex: none; height: 36px; padding: 0 11px;
    border: 1px solid var(--line); border-radius: 0;
    background: #fff; color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer;
    display: inline-flex; align-items: center; text-decoration: none;
  }
  /* the About button throbs to catch the eye; it stops for people who ask for less motion, and while it is hovered or focused */
  @keyframes throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
  .creditsBtn { animation: throb 1.5s ease-in-out infinite; transform-origin: center; }
  .creditsBtn:hover, .creditsBtn:focus-visible { animation: none; }
  @media (prefers-reduced-motion: reduce) { .creditsBtn { animation: none; } }
  @media (max-width: 760px) {
    .switch .state, .creditsBtn .txt { display: none; }
    .creditsBtn { padding: 0 10px; }
  }
  .switch:focus-visible, #search:focus-visible, .creditsBtn:focus-visible, .res:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }

  #results {
    position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); z-index: 6;
    background: #fff; border: 1px solid var(--line); border-radius: 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
  }
  #results { max-height: 230px; max-height: min(55dvh, 230px); overflow-y: auto; }
  .res {
    display: block; width: 100%; text-align: left;
    border: 0; border-bottom: 1px solid #eee7d6; background: none;
    padding: 7px 10px; font: inherit; color: var(--ink); cursor: pointer;
  }
  .res:last-child { border-bottom: 0; }
  .res:hover { background: #f4efe2; }
  .res .rn { font-weight: 650; font-size: .9rem; }
  .res .rd { display: block; font-size: .74rem; color: var(--muted); }
  .res .tag { margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 0; font-size: .66rem; font-weight: 400; color: var(--muted); }
  #results .empty { padding: 10px 12px; font-size: .82rem; color: var(--muted); }

  /* ---------- phone held upright: ask for landscape ---------- */
  #rotate {
    display: none;
    position: fixed; inset: 0;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px; text-align: center;
    background: var(--bg); font-size: 1.1rem;
  }
  #rotate .big { font-size: 3rem; }
  /* only on touch phones and tablets: a narrow laptop window or editor preview is also "portrait", but a mouse user can just widen it */
  @media (orientation: portrait) and (max-width: 820px) and (hover: none) and (pointer: coarse) {
    #app { display: none; }
    #rotate { display: flex; }
  }
  #rotate button {
    margin-top: 8px; padding: 10px 16px; border: 1px solid var(--blue); background: var(--blue); color: #fff;
    border-radius: 0; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  }
  #rotate button:hover { background: #fff; color: var(--blue); }
  /* "Use it upright anyway": the tree on top, the Bible text underneath */
  html.upright #rotate { display: none; }
  html.upright #app { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 46%) minmax(0, 54%); }
  html.upright #tree { border-right: 0; border-bottom: 2px solid var(--blue); }

/* ================= About page (About.html) ================= */
body.about { --line:#d8d1be; --blue:#006abc; --link:#006abc; --ink:#006abc; --muted:#006abc; height:auto; overflow:auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height:1.55; background:var(--bg); color:var(--ink); }
html:has(body.about) { height:auto; }
  body.about main { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
  body.about header { margin-bottom: 8px; }
  body.about h1 { font-size: 1.15rem; line-height: 1.35; margin: 0 0 8px; }
  body.about .sub { color: var(--muted); margin: 0 0 14px; }
  body.about .open { display:inline-block; background:var(--blue); color:#fff; border:1px solid var(--blue); text-decoration:none; padding:9px 16px; border-radius:0; font-weight:600; transition:background .2s, color .2s; }
  body.about .open:hover, body.about .open:focus-visible { background:#fff; color:var(--blue); }
  body.about section { background:var(--pane); border:1px solid var(--line); border-radius:0; padding:4px 18px 14px; margin-top:16px; }
  body.about h1, body.about h2 { color:var(--blue); }
  body.about h2 { font-size: 1.15rem; margin: 16px 0 6px; }
  body.about p, body.about li { font-size: .98rem; }
  body.about ul, body.about ol { padding-left: 1.3rem; margin: 6px 0; }
  body.about li { margin: 4px 0; }
  body.about a { color: var(--link); }
  body.about .stats { display:grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap:10px; margin: 10px 0 4px; }
  body.about .stat { background:#f4f1ea; border:1px solid var(--line); border-radius:0; padding:8px 10px; text-align:center; }
  body.about .stat b { display:block; font-size:1.3rem; }
  body.about .stat span { font-size:.78rem; color:var(--muted); }
  body.about table { border-collapse: collapse; width:100%; font-size:.92rem; margin-top:6px; }
  body.about th, body.about td { text-align:left; border-bottom:1px solid var(--line); padding:6px 8px 6px 0; vertical-align:top; }
  body.about th { color:var(--muted); font-weight:600; font-size:.8rem; text-transform:uppercase; letter-spacing:.05em; }
  body.about .note { background:#fff6d6; border:1px solid #ecd98a; border-radius:0; padding:8px 12px; font-size:.92rem; }
  body.about footer { margin-top: 22px; color: var(--muted); font-size:.85rem; }
