/* =============================================================================
   VerseFlow — Topics (TICKETS 931–934)
   ============================================================================= */

/* ── Shared scaffold ─────────────────────────────────────────────────────── */
.vf-topics-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.vf-topics-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.vf-topics-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-topics-meta {
    font-size: 0.82rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.55));
    letter-spacing: 0.05em;
    margin: 0;
}

/* ── TICKET-931: Search ───────────────────────────────────────────────────── */
.vf-topics-search-wrap {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.vf-topics-search-label {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    text-transform: uppercase;
}

.vf-topics-search {
    width: min(100%, 340px);
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.16));
    border-radius: 24px;
    font-family: var(--font-primary, serif);
    font-size: 0.95rem;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.88));
    background: transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}

.vf-topics-search:focus-visible {
    outline: none;
    border-color: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    box-shadow: 0 0 0 3px rgba(122, 30, 44, 0.12);
}

/* ── A–Z Body ────────────────────────────────────────────────────────────── */
.vf-topics-az-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* .vf-topics-letter-section: toggled hidden by JS during search */

.vf-topics-letter-section[hidden] {
    display: none;
}

.vf-topics-letter-heading {
    font-family: var(--font-primary, serif);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.4));
    margin: 0 0 0.6rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.06));
}

.vf-topics-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vf-topics-card-item[hidden] {
    display: none;
}

.vf-topics-card {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.13));
    border-radius: 20px;
    font-family: var(--font-primary, serif);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.8));
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.vf-topics-card:hover,
.vf-topics-card:focus-visible {
    background: var(--vf-ui-btn-bg, rgba(17, 17, 17, 0.88));
    border-color: transparent;
    color: var(--vf-ui-btn-text, rgba(246, 239, 226, 0.96));
}

.vf-topics-card:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

.vf-topics-card__count {
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0.55;
    letter-spacing: 0.04em;
}

/* ── No results ──────────────────────────────────────────────────────────── */
.vf-topics-no-results {
    text-align: center;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    font-family: var(--font-primary, serif);
    font-size: 0.92rem;
    padding: 2rem 0;
}

/* ── Empty / error state ──────────────────────────────────────────────────── */
.vf-topics-empty,
.vf-topics-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-topics-empty pre,
.vf-topics-not-found pre {
    margin: 1rem auto;
    padding: 0.65rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 0.82rem;
    display: inline-block;
}

/* ── Detail page ─────────────────────────────────────────────────────────── */
.vf-topics-detail-main {
    max-width: 680px;
}

/* Breadcrumb */
.vf-topics-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    font-size: 0.78rem;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
}

.vf-topics-breadcrumb a {
    color: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    text-decoration: none;
}

.vf-topics-breadcrumb a:hover {
    text-decoration: underline;
}

.vf-topics-breadcrumb .sep {
    opacity: 0.4;
}

/* Detail header */
.vf-topics-detail-header {
    margin-bottom: 2rem;
    text-align: center;
}

/* ── Verse block ─────────────────────────────────────────────────────────── */
.vf-topics-verse-area {
    margin-bottom: 2.5rem;
}

.vf-topics-verse-block {
    background: var(--vf-ui-surface, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    padding: 1.75rem 1.5rem 1.5rem;
    margin: 0 0 1.25rem;
    transition: border-color 0.2s;
}

.vf-topics-verse-blockquote {
    margin: 0;
    padding: 0;
    border: none;
}

.vf-topics-verse-text {
    font-family: var(--font-primary, serif);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.75;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.88));
    margin: 0 0 1rem;
    transition: opacity 0.25s;
}

.vf-topics-verse-text--loading {
    opacity: 0.35;
}

.vf-topics-verse-text--placeholder {
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.45));
    font-style: italic;
}

.vf-topics-verse-footer {
    margin: 0;
}

.vf-topics-verse-ref {
    font-family: var(--font-primary, serif);
    font-size: 0.82rem;
    font-style: normal;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.55));
    letter-spacing: 0.04em;
}

.vf-topics-verse-trans {
    margin-left: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    opacity: 0.6;
}

/* ── Action row ──────────────────────────────────────────────────────────── */
.vf-topics-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.vf-topics-another-btn {
    padding: 0.45rem 1.1rem;
    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: none;
    border-radius: 20px;
    font-family: var(--font-primary, serif);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.vf-topics-another-btn:disabled {
    opacity: 0.45;
    cursor: wait;
}

.vf-topics-another-btn:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

.vf-topics-save-btn {
    padding: 0.45rem 1.1rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.16));
    border-radius: 20px;
    background: transparent;
    font-family: var(--font-primary, serif);
    font-size: 0.86rem;
    cursor: pointer;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.8));
    transition: background 0.12s, color 0.12s;
}

.vf-topics-save-btn[aria-pressed="true"] {
    background: var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    color: #fff;
    border-color: transparent;
}

.vf-topics-save-btn:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

.vf-topics-read-link {
    font-size: 0.8rem;
}

/* ── TICKET-934: Related topics ──────────────────────────────────────────── */
.vf-topics-related {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.07));
}

.vf-topics-related__heading {
    font-family: var(--font-primary, serif);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.45));
    margin: 0 0 0.85rem;
}

.vf-topics-related__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.vf-topics-related__link {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.13));
    border-radius: 16px;
    font-family: var(--font-primary, serif);
    font-size: 0.83rem;
    text-decoration: none;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.75));
    transition: background 0.12s, color 0.12s;
}

.vf-topics-related__link:hover,
.vf-topics-related__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-topics-related__link:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

/* ── Atmosphere: Night mode overrides ────────────────────────────────────── */
body.atmosphere-night .vf-topics-verse-block {
    background: rgba(255, 255, 255, 0.02);
}

/* ── TICKET-932: Next Topic CTA ──────────────────────────────────────────── */
.vf-next-topic {
    margin: 3rem 0;
    padding: 2.5rem 1.5rem;
    background: rgba(var(--vf-surface-rgb, 246, 239, 226), 0.4);
    border-radius: 12px;
    border: 1px solid var(--vf-ui-bar-border, rgba(0, 0, 0, 0.08));
    text-align: center;
}

.vf-next-topic__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--vf-ui-muted, rgba(17, 17, 17, 0.5));
    display: block;
    margin-bottom: 0.85rem;
}

.vf-next-topic__heading {
    font-family: var(--font-primary, serif);
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    font-weight: 500;
    margin: 0 0 1.5rem;
    color: var(--vf-ui-text, rgba(17, 17, 17, 0.92));
    letter-spacing: -0.01em;
}

.vf-next-topic__btn {
    display: inline-block;
    padding: 0.85rem 2.25rem;
    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: 28px;
    text-decoration: none;
    font-family: var(--font-primary, serif);
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.vf-next-topic__btn:hover,
.vf-next-topic__btn:focus-visible {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vf-next-topic__btn:focus-visible {
    outline: 2px solid var(--vf-ui-accent, var(--covenant-accent, #7a1e2c));
    outline-offset: 2px;
}

body.atmosphere-night .vf-next-topic {
    background: rgba(255, 255, 255, 0.03);
}

@media screen and (max-width: 480px) {
    .vf-next-topic {
        padding: 2rem 1.25rem;
        margin: 2.5rem 0;
    }
}