/* Worth Memorizing. The form comes from the thing itself: a ruled index card and the
   card box that spaced review was invented with. BibleDo law: Fraunces for Scripture
   and headings, Inter for our words; gold is light (the card's header line, the glow
   where a word was), never a surface; clean white by day, true black by night. */

@font-face { font-family: 'Inter'; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/inter-6ab57b19.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/fraunces-8f90dc37.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/fraunces-0e9e2189.woff2') format('woff2'); }

:root {
  --ground: #f3f4f6;
  --paper: #ffffff;
  --ink: #15171c;
  --ink-2: #474d59;
  --ink-3: #5f6673;
  --rule: #dde1e8;
  --rule-strong: #b9c0cc;
  --ruling: #e3e8ef;
  --gold: #f5a623;
  --glow: rgba(245, 166, 35, 0.32);
  --r-1: 3px;
  --r-2: 8px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 40rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #000000;
    --paper: #0c0d0f;
    --ink: #f2f2ef;
    --ink-2: #c3c6cc;
    --ink-3: #a3a8b1;
    --rule: #25272c;
    --rule-strong: #3d4048;
    --ruling: #1a1c20;
    --gold: #ffb43c;
    --glow: rgba(255, 180, 60, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--glow); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3.6vw, 1.75rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 9; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- frame */
.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 16px; }
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding-top: 12px; padding-bottom: 12px; }
.mark { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.mark svg { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0 18px; font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--ink-2); display: inline-flex; align-items: center; min-height: 44px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
main { display: block; padding: 32px 0 64px; }
.site-foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; color: var(--ink-3); font-size: 0.9375rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-foot a { color: var(--ink-2); }

/* ---------------------------------------------------------------- type blocks */
.lede { font-size: 1.125rem; color: var(--ink-2); max-width: var(--measure); margin-top: 12px; }
.prose { max-width: var(--measure); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 1em; }
.prose ul { padding-left: 1.2em; margin: 0; }
.prose li + li { margin-top: 0.5em; }
.section { margin-top: 56px; }
.section > h2 + p, .section > h2 + .prose { margin-top: 12px; }
.crumbs { font-size: 0.9375rem; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-2); }
.theme { margin-top: 8px; color: var(--ink-2); font-size: 1.0625rem; }
.small { font-size: 0.9375rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- the index card */
.trainer { margin-top: 24px; }
.card {
  position: relative;
  background-color: var(--paper);
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--gold);
  border-radius: var(--r-2);
  padding: 20px 22px 18px;
}
.card-ref { font-family: var(--serif); font-size: 1.0625rem; color: var(--ink-2); padding-bottom: 10px; }
.card-text {
  --lh: 1.55em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 4.2vw, 1.8rem);
  line-height: var(--lh);
  white-space: pre-wrap;
  /* the card's ruling: one faint line under every line of words */
  background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), var(--ruling) calc(var(--lh) - 1px));
  background-size: 100% var(--lh);
  background-position: 0 0.12em;
  min-height: calc(var(--lh) * 3);
}
.card-text.is-small { font-size: clamp(1.15rem, 3.6vw, 1.45rem); }
.gap { white-space: nowrap; color: var(--ink-3); }
.gap .hint::after {
  content: '';
  display: inline-block;
  width: calc(var(--n, 2) * 0.5em);
  margin-left: 0.06em;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 3px 8px -2px var(--glow);
  vertical-align: baseline;
  transition: width 160ms ease;
}
.round { min-height: 1.6em; margin-top: 12px; font-size: 0.9375rem; color: var(--ink-3); }
.controls { display: none; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.is-live .controls { display: flex; }
.progress { min-height: 1.4em; margin-top: 10px; font-size: 0.875rem; color: var(--ink-3); }
.boxline { display: none; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
.is-live .boxline { display: flex; }
.box-note { flex: 1 1 100%; font-size: 0.9375rem; color: var(--ink-2); }
.box-due { color: var(--ink); font-weight: 500; }
.nojs-note { margin-top: 12px; font-size: 0.9375rem; color: var(--ink-3); }
.is-live .nojs-note { display: none; }

.btn {
  font: 500 0.9375rem/1.2 var(--sans);
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-1);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:active:not(:disabled) { box-shadow: 0 0 0 4px var(--glow); }
.btn:disabled { color: var(--ink-3); cursor: default; opacity: 0.7; }
.btn[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 4px var(--glow); }
.btn-primary:disabled { background: var(--paper); color: var(--ink-3); border-color: var(--rule-strong); }
.btn-quiet { color: var(--ink-2); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }

/* ---------------------------------------------------------------- the review box */
.box {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-2);
  background: var(--paper);
  overflow: hidden;
}
.compartment { padding: 12px 10px 14px; border-left: 1px solid var(--rule); position: relative; }
.compartment:first-child { border-left: 0; }
.compartment .tab { display: block; font-size: 0.8125rem; color: var(--ink-3); }
.compartment .count { display: block; font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 4px; }
.compartment.has-cards::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gold); box-shadow: 0 2px 10px var(--glow); }
.due-note { margin-top: 14px; color: var(--ink-2); }

