/* =============================================================================
   VerseFlow — Bible Reader  (TICKET-922)
   ============================================================================= */

/* ── Page scaffold ────────────────────────────────────────────────────────── */
.vf-reader-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* ── Reader header ────────────────────────────────────────────────────────── */
.vf-reader-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.vf-reader-heading {
    font-family: var(--font-primary, serif);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 500;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.92));
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

.vf-reader-meta {
    font-size: 0.82rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.55));
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Translation switcher ─────────────────────────────────────────────────── */
.vf-reader-trans-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.vf-reader-trans-link {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.16));
    border-radius: 16px;
    font-family: var(--font-primary, serif);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.82));
    transition: background 0.15s, color 0.15s;
}

.vf-reader-trans-link:hover,
.vf-reader-trans-link:focus-visible {
    background: var(--vf-ui-btn-bg, rgba(17, 17, 17, 0.88));
    color: var(--vf-ui-btn-text, rgba(246, 239, 226, 0.96));
    border-color: transparent;
}

.vf-reader-trans-link[aria-current="true"],
.vf-reader-trans-link.is-current {
    background: var(--vf-ui-btn-bg, rgba(17, 17, 17, 0.88));
    color: var(--vf-ui-btn-text, rgba(246, 239, 226, 0.96));
    border-color: transparent;
}

.vf-reader-trans-link:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

/* ── Verse list ───────────────────────────────────────────────────────────── */
.vf-reader-verses {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: verse-counter;
}

.vf-reader-verse {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    column-gap: 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.05));
    scroll-margin-top: 5rem;
    /* account for sticky header */
    transition: background 0.25s;
}

.vf-reader-verse:last-child {
    border-bottom: none;
}

/* Verse number */
.vf-reader-verse__num {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.4));
    letter-spacing: 0.04em;
    text-align: right;
    align-self: start;
    padding-top: 0.3rem;
    user-select: none;
}

/* Verse text */
.vf-reader-verse__text {
    font-family: var(--font-primary, serif);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.88));
}

/* ── Highlight ────────────────────────────────────────────────────────────── */
.vf-verse-highlight {
    background: rgba(var(--vf-highlight-rgb, 210, 180, 100), 0.18);
    border-radius: 4px;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

/* Night mode: softer highlight */
body.atmosphere-night .vf-verse-highlight {
    background: rgba(255, 215, 80, 0.12);
}

/* ── Error / not found ────────────────────────────────────────────────────── */
.vf-reader-not-found {
    text-align: center;
    padding: 4rem 2rem;
    font-family: var(--font-primary, serif);
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.6));
}

.vf-reader-not-found h2 {
    font-size: 1.3rem;
    margin: 0 0 0.75rem;
}

.vf-reader-not-found p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ── "Read in context" link (sitewide) ───────────────────────────────────── */
.vf-read-context {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-primary, serif);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.vf-read-context:hover,
.vf-read-context:focus-visible {
    opacity: 1;
    text-decoration: underline;
}

.vf-read-context:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Small arrow prefix */
.vf-read-context::before {
    content: "↗";
    font-size: 0.75em;
}

/* Context: inside VOTD save row */
.votd-save-row .vf-read-context {
    margin-left: 0.75rem;
}

/* ── TICKET-924: Chapter navigation bar ──────────────────────────────────── */
.vf-reader-chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 1rem 0;
    border-top: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.08));
}

.vf-reader-nav-link {
    font-family: var(--font-primary, serif);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    opacity: 0.85;
    transition: opacity 0.15s;
    flex: 1;
}

.vf-reader-nav-prev {
    text-align: left;
}

.vf-reader-nav-index {
    text-align: center;
    opacity: 0.55;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex: 0 1 auto;
}

.vf-reader-nav-next {
    text-align: right;
}

.vf-reader-nav-link:hover,
.vf-reader-nav-link:focus-visible {
    opacity: 1;
    text-decoration: underline;
}

.vf-reader-nav-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

.vf-reader-nav-link.vf-reader-nav--disabled {
    pointer-events: none;
    text-decoration: none;
    opacity: 0;
}

/* ── TICKET-924: /read/ Index page ───────────────────────────────────────── */
.vf-reader-index-trans-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
}

.vf-reader-index-trans-btn {
    padding: 0.25rem 0.85rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.16));
    border-radius: 16px;
    background: transparent;
    font-family: var(--font-primary, serif);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.82));
    transition: background 0.15s, color 0.15s;
}

.vf-reader-index-trans-btn.is-active,
.vf-reader-index-trans-btn[aria-pressed="true"] {
    background: var(--vf-ui-btn-bg, rgba(17, 17, 17, 0.88));
    color: var(--vf-ui-btn-text, rgba(246, 239, 226, 0.96));
    border-color: transparent;
}

.vf-reader-index-trans-btn:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

.vf-reader-index-body {
    margin-top: 2rem;
}

.vf-reader-index-section {
    margin-bottom: 2.5rem;
}

