/* ============================================
   WORDS PAGE STYLES
   Extracted from styles.css for modular loading
   ============================================ */

/* Phase 3.9: WCAG AA contrast fix.
   --cream (#ECE8DC) on --cream (#ECE8DC) fails contrast (1:1).
   Switching body background to --cream-light (#F9F3E7) and text to --ink (#332E2A)
   gives approximately 14:1 contrast (passes AAA). */
[data-theme="words"] body {
    background-color: var(--cream-light);
    color: var(--ink);
}

/* Words page — cream Get in Touch button */
.words-page .btn-contact.nav-contact {
    background: var(--color-cream);
    color: var(--color-charcoal);
}

.words-page .btn-contact.nav-contact:hover {
    background: #e8dcc8;
    transform: translateY(-2px);
}

/* Hero — Full-bleed photo with centered overlay */
.words-hero {
    position: relative;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1916;
}

.words-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.35) 100%);
    z-index: 1;
}

/* Content — centered over photo */
.words-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 700px;
    padding: 6rem 2rem 4rem;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.words-hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.words-hero p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    max-width: 420px;
    text-align: center;
}

/* Hero photo — full bleed behind content */
.words-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* Hero link buttons */
.words-hero-links .words-btn-secondary {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.3) !important;
}

/* Fades */
.words-hero-fade,
.words-hero-fade-bottom {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .words-hero {
        min-height: 60vh;
    }

    .words-hero-content {
        padding: 4rem 1.5rem 3rem;
    }

    .words-hero h1 {
        font-size: 2.4rem;
    }
}

/* Tab Navigation */
.words-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    border-bottom: 1px solid rgba(96, 108, 89, 0.15);
}

.words-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: rgba(51, 46, 42, 0.6);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.words-tab:hover {
    color: var(--color-charcoal);
}

.words-tab.active {
    color: var(--color-green);
}

.words-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-green);
}

/* Tab Content */
.words-tab-content {
    display: none;
    padding: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.words-tab-content.active {
    display: block;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.words-search-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
}

.search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: rgba(51, 46, 42, 0.35);
    font-size: 0.85rem;
    pointer-events: none;
}

#words-search {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border: 1px solid rgba(51, 46, 42, 0.12);
    border-radius: 8px;
    background: rgba(236, 232, 220, 0.3);
    color: var(--color-charcoal);
    transition: all 0.2s ease;
    outline: none;
}

#words-search:focus {
    border-color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(96, 108, 89, 0.1);
    background: #fff;
}

#words-search::placeholder {
    color: rgba(51, 46, 42, 0.35);
}

/* Tab count badges */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.35rem;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(96, 108, 89, 0.1);
    color: rgba(51, 46, 42, 0.5);
    border-radius: 10px;
    margin-left: 0.3rem;
}

.words-tab.active .tab-count {
    background: rgba(96, 108, 89, 0.15);
    color: var(--color-green);
}

/* Tab intro */
.tab-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.tab-intro p {
    color: rgba(51, 46, 42, 0.6);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ============================================
   CONTENT GRID (Songs, Albums, Demos)
   ============================================ */

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

/* Content Card (base style for song/album/demo) */
.content-card {
    background: #fff;
    border: 1px solid rgba(51, 46, 42, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    position: relative;
}

.content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(96, 108, 89, 0.2);
}

.card-type {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(51, 46, 42, 0.4);
    margin-bottom: 0.5rem;
}

.card-type i {
    margin-right: 0.25rem;
}

.content-card h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--color-charcoal);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-preview {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(51, 46, 42, 0.55);
    line-height: 1.6;
}

.card-meta {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(51, 46, 42, 0.45);
}

.card-has-player {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-green);
    margin-top: 0.75rem;
    opacity: 0.8;
}

.card-has-player i {
    margin-right: 0.25rem;
    font-size: 0.6rem;
}

/* Song Card */
.song-card .card-type {
    color: var(--card-accent, var(--color-green));
}

/* Album Card */
.album-card-art {
    width: calc(100% + 2.5rem);
    margin: -1.25rem -1.25rem 1rem -1.25rem;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}
.album-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-card .card-type {
    color: var(--card-accent, var(--color-blue));
}

