/* =====================================================================
   BibleKey — page kit.
   Components for the library, topic, people and answer pages. Built on
   the same tokens as biblekey.css so every surface reads as one product:
   cream canvas, gold hairlines, New York serif for Scripture and heads.
   ===================================================================== */

/* ---------------------------------------------------------------- HEAD */
.page-head { padding: 148px 32px 56px; position: relative; }
.page-head::after {
    content: ''; position: absolute; left: 50%; bottom: 0;
    transform: translateX(-50%); width: min(1240px, calc(100% - 64px));
    height: 1px; background: var(--card-edge);
}
.page-head .wrap { max-width: 860px; }
.page-head--wide .wrap { max-width: 1240px; }
.page-head h1 {
    font-size: clamp(36px, 5vw, 60px); line-height: 1.04; margin-bottom: 20px;
}
.page-head h1 em { font-style: italic; color: var(--gold-ink); font-weight: 600; }
.page-head .lede { max-width: 660px; font-size: clamp(17px, 1.5vw, 19.5px); }

.breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 12.5px; color: var(--ink-faint); margin-bottom: 22px;
    font-weight: 500; letter-spacing: 0.01em;
}
.breadcrumb a { color: var(--ink-muted); text-decoration: none; transition: color .2s ease; }
.breadcrumb a:hover { color: var(--gold-ink); }
.breadcrumb span.sep { color: var(--ink-ghost); }

/* --------------------------------------------------------------- PROSE */
.prose { max-width: 720px; font-size: 17.5px; line-height: 1.72; color: var(--ink-soft); }
.prose > * + * { margin-top: 22px; }
.prose h2 {
    font-size: clamp(26px, 3vw, 34px); color: var(--ink);
    margin-top: 62px; margin-bottom: -4px; letter-spacing: -0.02em;
}
.prose h2 em { font-style: italic; color: var(--gold-ink); font-weight: 600; }
.prose h3 {
    font-size: 21px; color: var(--ink); margin-top: 40px; margin-bottom: -8px;
}
.prose h2 + p, .prose h3 + p { margin-top: 18px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--gold-ink); text-decoration: none; border-bottom: 1px solid var(--gold-hair); transition: border-color .2s ease; }
.prose a:hover { border-bottom-color: var(--gold); }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 11px; }
.prose li { line-height: 1.66; }
.prose li::marker { color: var(--gold); }
.prose hr { border: none; height: 1px; background: var(--card-edge); margin: 52px 0; }

/* Scripture inside prose — always New York, always set apart */
.prose blockquote, .pull-verse {
    font-family: var(--serif); font-size: 20px; line-height: 1.58;
    color: var(--ink); border-left: 2px solid var(--gold-hair);
    padding: 4px 0 4px 22px; margin: 34px 0; font-style: normal;
}
.pull-verse cite {
    display: block; font-family: var(--sans); font-size: 13px; font-style: normal;
    color: var(--gold-ink); margin-top: 12px; letter-spacing: 0.06em;
    text-transform: uppercase; font-weight: 700;
}

/* --------------------------------------------------------------- TILES */
.tiles { display: grid; gap: 14px; }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.tiles--4 { grid-template-columns: repeat(4, 1fr); }
.tiles--2 { grid-template-columns: repeat(2, 1fr); }

.tile {
    display: block; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--card-edge);
    border-radius: var(--r-lg); padding: 20px 22px;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--lift-medium); border-color: var(--gold-hair); }
.tile h3 { font-size: 18px; letter-spacing: -0.015em; margin-bottom: 6px; }
.tile p { font-size: 14px; color: var(--ink-muted); line-height: 1.55; }
.tile .tile-meta { font-size: 11.5px; color: var(--gold-ink); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; }

