/* ═══════════════════════════════════════════════════════════
   OpenPsalm — Premium Dark Theme v0.2
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0c0e14;
    --bg-card: #13161f;
    --bg-card-hover: #1a1e2b;
    --bg-surface: #1a1e2b;
    --bg-input: #0f1118;

    --text-primary: #e8eaf0;
    --text-secondary: #8b90a0;
    --text-muted: #5a5f72;

    --accent: #7c6df0;
    --accent-light: #9d91f7;
    --accent-glow: rgba(124, 109, 240, 0.25);
    --accent-gradient: linear-gradient(135deg, #7c6df0 0%, #b362e0 100%);

    --gold: #e8b849;
    --green: #4ade80;
    --blue: #60a5fa;
    --rose: #f472b6;
    --orange: #fb923c;
    --red: #ef4444;

    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(124, 109, 240, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.hidden { display: none !important; }

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Links ──────────────────────────────────────────────── */

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:visited {
    color: var(--accent);
}

a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
    position: relative;
    text-align: center;
    padding: 2.5rem 1.5rem 1rem;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 350px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.brand {
    font-family: 'Inter', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    font-weight: 300;
    letter-spacing: 0.04em;
}

/* ── Top Nav ─────────────────────────────────────────────── */

.top-nav {
    position: relative;
    z-index: 2;
    margin-top: 1rem;
}

.nav-items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.nav-btn-accent {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
}

.nav-btn-accent:hover {
    opacity: 0.9;
}

.nav-btn-outline {
    background: transparent;
    color: var(--text-muted);
}

.nav-user {
    font-size: 0.82rem;
    color: var(--accent-light);
    font-weight: 500;
    padding: 0 0.4rem;
}

/* ── Main ────────────────────────────────────────────────── */

main {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    width: 100%;
}

/* ── Page Heading ────────────────────────────────────────── */

.welcome-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.welcome-banner h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.welcome-banner p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

.page-heading {
    margin-bottom: 1.5rem;
}

.page-heading h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.page-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* ── Loading ─────────────────────────────────────────────── */

.loading {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Song Grid (Catalog) ────────────────────────────────── */

.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.song-card-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    animation: fadeUp 0.4s ease-out;
}