/* Album card uses wider columns to accommodate intro text */
#albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Album intro text inside card */
.album-card .card-preview {
    font-size: 0.82rem;
    font-style: italic;
    color: rgba(51, 46, 42, 0.6);
    line-height: 1.65;
    margin-top: 0.5rem;
}

/* Demo Card */
.demo-card .card-type {
    color: var(--card-accent, var(--color-red));
}

.demo-card.locked {
    background: rgba(236, 232, 220, 0.4);
}

.demo-card.locked h3 {
    color: rgba(51, 46, 42, 0.6);
}

.card-locked {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: rgba(133, 61, 62, 0.6);
    margin-top: 0.75rem;
    font-style: italic;
}

/* Empty state */
.empty-state {
    text-align: center;
    color: rgba(51, 46, 42, 0.4);
    font-size: 0.9rem;
    padding: 3rem;
    grid-column: 1 / -1;
}

/* ============================================
   ALBUM TRACKLIST VIEW
   ============================================ */

.album-view {
    max-width: 680px;
    margin: 0 auto 4rem;
}

/* Album intro — short descriptive text shown below title */
.album-intro-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(51, 46, 42, 0.6);
    line-height: 1.75;
    margin: 0.75rem 0 0;
}

.album-tracklist {
    margin-top: 2rem;
}

.tracklist-header {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(51, 46, 42, 0.5);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(51, 46, 42, 0.08);
}

.album-song-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(51, 46, 42, 0.04);
}

.album-song-item:hover {
    background: rgba(96, 108, 89, 0.06);
}

.album-song-number {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(51, 46, 42, 0.35);
    min-width: 1.5rem;
    text-align: center;
}

.album-song-title {
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-charcoal);
}

.album-song-item i {
    color: rgba(51, 46, 42, 0.2);
    font-size: 0.7rem;
}

/* ============================================
   ALBUM LAYOUT (Player Left, Lyrics Right)
   ============================================ */