/* Book tiles are denser — a library shelf, not a card wall */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.shelf a {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    text-decoration: none; color: var(--ink);
    padding: 13px 16px; border-radius: var(--r-md);
    border: 1px solid var(--card-edge); background: var(--surface);
    transition: border-color .2s ease, background .2s ease, transform .2s var(--ease);
}
.shelf a:hover { border-color: var(--gold-hair); background: var(--gold-wash); transform: translateY(-1px); }
.shelf a span.bk { font-family: var(--serif); font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.shelf a span.ct { font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* Chapter numbers */
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.chapters a {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1; border-radius: var(--r-md);
    border: 1px solid var(--card-edge); background: var(--surface);
    color: var(--ink-soft); text-decoration: none;
    font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
    transition: all .2s ease;
}
.chapters a:hover { border-color: var(--gold); background: var(--gold-wash); color: var(--gold-ink); }

/* Chapter list with titles — the real map of a book */
.chapter-list { display: flex; flex-direction: column; }
.chapter-list a {
    display: grid; grid-template-columns: 46px 1fr; gap: 18px; align-items: baseline;
    padding: 18px 4px; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--card-edge);
    transition: background .2s ease;
}
.chapter-list a:hover { background: var(--gold-wash); }
.chapter-list a:first-child { border-top: 1px solid var(--card-edge); }
.chapter-list .cl-num {
    font-family: var(--serif); font-size: 22px; font-weight: 700;
    color: var(--gold-ink); font-variant-numeric: tabular-nums; line-height: 1;
}
.chapter-list .cl-title { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.012em; }
.chapter-list .cl-intro { font-size: 14.5px; color: var(--ink-muted); line-height: 1.58; margin-top: 5px; }

/* ------------------------------------------------------------- SCRIPTURE */
.verse-block { display: flex; flex-direction: column; gap: 26px; }
.verse-item {
    background: var(--surface); border: 1px solid var(--card-edge);
    border-radius: var(--r-card); padding: 26px 28px;
    box-shadow: var(--lift-subtle);
}
.verse-item .vref {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--gold-ink); text-decoration: none; margin-bottom: 14px;
}
.verse-item .vref:hover { color: var(--gold); }
.verse-item .vtext {
    font-family: var(--serif); font-size: 19.5px; line-height: 1.6; color: var(--ink);
}
.verse-item .vnote { font-size: 14.5px; color: var(--ink-muted); line-height: 1.62; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--card-edge); }

/* --------------------------------------------------------------- TABLE */
.cmp-wrap { overflow-x: auto; margin: 34px 0; border-radius: var(--r-lg); border: 1px solid var(--card-edge); background: var(--surface); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
table.cmp th, table.cmp td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--card-edge); vertical-align: top; }
table.cmp thead th {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em;
    font-weight: 700; color: var(--gold-ink); background: var(--gold-wash);
    border-bottom-color: var(--gold-hair); white-space: nowrap;
}
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp td:first-child { font-weight: 600; color: var(--ink); }
table.cmp .yes { color: var(--sage); font-weight: 600; }
table.cmp .no { color: var(--ink-faint); }

/* ----------------------------------------------------------------- FAQ */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--card-edge); }
.faq details { border-bottom: 1px solid var(--card-edge); }
.faq summary {
    cursor: pointer; list-style: none; padding: 22px 0;
    font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink);
    display: flex; justify-content: space-between; align-items: center; gap: 18px;
    letter-spacing: -0.012em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+'; font-family: var(--sans); font-size: 22px; font-weight: 300;
    color: var(--gold); transition: transform .3s var(--ease); line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 0 24px; font-size: 16px; line-height: 1.7; color: var(--ink-muted); max-width: 660px; }
.faq .faq-body a { color: var(--gold-ink); text-decoration: none; border-bottom: 1px solid var(--gold-hair); }

/* ----------------------------------------------------------- INLINE CTA */
.inline-cta {
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    background: var(--gold-wash); border: 1px solid var(--gold-hair);
    border-radius: var(--r-card); padding: 26px 30px; margin: 48px 0;
}
.inline-cta .ic-key { width: 34px; height: 34px; color: var(--gold); flex: none; }
.inline-cta .ic-text { flex: 1 1 300px; }
.inline-cta h4 { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; margin-bottom: 5px; }
.inline-cta p { font-size: 14.5px; color: var(--ink-muted); line-height: 1.55; }
.inline-cta .btn-gold { padding: 13px 24px; font-size: 14.5px; }

