/* Layout: een rustige leeskolom; vaste balk met boek, hoofdstuk en zoeken; verzen als rijen met vertalingen in kolommen. */
:root {
  --bg: #fbfbf9;
  --surface: #f1f2ee;
  --row: #f4f5f1;
  --ink: #1d2433;
  --muted: #5d6474;
  --line: #d9dbd3;
  --accent: #6b2737;
  --accent-ink: #ffffff;
  --jas: #8a6417;
  --apo: #3d6b5e;
  --mark: #f3e3b0;
  --display: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --read: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ui: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
/* Donker volgt de instelling van het apparaat; de knop met de halve maan zet het vast licht of donker. Binnen de Wix-pagina blijft de bijbel altijd licht. */
:root { color-scheme: light; --scale: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171d; --surface: #1c2028; --row: #191d24; --ink: #e6e4dd; --muted: #a2a6b0; --line: #2e333d;
    --accent: #d88b9b; --accent-ink: #14171d; --jas: #d6ad5c; --apo: #7fb8a6; --mark: #4a3f1c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171d; --surface: #1c2028; --row: #191d24; --ink: #e6e4dd; --muted: #a2a6b0; --line: #2e333d;
    --accent: #d88b9b; --accent-ink: #14171d; --jas: #d6ad5c; --apo: #7fb8a6; --mark: #4a3f1c; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 15px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.2rem; font-weight: 500; letter-spacing: .01em; color: var(--accent); margin-right: auto; white-space: nowrap; text-decoration: none; }
.brand .logo { width: 34px; height: 42px; flex: none; background: var(--ink); -webkit-mask: url(/logo.svg) center / contain no-repeat; mask: url(/logo.svg) center / contain no-repeat; }
.brand .name { display: block; }
.toplink { color: var(--muted); font-size: .85rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.toplink:hover { color: var(--accent); }
.brand small { display: block; font-family: var(--ui); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
select, input[type="search"], button { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
select { max-width: 70vw; }
/* Vaste breedte en hoogte vooraf, zodat de balk en de voettekst niet verspringen als de boekenlijst en de verzen binnenkomen (CLS). */
#book { width: 17rem; }
button { cursor: pointer; }
button:hover { border-color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 7px 10px; background: var(--bg); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.searchbox { display: flex; gap: 6px; flex: 1 1 220px; min-width: 0; }
.searchbox input { flex: 1; min-width: 0; }
main { padding-block: 22px 60px; min-height: 100vh; }
.headline h1 { cursor: pointer; }
.headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0; text-wrap: balance; letter-spacing: .01em; }
.tag { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.tag.jas, .tag.hen { color: var(--jas); } .tag.apo { color: var(--apo); } .tag.ot, .tag.nt { color: var(--muted); }
.place { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 18px; }
.chapters button { min-width: 2.6em; padding: 5px 0; text-align: center; font-variant-numeric: tabular-nums; font-size: .85rem; }
.chapters button[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nav { display: flex; justify-content: space-between; gap: 10px; margin-block: 18px; }
.nav button { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verses { border-top: 1px solid var(--line); }
.colhead, .v { display: grid; grid-template-columns: 3.2em repeat(var(--cols), minmax(0, 1fr)); gap: 0 22px; }
.colhead { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.v { padding: 9px 8px; font-family: var(--read); font-size: calc(1.05rem * var(--scale)); font-weight: 300; line-height: 1.65; }
.v:nth-child(even) { background: var(--row); }
.v.hl { background: var(--mark); }
.v .n { font-family: var(--ui); font-size: .78rem; font-weight: 600; color: var(--accent); padding-top: .35em; text-align: right; background: none; border: 0; padding-inline: 0; font-variant-numeric: tabular-nums; align-self: start; }
.v .t { min-width: 0; }
.v .t i { color: var(--muted); }
.v .lbl { display: none; }
.sub { display: grid; grid-template-columns: 3.2em repeat(var(--cols), minmax(0, 1fr)); gap: 0 22px; padding: 16px 8px 4px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.place a { color: var(--accent); }
.xref { grid-column: 2 / -1; font-family: var(--ui); font-size: .8rem; font-weight: 400; color: var(--muted); line-height: 1.4; }
.xref a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); margin-left: 4px; }
#theme { padding-inline: 9px; line-height: 1; }
#theme svg { width: 16px; height: 16px; display: block; fill: currentColor; }
/* Onderbalk op de telefoon: vorig hoofdstuk, boek kiezen, volgend hoofdstuk. */
.bar { display: none; }
/* Boekkiezer: alle boeken in onze volgorde, met zoekveld en beginletters. */
.picker { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: var(--bg); color: var(--ink); }
.picker[open] { display: flex; flex-direction: column; }
.picker::backdrop { background: rgba(10, 12, 16, .45); }
.ph { display: flex; gap: 8px; align-items: center; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ph input { flex: 1; min-width: 0; }
.ph .back { padding-inline: 12px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.letters button { min-width: 2.1em; padding: 4px 0; font-size: .82rem; font-weight: 500; }
.plist { overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom, 0px)); flex: 1; overscroll-behavior: contain; }
.plist h3 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.plist .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.plist .grid button { text-align: left; padding: 9px 10px; }
.plist .grid button[aria-current="true"] { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.plist .grid button.jas, .plist .grid button.hen { color: var(--jas); }
.plist .grid button.apo { color: var(--apo); }
.plist .chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.2em, 1fr)); gap: 6px; margin-top: 12px; }
.plist .chgrid button { padding: 10px 0; text-align: center; font-variant-numeric: tabular-nums; }
.plist .flash { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (min-width: 681px) {
  .picker { width: min(760px, 92vw); height: auto; max-height: 86vh; margin: 7vh auto auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
  .ph { padding-top: 10px; }
}
.empty { padding: 28px 0; max-width: 62ch; line-height: 1.6; font-size: 1rem; }
.empty h2 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; margin: 0 0 6px; }
.results { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 2px; }
.results li { padding: 10px 8px; border-bottom: 1px solid var(--line); font-family: var(--read); font-weight: 300; line-height: 1.55; }
.results a { font-family: var(--ui); font-weight: 600; color: var(--accent); text-decoration: none; margin-right: 8px; }
.results mark { background: var(--mark); color: inherit; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 6px; font-size: .88rem; max-width: calc(100% - 32px); }
footer a { color: var(--accent); }
footer { color: var(--muted); font-size: .8rem; line-height: 1.55; border-top: 1px solid var(--line); padding-block: 18px 30px; }
@media (max-width: 680px) {
  .colhead { display: none; }
  .sub { grid-template-columns: 1fr; padding-left: calc(2.4em + 18px); }
  .sub span:empty { display: none; }
  .v { grid-template-columns: 2.4em minmax(0, 1fr); gap: 4px 10px; }
  .v .t { grid-column: 2; }
  .v .n { grid-row: 1 / span 4; }
  .v .lbl { display: inline; font-family: var(--ui); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 6px; font-weight: 600; }
  .brand { width: 100%; }
  header.top { position: static; }
  /* Telefoon: Voorwoord naast de boekenlijst, knoppen op de regel eronder. Zo valt de indeling altijd gelijk uit, ook als het lettertype later binnenkomt. */
  .controls { width: 100%; }
  #book { width: calc(100% - 100px); max-width: none; }
  #trans, #lang, #size, #theme { order: 2; }
  #print { display: none; }
  /* Hoofdstukken kiest u op de telefoon via de balk onderin; zo staat de tekst direct bovenaan. */
  .chapters { display: none; }
  .toplink { order: 1; margin-left: auto; }
  .bar { display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding: 7px max(12px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .bar button { height: 44px; }
  .bar .arrow { width: 54px; flex: none; font-size: 1.25rem; line-height: 1; }
  .bar .mid { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar .mid::after { content: " ▾"; color: var(--muted); font-size: .8em; }
  main { padding-bottom: 40px; }
  footer { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media print {
  header.top, .chapters, .nav, footer, .toast, .bar, .xref { display: none !important; }
  .v:nth-child(even) { background: none; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
