/* Share pages: one verse and its references. Served beside the reader's assets. */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/source-serif-4-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --head: #f9f6ef;
    --text: #161514;
    --muted: #65676b;
    --primary: #2a5b8f;
    --accent: #8a6508;
    --ref-c1: #0061a1;
    --ref-c2: #974200;
    --ref-c3: #006d50;
    --ref-c4: #7b0d8f;
    --ui: 'Inter', system-ui, sans-serif;
    --serif: 'Source Serif 4', Georgia, serif;
    --head-h: 140px; /* set by share.js from the sticky header's real height */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--ui);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding: 20px 10px 50px;
}

.card {
    max-width: 650px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- Top bar: site and language --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    background: var(--head);
    border-bottom: 1px solid rgba(184, 134, 11, 0.16);
    border-radius: 12px 12px 0 0;
}
.site { font-size: 0.8rem; font-weight: 600; color: var(--text); text-decoration: none; }
.langs { display: flex; gap: 2px; font-size: 0.75rem; }
.langs a, .langs span { padding: 4px 8px; border-radius: 12px; color: var(--primary); text-decoration: none; }
.langs a:hover { background: rgba(42, 91, 143, 0.08); }
.langs [aria-current] { background: var(--primary); color: #ffffff; font-weight: 600; }

/* --- The verse (sticky) --- */
.verse-head {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 20px 25px 12px;
    background: var(--head);
    text-align: center;
}
h1 { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: normal; }
.kicker { font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.ref { font-family: var(--serif); font-size: 1.5rem; }
.verse { font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; }

.verse-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 25px 20px;
    background: var(--head);
    border-bottom: 1px solid #e8dfd0;
    text-align: center;
}
.hint { font-size: 0.75rem; color: var(--muted); }
.context { font-size: 0.8rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.context:hover { text-decoration: underline; }

/* --- Anchors in the verse --- */
.c1 { --c: var(--ref-c1); }
.c2 { --c: var(--ref-c2); }
.c3 { --c: var(--ref-c3); }
.c4 { --c: var(--ref-c4); }

.a {
    color: var(--c, var(--muted));
    cursor: pointer;
    text-decoration: underline 1px color-mix(in srgb, currentColor 25%, transparent);
    text-underline-offset: 3px;
}
.a:hover, .a:focus-visible { background: rgba(0, 0, 0, 0.05); text-decoration-color: currentColor; outline: none; }
.a.m { text-decoration-style: double; }

/* --- Reference groups --- */
.group { border-bottom: 1px solid #f0f0f0; }

.group-head {
    position: sticky;
    top: var(--head-h);
    z-index: 90;
    padding: 12px 25px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c, var(--muted));
    border-left: 5px solid var(--c, transparent);
    background: color-mix(in srgb, var(--c, #9a9a9a) 5%, #ffffff);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.kjv { font-weight: 400; margin-right: 0.35em; opacity: 0.75; }
.kjv-note { font-weight: 400; font-size: 0.8rem; margin-left: 0.5em; color: var(--muted); }

.refs { list-style: none; }
.refs li { padding: 16px 25px; border-bottom: 1px dashed #eeeeee; }
.refs li:last-child { border-bottom: none; }

.cite { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.cite:hover { text-decoration: underline; }

.rt { font-family: var(--serif); font-size: 1rem; color: #333333; }
.rt sup { font-family: var(--ui); font-size: 0.65em; color: var(--muted); margin-right: 2px; }
.gap { color: var(--muted); }
.rest, .more-less { display: none; }
.rt.open .rest, .rt.open .more-less { display: inline; }
.rt.open .more-n { display: none; }
.more { background: none; border: none; padding: 0; color: var(--primary); font: 600 0.85rem var(--ui); cursor: pointer; }
.more:hover { text-decoration: underline; }

.empty { padding: 40px; text-align: center; color: var(--muted); font-style: italic; }

/* --- Footer --- */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 24px 32px;
    background: #fafafa;
    border-top: 1px solid #eeeeee;
    border-radius: 0 0 12px 12px;
    text-align: center;
}
.cta {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}
.cta:hover { background: #1e4570; }
.note { max-width: 320px; font-size: 0.8rem; color: var(--muted); }
.rule { width: 48px; border-top: 1px solid #dddddd; }
.data { max-width: 340px; font-size: 0.75rem; color: var(--muted); }
.data a { color: var(--primary); }
.tag { font-size: 0.75rem; color: #767676; }

@media (max-width: 600px) {
    body { padding: 0; background: #ffffff; }
    .card { border-radius: 0; box-shadow: none; border: none; }
    .topbar, footer { border-radius: 0; }
    .topbar, .verse-head, .verse-foot, .group-head, .refs li { padding-left: 20px; padding-right: 20px; }
}

/* Too little room for sticky parts: let everything scroll. */
@media (max-height: 500px), (max-width: 320px) {
    .verse-head, .group-head { position: static; }
}