/* ------------------------------------------------------------- PILL ROW */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-row a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: var(--r-full);
    border: 1px solid var(--card-edge); background: var(--surface);
    color: var(--ink-soft); text-decoration: none; font-size: 13.5px; font-weight: 500;
    transition: all .2s ease;
}
.pill-row a:hover { border-color: var(--gold-hair); background: var(--gold-wash); color: var(--gold-ink); }

/* ------------------------------------------------------------ PREV/NEXT */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a {
    display: block; text-decoration: none; color: inherit;
    border: 1px solid var(--card-edge); border-radius: var(--r-lg);
    padding: 18px 22px; background: var(--surface);
    transition: border-color .2s ease, background .2s ease;
}
.pager a:hover { border-color: var(--gold-hair); background: var(--gold-wash); }
.pager .pg-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-faint); font-weight: 700; margin-bottom: 6px; }
.pager .pg-title { font-family: var(--serif); font-size: 17.5px; font-weight: 600; color: var(--ink); }
.pager a.next { text-align: right; }
.pager .spacer { }

/* ------------------------------------------------------------- SECTIONS */
.section--tight { padding: 76px 32px; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(27px, 3.2vw, 38px); margin-bottom: 12px; }
.section-head p { font-size: 16.5px; color: var(--ink-muted); line-height: 1.65; }

.rule-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
    padding-bottom: 14px; border-bottom: 1px solid var(--gold-hair); margin-bottom: 26px;
}
.rule-head h2 { font-size: 24px; letter-spacing: -0.018em; }
.rule-head .rh-meta { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }

/* ------------------------------------------------------------ FACT LIST */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--card-edge); border: 1px solid var(--card-edge); border-radius: var(--r-lg); overflow: hidden; margin: 32px 0; }
.facts div { background: var(--surface); padding: 18px 20px; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.13em; color: var(--gold-ink); font-weight: 700; margin-bottom: 6px; }
.facts dd { font-size: 15px; color: var(--ink); line-height: 1.5; }

/* ----------------------------------------------------------- RESPONSIVE */
@media (max-width: 900px) {
    .tiles--4 { grid-template-columns: repeat(2, 1fr); }
    .tiles--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .page-head { padding: 118px 24px 44px; }
    .section--tight { padding: 56px 24px; }
    .tiles--4, .tiles--3, .tiles--2 { grid-template-columns: 1fr; }
    .shelf { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .prose { font-size: 16.5px; }
    .pager { grid-template-columns: 1fr; }
    .pager a.next { text-align: left; }
    .chapter-list a { grid-template-columns: 36px 1fr; gap: 12px; }
    .inline-cta { padding: 22px; }
}

/* Width modifiers that beat `.page-head .wrap` so a page's heading and its
   body always share the same left edge. */
.page-head .wrap.w-760 { max-width: 760px; }
.page-head .wrap.w-820 { max-width: 820px; }
.page-head .wrap.w-860 { max-width: 860px; }
.page-head .wrap.w-720 { max-width: 720px; }

/* Word study head — the original script, how to say it, what it usually becomes */
.word-line {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    margin: -2px 0 22px;
}
.word-line > * + *::before {
    content: '·'; color: var(--ink-ghost); margin-right: 14px; font-weight: 400;
}
.word-script {
    font-family: var(--serif); font-size: clamp(24px, 3vw, 32px);
    color: var(--gold-ink); font-weight: 600; letter-spacing: 0;
}
.word-say {
    font-size: 14px; color: var(--ink-muted); letter-spacing: 0.06em;
    font-variant: small-caps; font-weight: 600;
}
.word-gloss { font-size: 14.5px; color: var(--ink-faint); font-style: italic; }
