/* ===== DESIGN TOKENS ===== */
:root {
    --parchment: #F9F7F2;
    --crimson: #781D1D;
    --gold: #C5A059;
    --charcoal: #333333;
    --cream: #FAF8F3;
}

/* ===== BASE STYLES ===== */
body {
    background-color: var(--parchment);
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    color: var(--charcoal);
    font-size: 17px;
    line-height: 1.8;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
.drop-cap::first-letter {
    float: left;
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    line-height: 0.8;
    padding-right: 0.5rem;
    color: var(--crimson);
    font-weight: 700;
}

/* ===== BLOCKQUOTES ===== */
.blockquote-scripture {
    border-left: 4px solid var(--gold);
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.08) 0%, rgba(249, 247, 242, 0.5) 100%);
    position: relative;
}

.blockquote-scripture::before {
    content: '"';
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    color: var(--gold);
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.5;
}

/* ===== ACCORDION ===== */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.accordion-content.open {
    max-height: 2000px;
}

/* ===== TABLE OF CONTENTS ===== */
.toc-link.active {
    color: var(--crimson);
    border-left-color: var(--crimson);
    font-weight: 600;
}

/* ===== FOOTNOTES ===== */
.footnote-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    max-width: 300px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
}

.footnote:hover .footnote-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ===== READING MODES ===== */
.reading-mode-meditation {
    line-height: 2.2;
    letter-spacing: 0.02em;
}

.reading-mode-meditation p {
    margin-bottom: 2rem;
}

/* ===== DECORATIVE ELEMENTS ===== */
.cross-ornament {
    color: var(--gold);
}

/* ===== CARDS ===== */
.card-hover {
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(120, 29, 29, 0.15);
}

/* ===== NAVIGATION BAR ===== */
.navbar {
    background: rgba(249, 247, 242, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(197, 160, 89, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.nav-link {
    position: relative;
    color: var(--charcoal);
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--crimson);
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--parchment);
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu.open {
    left: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ===== SIDEBAR TOC ===== */
@media (max-width: 1024px) {
    .sidebar-toc {
        display: none;
    }

    .sidebar-toc.mobile-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 50;
        background: var(--parchment);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--parchment);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    position: fixed;
    top: 64px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--crimson), var(--gold));
    z-index: 40;
    transition: width 0.1s;
}

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SECTION PADDING FOR FIXED NAVBAR ===== */
section {
    scroll-margin-top: 80px;
}

/* ===== ACADEMIC TYPOGRAPHY ===== */
.prose-academic {
    font-family: 'Be Vietnam Pro', 'Noto Serif', serif;
    font-size: 1.05rem;
    line-height: 2;
    letter-spacing: 0.015em;
    word-spacing: 0.05em;
}

.prose-academic p {
    margin-bottom: 1.75rem;
    text-align: justify;
    hyphens: auto;
}

.prose-academic h2 {
    font-family: 'Playfair Display', serif;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.prose-academic h3 {
    font-family: 'Be Vietnam Pro', sans-serif;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ===== SIDEBAR TOC (Content Pages) ===== */
.content-sidebar-toc {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 1rem;
}

.content-sidebar-toc::-webkit-scrollbar {
    width: 4px;
}

.content-sidebar-toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid transparent;
    color: var(--charcoal);
    opacity: 0.7;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-decoration: none;
}

.content-sidebar-toc a:hover {
    opacity: 1;
    color: var(--crimson);
    border-left-color: var(--gold);
}

.content-sidebar-toc a.active {
    opacity: 1;
    color: var(--crimson);
    border-left-color: var(--crimson);
    font-weight: 600;
    background: rgba(120, 29, 29, 0.05);
}

/* ===== APA REFERENCES ===== */
.apa-references {
    background: linear-gradient(135deg, var(--cream) 0%, var(--parchment) 100%);
    border-top: 3px solid var(--gold);
    padding: 2rem;
    margin-top: 3rem;
    border-radius: 0 0 0.75rem 0.75rem;
}

.apa-references h3 {
    font-family: 'Cinzel', serif;
    color: var(--crimson);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.apa-reference-item {
    padding-left: 2rem;
    text-indent: -2rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--charcoal);
}

.apa-reference-item em {
    font-style: italic;
}

/* ===== LAYOUT WITH SIDEBAR ===== */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 220px 1fr;
    }
}

/* ===== DATA STATISTICS BOX ===== */
.stat-box {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-top: 3px solid var(--gold);
}

.stat-box .stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--crimson);
    line-height: 1.2;
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: var(--charcoal);
    opacity: 0.7;
    margin-top: 0.5rem;
}