/* =============================================================================
   VerseFlow — Inline Context Snippet Styles  (TICKET-928)
   Covering: .vf-context-toggle, .vf-context-panel, .vf-context-list,
             .vf-context-verse, .is-center, .vf-context-read
   ============================================================================= */

/* ── Hidden state — must be display:none per spec ───────────────────────────── */
.vf-context-panel[hidden] {
    display: none;
}

/* ── Toggle button ───────────────────────────────────────────────────────────── */
.vf-context-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.85rem;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.16));
    border-radius: 20px;
    background: transparent;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.68));
    font-family: var(--font-primary, 'Lora', serif);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.vf-context-toggle::before {
    content: "📖";
    font-size: 0.85em;
    line-height: 1;
}

.vf-context-toggle:hover {
    background: var(--vf-ui-card-bg, rgba(0, 0, 0, 0.04));
    border-color: var(--vf-ui-bar-border, rgba(0, 0, 0, 0.28));
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.88));
}

.vf-context-toggle:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

/* Atmosphere overrides — dark context */
.guidance-spoke-layout .vf-context-toggle,
body.atmosphere-night .vf-context-toggle {
    color: rgba(246, 239, 226, 0.6);
    border-color: rgba(246, 239, 226, 0.2);
}

.guidance-spoke-layout .vf-context-toggle:hover,
body.atmosphere-night .vf-context-toggle:hover {
    background: rgba(246, 239, 226, 0.06);
    color: rgba(246, 239, 226, 0.85);
    border-color: rgba(246, 239, 226, 0.35);
}

/* ── Context panel ───────────────────────────────────────────────────────────── */
.vf-context-panel {
    width: min(100%, 56rem);
    max-width: 100%;
    margin-top: 0.5rem;
    margin-inline: auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.09));
    background: var(--vf-ui-card-bg, rgba(255, 255, 255, 0.55));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.atmosphere-night .vf-context-panel,
.guidance-spoke-layout .vf-context-panel {
    background: rgba(18, 18, 32, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── Verse list ──────────────────────────────────────────────────────────────── */
.vf-context-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ── Individual verse row ────────────────────────────────────────────────────── */
.vf-context-verse {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 1rem;
    line-height: 1.5;
    transition: background 0.15s;
}

.vf-context-verse:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.atmosphere-night .vf-context-verse:hover,
.guidance-spoke-layout .vf-context-verse:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Verse number */
.vf-context-verse__num {
    flex-shrink: 0;
    min-width: 1.8rem;
    font-family: var(--font-secondary, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.45));
    text-align: right;
    user-select: none;
}

/* Verse text */
.vf-context-verse__text {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-primary, 'Lora', serif);
    font-size: 0.88rem;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.8));
    overflow-wrap: anywhere;
}

body.atmosphere-night .vf-context-verse__text,
.guidance-spoke-layout .vf-context-verse__text {
    color: rgba(246, 239, 226, 0.75);
}

/* ── Central (highlighted) verse ──────────────────────────────────────────────── */
.vf-context-verse.is-center {
    background: var(--vf-ctx-center-bg, rgba(201, 167, 93, 0.12));
    border-left: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    padding-left: calc(1rem - 2px);
    /* offset for the border */
}

.vf-context-verse.is-center .vf-context-verse__num {
    color: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    font-weight: 700;
}

.vf-context-verse.is-center .vf-context-verse__text {
    font-weight: 500;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.92));
}

body.atmosphere-night .vf-context-verse.is-center,
.guidance-spoke-layout .vf-context-verse.is-center {
    background: rgba(201, 167, 93, 0.1);
    border-color: rgba(201, 167, 93, 0.65);
}

body.atmosphere-night .vf-context-verse.is-center .vf-context-verse__text,
.guidance-spoke-layout .vf-context-verse.is-center .vf-context-verse__text {
    color: rgba(246, 239, 226, 0.95);
}

/* ── Loading placeholder ──────────────────────────────────────────────────────── */
.vf-context-loading {
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    font-style: italic;
    font-family: var(--font-primary, serif);
}

/* ── Status / error line ──────────────────────────────────────────────────────── */
.vf-context-status {
    margin: 0;
    padding: 0.3rem 1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.55));
    min-height: 1rem;
}

/* ── Read full chapter CTA ────────────────────────────────────────────────────── */
.vf-context-read {
    display: block;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.07));
    font-family: var(--font-primary, serif);
    font-size: 0.8rem;
    color: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: background 0.15s;
}

.vf-context-read:hover,
.vf-context-read:focus-visible {
    background: var(--vf-ui-card-bg, rgba(0, 0, 0, 0.03));
    text-decoration: underline;
}

.vf-context-read:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: -2px;
}

body.atmosphere-night .vf-context-read,
.guidance-spoke-layout .vf-context-read {
    color: rgba(201, 167, 93, 0.9);
    border-color: rgba(255, 255, 255, 0.07);
}

body.atmosphere-night .vf-context-read:hover,
.guidance-spoke-layout .vf-context-read:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ── Reduced motion ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    .vf-context-toggle,
    .vf-context-verse,
    .vf-context-read {
        transition: none;
    }
}
