/* Bible Thumper — casual & bright. Colours are tokens; book colours live in lib.js too. */
:root {
  --bg: #fffaf0;
  --bg2: #fff3d6;
  --ink: #2b2140;
  --muted: #7a6f8f;
  --card: #ffffff;
  --line: #f1e4c8;
  --sun: #ffd43b;
  --coral: #ff6b6b;
  --orange: #ffa94d;
  --green: #51cf66;
  --sky: #4dabf7;
  --grape: #9775fa;
  --note-bg: #eef6ff;
  --note-ink: #1d4e89;
  --wj: #d6336c;
  --mark: #fff08a;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(43, 33, 64, .06), 0 8px 24px rgba(43, 33, 64, .07);
  --ui: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --scripture: "Literata", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 500 17px/1.55 var(--ui);
  color: var(--ink);
  background: radial-gradient(1200px 500px at 10% -10%, #fff1b8 0, transparent 60%),
              radial-gradient(900px 500px at 110% 0, #ffe3e3 0, transparent 55%), var(--bg);
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ---- top bar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 14px; align-items: center;
  padding: 10px 16px;
  background: rgba(255, 250, 240, .9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 20px; white-space: nowrap; }
.logo b { color: var(--coral); font-weight: 900; }
.logo-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--sun); font-size: 20px; transform: rotate(-8deg); }
.searchbox { flex: 1; display: flex; max-width: 640px; margin-left: auto; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 10px 16px; font: 600 16px var(--ui); background: transparent; color: var(--ink); }
.searchbox button { border: 0; background: var(--sun); padding: 0 16px; font-size: 18px; }
.searchbox:focus-within { box-shadow: 3px 3px 0 var(--coral); border-color: var(--coral); }

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; outline: none; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 30px; }

/* ---- shared bits ---------------------------------------------------------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; color: #fff; text-decoration: none; white-space: nowrap; }
.chip { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 700; text-decoration: none; transition: transform .12s, border-color .12s; }
.chip:hover { transform: translateY(-2px); border-color: var(--sun); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.loading { padding: 40px; text-align: center; color: var(--muted); font-weight: 700; }
.loading::before { content: "📖"; display: block; font-size: 34px; animation: bob 1s infinite alternate ease-in-out; }
@keyframes bob { to { transform: translateY(-8px) rotate(6deg); } }

/* ---- home ------------------------------------------------------------------ */
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.05; margin: 0 0 10px; font-weight: 900; letter-spacing: -.02em; }
.hero h1 .hl { background: linear-gradient(transparent 60%, var(--sun) 60%); padding: 0 4px; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 auto 20px; max-width: 560px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 34px; }
.books { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.book { padding: 18px; border-top: 8px solid var(--c); }
.book h2 { margin: 0 0 2px; font-size: 24px; font-weight: 900; }
.book p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; }
.chapters a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg2); font-weight: 800; text-decoration: none; font-size: 14px; }
.chapters a:hover, .chapters a.on { background: var(--c); color: #fff; }

/* ---- reader ---------------------------------------------------------------- */
.reader-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.reader-head h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); font-weight: 900; }
.reader-head h1 small { color: var(--c); }
.nav { display: flex; gap: 8px; align-items: center; }
.btn { border: 2px solid var(--ink); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 800; text-decoration: none; box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; user-select: none; cursor: pointer; }
.toggle input { accent-color: var(--sky); width: 18px; height: 18px; }
.chapter-strip { margin: 0 0 22px; }

.passages { display: flex; flex-direction: column; gap: 14px; }
.passage { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0; align-items: stretch; }
.scripture { padding: 18px 22px; font: 400 18px/1.75 var(--scripture); border-radius: var(--radius) 0 0 var(--radius); }
.scripture .v { scroll-margin-top: 90px; border-radius: 6px; transition: background .4s; }
.scripture sup { font: 800 11px var(--ui); color: var(--c, var(--coral)); margin-right: 3px; vertical-align: 5px; }
.scripture .para::before { content: ""; display: block; height: 10px; }
.scripture .para:first-child::before { display: none; }
.wj { color: var(--wj); }
.v.flash { background: var(--mark); }
.note { position: relative; padding: 18px 20px; background: var(--note-bg); color: var(--note-ink); border-radius: 0 var(--radius) var(--radius) 0; border-left: 3px dashed #b9d8fb; }
.note h3 { margin: 0 0 6px; font-size: 17px; font-weight: 900; line-height: 1.25; }
.note .range { font-size: 12px; font-weight: 800; opacity: .6; text-transform: uppercase; letter-spacing: .05em; }
.note p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.5; }
.notes-off .passage { grid-template-columns: 1fr; }
.notes-off .note { display: none; }
.notes-off .scripture { border-radius: var(--radius); }

/* ---- search ---------------------------------------------------------------- */
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin: 4px 0 16px; }
.results-head h1 { margin: 0; font-size: 26px; font-weight: 900; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.filters a { padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 14px; text-decoration: none; }
.filters a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.section-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 26px; }
.section-hit { padding: 14px 16px; text-decoration: none; display: block; border-left: 6px solid var(--c); transition: transform .12s; }
.section-hit:hover { transform: translateY(-3px); }
.section-hit h3 { margin: 6px 0 4px; font-size: 16px; font-weight: 900; line-height: 1.25; }
.section-hit p { margin: 0; font-size: 14px; color: var(--muted); }
h2.label { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 900; }
.hits { display: flex; flex-direction: column; gap: 10px; }
.hit { padding: 14px 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start; }
.hit .text { font: 400 17px/1.6 var(--scripture); }
.hit .meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.hit .meta a { color: var(--sky); text-decoration: none; }
.badge { background: var(--bg2); border-radius: 6px; padding: 0 6px; }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.empty { text-align: center; padding: 40px 10px; }
.empty .big { font-size: 46px; }
.ref-banner { padding: 16px 18px; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--sun); border-radius: var(--radius); font-weight: 800; }

/* ---- phones: notes sit above each passage ------------------------------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .logo { font-size: 18px; }
  .searchbox { flex-basis: 100%; max-width: none; }
  main { padding: 14px 12px 50px; }
  .passage { grid-template-columns: 1fr; }
  .note { order: -1; border-radius: var(--radius) var(--radius) 0 0; border-left: 0; border-bottom: 3px dashed #b9d8fb; padding: 14px 16px; }
  .scripture { border-radius: 0 0 var(--radius) var(--radius); padding: 14px 16px; font-size: 17px; }
  .hit { grid-template-columns: 1fr; padding: 12px 14px; }
  .hit .meta { grid-column: 1; }
}