.song-card-mini:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.song-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.song-card-sub {
    font-style: italic;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.song-card-attr {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.meta-row-mini {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.meta-badge-sm {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.2rem 0.6rem;
}

/* ── Song List (Catalog) ────────────────────────────────── */

.catalog-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.catalog-search {
    flex: 1;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.catalog-search::placeholder {
    color: var(--text-muted);
}

.catalog-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.song-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.song-row {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.song-row:last-child {
    border-bottom: none;
}

.song-row:hover {
    background: var(--bg-surface);
}

.song-row-title {
    font-weight: 600;
    font-size: 1rem;
}

.song-row-sub {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.song-row-meta {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Song Card (Detail) ─────────────────────────────────── */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-back {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.4rem 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.song-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: fadeUp 0.6s ease-out;
}

.song-header {
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(124, 109, 240, 0.06) 0%, transparent 100%);
}

.song-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.2rem;
}

.song-subtitle {
    font-family: 'Inter', sans-serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.song-attr {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.song-attr-list {
    margin: 0.35rem 0 0 1.1rem;
    padding: 0;
}

.song-attr-list li {
    margin: 0.15rem 0;
}

.meta-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s;
}

.meta-badge:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.meta-badge .icon {
    font-size: 0.95rem;
}

/* ── Verses ──────────────────────────────────────────────── */

.song-body {
    padding: 2rem 2.5rem;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-light);
    margin-bottom: 1rem;
}

/* ── Lyrics Preview ───────────────────────────────────────── */

#lyrics-display {
    padding: 4rem 2.5rem;
    background: var(--bg-card);
    display: flex;
    justify-content: center;
}

.lyrics-section {
    max-width: 580px;
    width: 100%;
}

.lyric-verse {
    margin-bottom: 3.5rem;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.7;
    font-weight: 500;
    color: var(--text-primary);
}

.lyric-verse:last-child {
    margin-bottom: 1.5rem;
}

.lyric-verse strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-light);
    margin-bottom: 1rem;
}

.lyric-refrain {
    margin: 3.5rem 0 1.5rem;
    padding: 2.2rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-style: italic;
    font-size: 1.15rem;
    font-weight: 400;
    text-align: center;
    background: rgba(124, 109, 240, 0.02);
    color: var(--text-secondary);
}

.lyric-refrain strong {
    display: block;
    font-style: normal;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* ── PDF Sheet Music Viewer ──────────────────────────────── */

.pdf-container {
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    min-height: 2.5rem;
}

.pdf-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.btn-view-pdf,
.btn-dl-pdf {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-dl-pdf {
    margin-left: auto;
}

.btn-view-pdf:hover,
.btn-dl-pdf:hover {
    opacity: 0.85;
}

.pdf-iframe {
    display: block;
    width: 100%;
    height: 700px;
    border: none;
    background: #fff;
}

.pdf-error {
    padding: 1.5rem;
    color: var(--red);
    font-size: 0.9rem;
    background: var(--bg-card);
}

.filter-columns {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.filter-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 110px;
}

.filter-col-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.filter-option-lbl {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Tooltip styling */
.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 10px;
    font-weight: bold;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    border-radius: 50%;
    cursor: help;
    margin-left: 2px;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 240px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    text-align: left;
    border-radius: var(--radius-sm);
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: normal;
    line-height: 1.5;
    white-space: normal;
    pointer-events: none;
}

/* A bridge to allow moving mouse to the tooltip */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.tooltip .tooltiptext a {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Tooltip arrow */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--bg-card) transparent transparent transparent;
}

.option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.filter-actions {
    margin-bottom: 1rem;
}

.mp3-section {
    margin-bottom: 1rem;
}

.mp3-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.mp3-player {
    width: 100%;
}

.mp3-error {
    font-size: 0.82rem;
    color: var(--rose, #f87171);
}

.btn-play-mp3 {
    background: var(--bg-surface);
    border-color: var(--green, #4ade80);
    color: var(--green, #4ade80);
}

.btn-play-mp3:hover {
    background: rgba(74, 222, 128, 0.1);
}

.pdf-toolbar-top {
    margin-bottom: 0.5rem;
}

.export-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-style: italic;
}

.verses-list {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.verse-item {
    padding: 0.4rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── Export Buttons ───────────────────────────────────────── */

.btn-export {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
    width: 100%;
}

.btn-export:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-export:active {
    transform: translateY(0);
}

.btn-export:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.btn-export .btn-icon {
    font-size: 1.1rem;
}

.btn-export.musicxml {
    border-left: 3px solid var(--blue);
}

.btn-export.midi {
    border-left: 3px solid var(--green);
}

.btn-export.mp3 {
    border-left: 3px solid var(--gold);
}

.btn-export.lilypond {
    border-left: 3px solid var(--rose);
}

.btn-export.pdf {
    border-left: 3px solid var(--red);
}

.btn-export.presentation {
    border-left: 3px solid var(--accent);
}

.btn-export .format-tag {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.2rem;
}

.btn-export.musicxml .format-tag {
    background: rgba(96, 165, 250, 0.15);
    color: var(--blue);
}

.btn-export.pdf .format-tag {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.btn-export.midi .format-tag {
    background: rgba(74, 222, 128, 0.15);
    color: var(--green);
}

.btn-export.mp3 .format-tag {
    background: rgba(232, 184, 73, 0.15);
    color: var(--gold);
}

.btn-export.lilypond .format-tag {
    background: rgba(244, 114, 182, 0.15);
    color: var(--rose);
}

.btn-export.presentation .format-tag {
    background: rgba(124, 109, 240, 0.15);
    color: var(--accent);
}

.btn-export.powerpoint {
    border-left: 3px solid var(--orange);
}

.btn-export.powerpoint .format-tag {
    background: rgba(251, 146, 60, 0.15);
    color: var(--orange);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn-sm {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

/* ── Empty / Error States ────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--rose);
}

.error-state h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* ── Toast ───────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--green);
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
}

/* ── Footer ──────────────────────────────────────────────── */

footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--text-secondary);
    text-decoration: underline;
}

footer a:visited {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--text-primary);
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
    .brand {
        font-size: 2rem;
    }

    .song-header,
    .song-body,
    .song-commentary-section {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .song-title {
        font-size: 1.5rem;
    }

    .meta-row {
        gap: 0.6rem;
    }

    .btn-export {
        justify-content: center;
    }

    .song-grid {
        grid-template-columns: 1fr;
    }

    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-image-right {
        float: none;
        width: 100%;
        margin: 0 0 1.5rem 0;
    }
}

/* ── Static pages (About, Contact) ─────────────────────── */
ol.aligned-list {
    list-style-position: inside;
    padding-left: 0;
}

.static-page {
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.75;
    color: var(--text-secondary);
}

.static-page h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
}

.static-page p {
    margin: 0 0 1.1rem;
}

.static-page h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.8rem 0 0.6rem;
}

.static-page a {
    color: var(--accent-light);
    text-decoration: underline;
    transition: color 0.15s;
}

.static-page a:visited {
    color: var(--accent);
}

.static-page a:hover {
    color: var(--text-primary);
}

/* ── Blog ─────────────────────────────────────────────── */

.blog-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.blog-list .page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.blog-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.blog-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.blog-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.blog-card-meta {
    display: flex;
    gap: 1.2rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
}

.blog-card-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.blog-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

.blog-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.blog-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    gap: 1.2rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.blog-content {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.blog-image-right {
    float: right;
    width: 320px;
    margin: 0 0 1.5rem 2rem;
    max-width: 100%;
}

.blog-caption {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.75rem;
    font-style: italic;
    line-height: 1.4;
}

.blog-content p {
    margin: 0 0 1.2rem;
}

.blog-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.8rem;
}

.blog-content ul {
    margin: 0 0 1.2rem;
    padding-left: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.6rem;
    line-height: 1.65;
}

.blog-content em {
    color: var(--text-secondary);
}

.blog-content strong {
    color: var(--accent-light);
    font-weight: 600;
}

/* ── Song Commentary ─────────────────────────────────────── */

.song-commentary-section {
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border);
}

.commentary-content {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ── Library page ────────────────────────────────────────── */

.library-jump {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.6rem 0.4rem;
    margin: 0 -0.4rem 1.5rem;
    background: var(--bg-primary, #14151c);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.library-jump a,
.library-jump-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    padding: 0.25rem 0.45rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
}

.library-jump a {
    color: var(--accent-light);
}

.library-jump a:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.library-jump-disabled {
    color: var(--text-secondary);
    opacity: 0.35;
    cursor: default;
}

.library-section {
    margin-bottom: 2.25rem;
    scroll-margin-top: 4rem;
}

.library-letter {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-light);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    margin-bottom: 0.85rem;
}

.library-list {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 3;
    column-gap: 2rem;
}

.library-list li {
    break-inside: avoid;
    line-height: 1.25;
    margin-bottom: 0.7rem;
}

.library-list a {
    text-decoration: none;
}

.library-list a:hover {
    text-decoration: underline;
}

.library-subtitle {
    color: var(--text-secondary);
    font-size: 0.88em;
    margin-left: 0.35rem;
}

@media (max-width: 900px) {
    .library-list { column-count: 2; }
}

@media (max-width: 560px) {
    .library-list { column-count: 1; }
    .library-jump a,
    .library-jump-disabled {
        min-width: 1.6rem;
        font-size: 0.85rem;
        padding: 0.2rem 0.3rem;
    }
}