.album-layout {
    display: flex;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.album-layout-left {
    flex: 0 0 380px;
    max-width: 380px;
}

.album-layout-right {
    flex: 1;
    min-width: 0;
}

.album-layout-right .line {
    display: block;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .album-layout {
        flex-direction: column;
    }

    .album-layout-left {
        flex: none;
        max-width: 100%;
    }
}

/* Like Button States */
.like-btn.liked {
    color: var(--color-red);
}

.like-btn.liked .like-icon {
    fill: var(--color-red);
    stroke: var(--color-red);
}

/* ============================================
   EMBED PLAYER
   ============================================ */

.embed-player {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.embed-player iframe {
    border-radius: 8px;
}

.dropbox-embed audio {
    width: 100%;
    border-radius: 8px;
    outline: none;
}

/* Embed unavailable state (no embedUrl set) */
.embed-unavailable {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    background: rgba(51, 46, 42, 0.04);
    border: 1px solid rgba(51, 46, 42, 0.08);
    border-radius: 8px;
    color: rgba(51, 46, 42, 0.45);
    font-size: 0.85rem;
    margin: 1rem 0;
}
.embed-unavailable a {
    color: var(--color-gold, #9F7A4E);
    text-decoration: none;
}
.embed-unavailable a:hover {
    text-decoration: underline;
}

/* Small "Open in Bandcamp" link below iframes that may fail silently */
.embed-fallback-link {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    text-align: right;
    color: rgba(51, 46, 42, 0.35);
}
.embed-fallback-link a {
    color: rgba(51, 46, 42, 0.4);
    text-decoration: none;
    transition: color 0.15s;
}
.embed-fallback-link a:hover {
    color: var(--color-charcoal);
}

/* ============================================
   DEMO EMAIL GATE MODAL
   ============================================ */

.demo-gate-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.demo-gate-modal.active {
    display: flex;
}

.demo-gate-content {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.demo-gate-icon {
    font-size: 2rem;
    color: rgba(133, 61, 62, 0.5);
    margin-bottom: 1rem;
}

.demo-gate-content h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-charcoal);
    margin-bottom: 0.75rem;
}

.demo-gate-content p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(51, 46, 42, 0.65);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.demo-gate-content form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.demo-gate-content input[type="email"] {
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border: 1px solid rgba(51, 46, 42, 0.15);
    border-radius: 6px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.demo-gate-content input[type="email"]:focus {
    border-color: var(--color-green);
}

.demo-gate-content button[type="submit"] {
    padding: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--color-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-gate-content button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.demo-gate-content input[type="text"] {
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border: 1px solid rgba(51, 46, 42, 0.15);
    border-radius: 6px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.demo-gate-content input[type="text"]:focus {
    border-color: var(--color-green);
}

.demo-patreon-btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, #f96854, #e74c3c);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.demo-patreon-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.patreon-locked .card-locked {
    color: #f96854;
}

/* ============================================
   LINE BREAK FORMATTING (Lyrics)
   ============================================ */

.lyrics-text .line {
    display: block;
}

.lyrics-text .stanza-break {
    height: 1.2rem;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .words-search-container {
        padding: 1rem;
    }

    /* Tab bar: scrollable on small screens so all tabs stay on one row */
    .words-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 1rem;
    }

    .words-tabs::-webkit-scrollbar {
        display: none;
    }

    .words-tab {
        padding: 0.85rem 1.25rem;
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.9rem;
    }
}



/* Lyric Modal */
.lyric-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(51, 46, 42, 0.9);
    z-index: 2000;
    overflow-y: auto;
}

.lyric-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyric-modal-content {
    background: var(--color-cream);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 8px;
    padding: 2rem;
    position: relative;
}

.lyric-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(51, 46, 42, 0.5);
    cursor: pointer;
}

.lyric-modal h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.lyric-modal .album-title {
    color: var(--color-green);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.lyric-modal .lyrics-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: rgba(51, 46, 42, 0.85);
    line-height: 1.5;
    /* no white-space: pre-line — formatting comes from .line spans + .stanza-break */
}

.lyric-modal .lyrics-text .line {
    display: block;
    line-height: 1.4;
}

.lyric-modal .lyrics-text .stanza-break {
    height: 0.85em;
    display: block;
}

.lyric-modal .lyrics-text:empty::before {
    content: 'No lyrics on file yet.';
    font-style: italic;
    color: rgba(51, 46, 42, 0.35);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Lyric Modal Footer (share buttons) */
.lyric-modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(51, 46, 42, 0.1);
}

/* Reflections Section */
.reflections-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.reflections-intro h2 {
    font-size: 1.5rem;
    color: var(--color-green);
    margin-bottom: 0.5rem;
}

.reflections-intro p {
    color: rgba(51, 46, 42, 0.7);
    line-height: 1.7;
}

.reflection-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reflection-card {
    background: rgba(96, 108, 89, 0.03);
    border: 1px solid rgba(96, 108, 89, 0.1);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    transition: all 0.2s ease;
}

.reflection-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(51, 46, 42, 0.08);
}

.reflection-card .meta {
    font-size: 0.75rem;
    color: rgba(51, 46, 42, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.reflection-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-charcoal);
    margin-bottom: 0.75rem;
}

.reflection-card p {
    font-size: 0.9rem;
    color: rgba(51, 46, 42, 0.7);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.reflection-card a,
.reflection-card button.read-more-btn {
    font-size: 0.85rem;
    color: var(--color-green);
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.reflection-card a:hover,
.reflection-card button.read-more-btn:hover {
    text-decoration: underline;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 2rem;
    color: rgba(51, 46, 42, 0.5);
    font-style: italic;
}

/* Dynamic Content Extensions */
.loading-state {
    padding: 3rem;
    text-align: center;
    color: var(--color-charcoal);
    font-family: var(--font-body);
    opacity: 0.6;
    grid-column: 1 / -1;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-charcoal);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    padding: 0;
}

.back-link:hover {
    opacity: 1;
}

.article-body {
    max-width: 680px;
    margin: 0 auto 4rem;
}

.article-body h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    color: var(--color-charcoal);
}

.article-body .meta-date {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(51, 46, 42, 0.6);
    margin-bottom: 2rem;
}

.article-body .content {
    font-family: var(--font-heading);
    font-size: 1.275rem;
    line-height: 1.6;
}

.article-body .content .line {
    display: block;
    margin-bottom: 1.3rem;
}

.article-body .content .stanza-break {
    height: 1.4rem;
}