/* ---------------------------------------------------------------- lists of verses */
.rows { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: minmax(9.5rem, 12rem) 1fr auto; gap: 4px 18px; align-items: baseline; padding: 12px 2px; text-decoration: none; min-height: 44px; }
.row:hover .row-ref { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.row-ref { font-family: var(--serif); font-size: 1.0625rem; }
.row-text { color: var(--ink-2); font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--ink-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.more { font-size: 0.9375rem; }
.book-group h3 { margin-top: 28px; font-size: 1.125rem; }

/* ---------------------------------------------------------------- verse page */
.scripture { font-family: var(--serif); font-size: 1.125rem; line-height: 1.65; white-space: pre-wrap; max-width: var(--measure); margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--rule-strong); }
.truths { list-style: none; padding: 0; margin: 14px 0 0; max-width: var(--measure); counter-reset: t; }
.truths li { position: relative; padding: 10px 0 10px 2.2em; border-bottom: 1px solid var(--rule); }
.truths li::before { counter-increment: t; content: counter(t); position: absolute; left: 0; top: 10px; font-family: var(--serif); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.listen { margin-top: 14px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* ---------------------------------------------------------------- method steps */
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 0; max-width: var(--measure); border-top: 1px solid var(--rule); }
.steps li { display: grid; grid-template-columns: 2.4rem 1fr; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.steps .n { font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; color: var(--ink-3); }
.steps b { font-weight: 600; }

.callout { margin-top: 18px; max-width: var(--measure); padding: 18px 0 0; border-top: 2px solid var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------------------------------------------------------------- print sheets */
.sheet-note { margin-top: 12px; }
.sheet { display: grid; grid-template-columns: repeat(2, 3.75in); grid-auto-rows: 2.5in; justify-content: center; margin-top: 24px; }
.pc { border: 1px dashed var(--rule-strong); margin: -0.5px; padding: 0.2in 0.22in 0.14in; display: flex; flex-direction: column; background: var(--paper); border-top: 3px solid var(--gold); overflow: hidden; }
.pc-ref { font-family: var(--serif); font-size: 11pt; color: var(--ink-2); }
.pc-text { font-family: var(--serif); font-size: var(--fs, 11pt); line-height: 1.35; margin-top: 6px; flex: 1; white-space: pre-wrap; }
.pc-foot { font-size: 6.5pt; color: var(--ink-3); text-align: right; }
.page-break { break-after: page; height: 0; }
.pack-cover { max-width: 6.5in; margin: 0 auto; }
.pc-foot:empty { display: none; }

@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr auto; }
  .row-text { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .box { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .compartment { padding: 10px 6px 12px; }
  .compartment .tab { font-size: 0.75rem; }
  .card { padding: 16px 16px 14px; }
  .sheet { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .pc { min-height: 2.5in; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  @page { size: letter; margin: 0.5in; }
  :root { --ground: #fff; --paper: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --rule-strong: #999; --gold: #f5a623; }
  body { background: #fff; font-size: 11pt; }
  .site-head, .site-foot, .noprint, .controls, .boxline, .progress, .round, .crumbs { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .sheet { margin: 0; grid-template-columns: repeat(2, 3.75in); grid-auto-rows: 2.5in; }
  .pc { min-height: 0; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { break-inside: avoid; }
}