.vf-reader-index-heading {
    font-family: var(--font-primary, serif);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    margin: 0 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.08));
}

.vf-reader-index-booklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.25rem;
}

.vf-reader-index-book {
    min-width: 0;
}

.vf-reader-index-details {
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.08));
    border-radius: 6px;
    overflow: hidden;
}

.vf-reader-index-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-primary, serif);
    font-size: 0.9rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.12s;
}

.vf-reader-index-summary::-webkit-details-marker {
    display: none;
}

.vf-reader-index-summary:hover,
.vf-reader-index-details[open] .vf-reader-index-summary {
    background: var(--vf-ui-bar-border, rgba(0, 0, 0, 0.04));
}

.vf-reader-index-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.4));
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.vf-reader-index-chapters {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0.35rem 0.5rem 0.5rem;
    list-style: none;
    margin: 0;
    border-top: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.06));
    background: rgba(0, 0, 0, 0.02);
}

.vf-reader-index-chapter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.9rem;
    border-radius: 4px;
    font-family: var(--font-primary, serif);
    font-size: 0.78rem;
    text-decoration: none;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.75));
    transition: background 0.1s, color 0.1s;
}

.vf-reader-index-chapter-link:hover,
.vf-reader-index-chapter-link:focus-visible {
    background: var(--vf-ui-btn-bg, rgba(17, 17, 17, 0.88));
    color: var(--vf-ui-btn-text, rgba(246, 239, 226, 0.96));
}

.vf-reader-index-chapter-link:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 1px;
}

/* ── TICKET-927: Chapter Context Blurb ───────────────────────────────────── */
.vf-chapter-context {
    margin: 0 0 2.5rem;
    padding: 1.25rem 1.5rem;
    background: rgba(var(--vf-surface-rgb, 246, 239, 226), 0.4);
    border-left: 3px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    border-radius: 4px;
}

.vf-chapter-context__content {
    font-family: var(--font-primary, serif);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.72));
    font-style: italic;
}

/* Night mode override */
body.atmosphere-night .vf-chapter-context {
    background: rgba(255, 255, 255, 0.04);
}

body.atmosphere-night .vf-chapter-context__content {
    color: rgba(255, 255, 255, 0.7);
}

@media screen and (max-width: 480px) {
    .vf-chapter-context {
        padding: 1rem 1.15rem;
        margin-bottom: 2rem;
    }

    .vf-chapter-context__content {
        font-size: 0.9rem;
    }
}

/* ── TICKET-931: Reading History (Resume Reading) ────────────────────────── */
.vf-resume-reading {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: rgba(var(--vf-surface-rgb, 246, 239, 226), 0.3);
    border-radius: 8px;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.08));
}

.vf-resume-list {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.vf-resume-item {
    display: flex;
    align-items: center;
}

.vf-resume-link {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.16));
    border-radius: 6px;
    text-decoration: none;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.85));
    font-family: var(--font-primary, serif);
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vf-resume-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.vf-resume-link__meta {
    display: block;
    font-size: 0.7rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.vf-resume-actions {
    display: flex;
    justify-content: flex-end;
}

.vf-resume-clear {
    background: transparent;
    border: none;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.4));
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: underline;
}

.vf-resume-clear:hover {
    color: var(--covenant-accent, #7a1e2c);
}

body.atmosphere-night .vf-resume-reading {
    background: rgba(255, 255, 255, 0.03);
}

body.atmosphere-night .vf-resume-link {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── TICKET-930: Scroll Progress + Continuation Blocks ───────────────────── */
.vf-scroll-indicator {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.vf-scroll-indicator__bar {
    height: 100%;
    background: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    width: 0%;
    transition: width 0.3s ease-out;
}

.vf-scroll-indicator__text {
    position: fixed;
    top: 0.75rem;
    right: 1.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
    background: rgba(var(--vf-surface-rgb, 246, 239, 226), 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    z-index: 101;
}

.vf-progress-block {
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(var(--vf-surface-rgb, 246, 239, 226), 0.5);
    border: 1px dashed var(--vf-ui-bar-border, rgba(0, 0, 0, 0.15));
    border-radius: 12px;
    text-align: center;
}

.vf-progress-block__text {
    font-family: var(--font-primary, serif);
    font-size: 0.95rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.6));
    margin-bottom: 1.25rem;
}

.vf-progress-block__btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--vf-ui-btn-bg, rgba(17, 17, 17, 0.88));
    color: var(--vf-ui-btn-text, rgba(246, 239, 226, 0.96));
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
}

.vf-progress-block__btn:hover {
    background: #000;
    transform: translateY(-1px);
}

body.atmosphere-night .vf-scroll-indicator {
    background: rgba(255, 255, 255, 0.1);
}

body.atmosphere-night .vf-scroll-indicator__text {
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.6);
}

body.atmosphere-night .vf-progress-block {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

@media screen and (max-width: 768px) {
    .vf-scroll-indicator__text {
        display: none;
        /* Hide text on small screens to save space */
    }
}