/* Shared by the pages that have a folder of their own — /line/, /scrolls/,
   /scripture/, /talks/. The tokens, the top bar, the scripture card and the
   dialog shell live here; each page's own stylesheet adds only what is its own.
   (/fallen-angels/ predates this file and keeps its own complete stylesheet.) */
:root {
    --bg: #0a0a0a;
    --surface: #161616;
    --surface2: #1d1a14;
    --border: rgba(255, 174, 0, 0.18);
    --border-strong: rgba(255, 174, 0, 0.42);
    --gold: #ffae00;
    --gold-soft: rgba(255, 174, 0, 0.12);
    --text: #f2e8d0;
    --muted: #b9ae95;
    --faint: #7d7461;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', system-ui, sans-serif;
    --scripture: 'EB Garamond', Georgia, serif;
}
:lang(ka) {
    --serif: 'Noto Serif Georgian', 'Playfair Display', serif;
    --sans: 'Noto Sans Georgian', 'Inter', sans-serif;
    --scripture: 'Noto Serif Georgian', 'EB Garamond', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: radial-gradient(1200px 600px at 50% -200px, #211a0d 0%, var(--bg) 60%) fixed, var(--bg);
    color: var(--text);
    font: 16px/1.6 var(--sans);
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }

.bar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px max(16px, env(safe-area-inset-left));
    background: rgba(10, 10, 10, 0.82); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.home { flex: 0 0 auto; white-space: nowrap; font: 600 14px var(--sans); color: var(--muted); }
/* Ten language buttons are wider than a phone: the row scrolls sideways inside
   the bar rather than widening the whole page (it made every page 600px wide). */
.langs { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.langs::-webkit-scrollbar { display: none; }
.langs button {
    flex: 0 0 auto;
    background: transparent; border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 11px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.langs button.on { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

main { max-width: 900px; margin: 0 auto; padding: 24px 16px 80px; }
.loading { text-align: center; color: var(--faint); padding: 80px 0; }
.noscript { text-align: center; color: var(--muted); }


/* ---- head ---- */
.eyebrow { color: var(--gold); font: 600 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
:lang(ka) .eyebrow, :lang(ru) .eyebrow { letter-spacing: .08em; text-transform: none; }
h1 { font: 700 clamp(30px, 7vw, 46px)/1.1 var(--serif); margin: 10px 0 14px; }
.intro { color: var(--muted); max-width: 62ch; }
.count { color: var(--gold); font: 600 14px var(--sans); margin-top: 10px; }

/* ---- a passage of Scripture, quoted ---- */
h3.sec { font: 600 12px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 22px 0 8px; }
:lang(ka) h3.sec, :lang(ru) h3.sec { letter-spacing: .06em; text-transform: none; }
.passage { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.passage .ref { color: var(--gold); font: 600 13px var(--sans); }
.passage .src { color: var(--faint); font-size: 11.5px; margin-inline-start: 6px; }
.passage p { font: 400 17px/1.65 var(--scripture); margin: 8px 0 0; color: #e9e0c8; }
.passage .v { color: var(--faint); font: 600 11px var(--sans); vertical-align: 2px; margin-inline-end: 4px; }
.passage mark { background: rgba(255, 174, 0, .2); color: #ffe7b0; border-radius: 3px; padding: 0 2px; }
.passage .onote { color: var(--faint); font-size: 12px; margin-top: 8px; }

.credit { color: var(--faint); font-size: 12.5px; margin-top: 34px; border-top: 1px solid var(--border); padding-top: 14px; }
.credit p { margin: 6px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; margin-top: 7px; }

/* ---- the dialog a card opens into (/line/, /talks/) ---- */
.overlay {
    position: fixed; inset: 0; z-index: 20; overflow-y: auto;
    background: rgba(5, 5, 5, .9); backdrop-filter: blur(6px);
    padding: 20px 14px 60px;
}
.overlay[hidden] { display: none; }
.sheet { max-width: 640px; margin: 0 auto; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 20px; padding: 20px; }
.sheet .close { float: right; background: transparent; border: 1px solid var(--border); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; color: var(--muted); }
.sheet .close:hover { border-color: var(--gold); color: var(--gold); }
.clear { clear: both; }

/* ---- right to left (ar, he) ----
   The page mirrors, but a passage quoted in English does not: it carries
   dir="ltr" of its own, set where it is built, so verse numbers and
   punctuation stay on the correct side of the English words. */
[dir="rtl"] .eyebrow,
[dir="rtl"] h3.sec { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .passage[dir="ltr"] { text-align: left; }
/* A reference is Latin even on an Arabic page: "1 Enoch 1:9" must not be
   reordered to "Enoch 1:9 1" by the surrounding right-to-left run. */
[dir="rtl"] .ref,
[dir="rtl"] .cite,
[dir="rtl"] .refs,
[dir="rtl"] .phrases,
[dir="rtl"] .src { direction: ltr; text-align: left; }
[dir="rtl"] .refs .kind { direction: rtl; }
/* Floats are physical; mirror the two the dialog uses. */
[dir="rtl"] .sheet .close { float: left; }
[dir="rtl"] .credit { text-align: right; }