.article-body .content p {
    margin-bottom: 1.75rem;
}

/* Links inside reflections (from Google Doc) */
.article-body .content a {
    color: var(--color-green);
    text-decoration: underline;
    text-decoration-color: rgba(96, 108, 89, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

.article-body .content a:hover {
    text-decoration-color: var(--color-green);
}

/* Also style links inside .line spans in reflections */
.article-body .content .line a {
    color: var(--color-green);
    text-decoration: underline;
    text-decoration-color: rgba(96, 108, 89, 0.3);
    text-underline-offset: 2px;
}

.article-body .content .line a:hover {
    text-decoration-color: var(--color-green);
}

.article-body .content h2 {
    font-size: 1.8rem;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.article-body .content h3 {
    font-size: 1.4rem;
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
    color: var(--color-charcoal);
}

.article-body .content ul,
.article-body .content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body .content li {
    margin-bottom: 0.5rem;
}

.article-body .content blockquote {
    border-left: 2px solid rgba(51, 46, 42, 0.18);
    padding: 0.25rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: rgba(51, 46, 42, 0.65);
    background: none;
    border-radius: 0;
}

/* ============================================
   Reflections Table of Contents
   ============================================ */

.table-of-contents {
    margin: 2rem 0 3rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toc-header {
    font-family: var(--font-body);
    font-size: 0.63rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(51, 46, 42, 0.38);
    margin: 0 0 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1.5px solid rgba(51, 46, 42, 0.1);
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(51, 46, 42, 0.55);
    text-decoration: none;
    transition: color 0.15s ease, padding-left 0.15s ease;
    display: block;
    padding: 0.3rem 0.75rem;
    line-height: 1.4;
}

.toc-list a:hover {
    color: rgba(51, 46, 42, 0.85);
}

.toc-list a.active {
    color: var(--color-green);
    font-weight: 500;
    padding-left: 1rem;
}

/* Hide inline TOC and duplicate back-link on desktop when sidebar is present */
@media (min-width: 960px) {
    body.has-reading-sidebar .table-of-contents {
        display: none;
    }
    body.has-reading-sidebar .back-link {
        display: none;
    }
}

/* ============================================
   Article Footer — Topics, Likes, Share
   ============================================ */

.article-footer {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 0;
    border-top: 1px solid rgba(51, 46, 42, 0.1);
}

.article-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Topic Pills */
.article-topics {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topics-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(51, 46, 42, 0.5);
}

.topic-pill {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-green);
    background: rgba(96, 108, 89, 0.08);
    border: 1px solid rgba(96, 108, 89, 0.15);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-pill:hover {
    background: rgba(96, 108, 89, 0.15);
    transform: translateY(-1px);
}

/* Engagement Row */
.article-engagement {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Like Button */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(133, 61, 62, 0.06);
    border: 1px solid rgba(133, 61, 62, 0.12);
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-charcoal);
    transition: all 0.2s ease;
}

.like-btn:hover {
    background: rgba(133, 61, 62, 0.12);
    transform: translateY(-1px);
}

.like-btn:active {
    transform: scale(0.95);
}

.like-icon {
    width: 18px;
    height: 18px;
    color: #853D3E;
    transition: all 0.2s ease;
}

.like-btn:hover .like-icon {
    fill: rgba(133, 61, 62, 0.2);
}

.like-count {
    font-weight: 500;
    color: rgba(51, 46, 42, 0.7);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(51, 46, 42, 0.45);
    margin-right: 0.25rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(51, 46, 42, 0.1);
    background: rgba(51, 46, 42, 0.03);
    color: rgba(51, 46, 42, 0.55);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.share-btn:hover {
    background: rgba(51, 46, 42, 0.08);
    color: var(--color-charcoal);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.share-twitter:hover {
    background: rgba(29, 161, 242, 0.08);
    border-color: rgba(29, 161, 242, 0.2);
    color: #1DA1F2;
}

.share-facebook:hover {
    background: rgba(24, 119, 242, 0.08);
    border-color: rgba(24, 119, 242, 0.2);
    color: #1877F2;
}

.share-email:hover {
    background: rgba(96, 108, 89, 0.08);
    border-color: rgba(96, 108, 89, 0.2);
    color: var(--color-green);
}

.share-copy:hover {
    background: rgba(159, 122, 78, 0.08);
    border-color: rgba(159, 122, 78, 0.2);
    color: var(--color-yellow);
}

.share-copy.copied {
    background: rgba(96, 108, 89, 0.1);
    border-color: var(--color-green);
    color: var(--color-green);
}

@media (max-width: 480px) {
    .article-engagement {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   Reading Sidebar (desktop article nav)
   ============================================ */

.reading-sidebar {
    display: none;
    position: fixed;
    top: 74px;
    left: 0;
    width: 200px;
    height: calc(100vh - 74px);
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 100;
    padding: 2.5rem 0 2rem;
    border-right: 1px solid rgba(51, 46, 42, 0.08);
    background: var(--color-cream, #ece8dc);
}

.reading-sidebar::-webkit-scrollbar { display: none; }

@media (min-width: 960px) {
    .reading-sidebar { display: block; }
    body.has-reading-sidebar .single-reflection-view {
        margin-left: 200px;
    }
}

.reading-sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 1.25rem;
}

.sidebar-back {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(51, 46, 42, 0.5);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.sidebar-back:hover { color: var(--color-green); }

.sidebar-section-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1.5px solid rgba(51, 46, 42, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-section-list a {
    display: block;
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: rgba(51, 46, 42, 0.35);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    line-height: 1.35;
    transition: color 0.2s, padding-left 0.15s;
}

.sidebar-section-list a:hover {
    color: rgba(51, 46, 42, 0.65);
}

.sidebar-section-list a.active {
    color: var(--color-green);
    font-weight: 500;
    padding-left: 1rem;
}

/* Pad the article bottom so content isn't hidden behind the mobile nav */
@media (max-width: 768px) {
    #single-reflection-view {
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    }
    /* Raise back-to-top above the bottom nav */
    .back-to-top {
        bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 0.75rem);
        right: 1rem;
    }
}

/* ============================================
   Reading Progress Bar
   ============================================ */

.reading-progress {
    position: sticky;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--color-green);
    width: 0%;
    transition: width 0.1s linear;
    z-index: 100;
    border-radius: 0 2px 2px 0;
}

/* ============================================
   Back to Top Button
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 38px;
    height: 38px;
    background: var(--color-charcoal);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.2s ease;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(51, 46, 42, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-2px);
    background: var(--color-green);
}

/* ============================================
   Prev / Next Article Navigation
   ============================================ */

.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    max-width: 680px;
    margin: 0 auto 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(51, 46, 42, 0.08);
}

.article-nav-btn {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: none;
    border: 1px solid rgba(51, 46, 42, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    text-align: left;
    max-width: 45%;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: var(--font-body);
}

.article-nav-btn:hover {
    border-color: var(--color-green);
    background: rgba(96, 108, 89, 0.04);
}

.article-nav-next {
    text-align: right;
    margin-left: auto;
}

.article-nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-green);
}

.article-nav-title {
    font-size: 0.875rem;
    color: var(--color-charcoal);
    font-family: var(--font-heading);
    line-height: 1.3;
}

@media (max-width: 480px) {
    .article-nav {
        flex-direction: column;
    }
    .article-nav-btn {
        max-width: 100%;
    }
    .article-nav-next {
        text-align: left;
        margin-left: 0;
    }
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

/* ============================================
   Article Metadata & Comments
   ============================================ */

.article-header {
    text-align: center;
    margin-bottom: 2rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(51, 46, 42, 0.6);
}

/* Comments Section */
.comments-section {
    max-width: 680px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(51, 46, 42, 0.1);
}

.comments-header {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-charcoal);
    margin-bottom: 2rem;
}

.comment-form {
    background: #fcfbf9;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    border: 1px solid rgba(51, 46, 42, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.comment-form h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.comment-form .form-group {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: rgba(51, 46, 42, 0.8);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid rgba(51, 46, 42, 0.15);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: white;
}

.comment-form button {
    background: var(--color-green);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.comment-form button:hover {
    background: #4a5445;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(51, 46, 42, 0.08);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    background: var(--color-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-charcoal);
    margin-bottom: 0.1rem;
}

.comment-date {
    font-size: 0.75rem;
    color: rgba(51, 46, 42, 0.5);
    margin-bottom: 0.75rem;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(51, 46, 42, 0.85);
    white-space: pre-wrap;
}

/* ============================================
   Player & Demo Gate Styles
   ============================================ */

/* Demo Gate */
.demo-gate {
    background: #f8f6f2;
    border: 1px solid rgba(159, 122, 78, 0.2);
    border-radius: 8px;
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.gate-icon {
    font-size: 2rem;
    color: var(--color-yellow);
    margin-bottom: 1rem;
}

.demo-gate h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--color-charcoal);
}

.demo-gate p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: rgba(51, 46, 42, 0.7);
    margin-bottom: 1.5rem;
}

.demo-gate form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.demo-gate input {
    padding: 0.6rem 1rem;
    border: 1px solid rgba(51, 46, 42, 0.15);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 250px;
}

.demo-gate button {
    background: var(--color-yellow);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.demo-gate button:hover {
    background: #8e6d45;
}

/* Audio Player Wrapper */
.audio-player-wrapper {
    background: #fcfbf9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid rgba(51, 46, 42, 0.05);
}

/* Listen Button (Fallback for Bandcamp etc) */
.listen-btn-wrapper {
    text-align: center;
    margin-bottom: 2rem;
}

.listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--color-charcoal);
    color: var(--color-cream);
    text-decoration: none;
    border-radius: 30px;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.2s ease;
}

.listen-btn:hover {
    background: rgba(51, 46, 42, 0.9);
    transform: translateY(-2px);
}

/* ============================================
   ARTICLE PAYWALL GATE
   ============================================ */

.article-fade {
    position: relative;
    margin-top: -6rem;
    height: 6rem;
    background: linear-gradient(to bottom, transparent, var(--color-cream));
    pointer-events: none;
}

.article-gate {
    background: var(--color-cream-light);
    border: 1px solid rgba(51, 46, 42, 0.10);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin: 0 0 2.5rem;
    text-align: center;
    box-shadow: 0 4px 24px rgba(51, 46, 42, 0.06);
}

.ag-headline {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 400;
    color: var(--color-charcoal);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.ag-sub {
    font-size: 0.88rem;
    color: rgba(51, 46, 42, 0.6);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.ag-step2-label {
    font-size: 0.85rem;
    color: rgba(51, 46, 42, 0.55);
    margin-bottom: 1rem;
    font-style: italic;
}

.ag-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 300px;
    margin: 0 auto 0.75rem;
}

.ag-form input {
    padding: 0.75rem 1rem;
    background: var(--color-cream);
    border: 1.5px solid rgba(51, 46, 42, 0.12);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-charcoal);
    text-align: center;
    transition: border-color 0.2s;
}

.ag-form input:focus {
    outline: none;
    border-color: var(--color-yellow);
}

.ag-form input::placeholder {
    color: rgba(51, 46, 42, 0.38);
}

.ag-btn-primary {
    padding: 0.8rem 1.5rem;
    background: var(--color-charcoal);
    color: var(--color-cream);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-height: 48px;
    width: 100%;
}

.ag-btn-primary:hover  { background: rgba(51, 46, 42, 0.85); }
.ag-btn-primary:active { transform: scale(0.98); }
.ag-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.ag-btn-ghost {
    padding: 0.6rem 1rem;
    background: transparent;
    color: rgba(51, 46, 42, 0.5);
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 100%;
}

.ag-btn-ghost:hover { color: var(--color-charcoal); }

.ag-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem auto;
    max-width: 300px;
    color: rgba(51, 46, 42, 0.35);
    font-size: 0.8rem;
}

.ag-divider::before,
.ag-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(51, 46, 42, 0.12);
}

.ag-platforms {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.ag-platform-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1.4rem;
    border: 1.5px solid rgba(51, 46, 42, 0.18);
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-charcoal);
    text-decoration: none;
    transition: all 0.2s;
    min-height: 44px;
}

.ag-platform-btn:hover {
    background: rgba(51, 46, 42, 0.06);
    border-color: var(--color-charcoal);
}

.article-second-half {
    animation: agFadeUp 0.4s ease;
}

@keyframes agFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}