/* ============================================
   economic.wiki - Classic Serif Revival Book
   ============================================ */

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

body {
    background: #FAF8F3;
    color: #1E1E1C;
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- HERO / TITLE PAGE --- */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    background: #FAF8F3;
}

.hero-title {
    font-family: 'Lora', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: #1B2A4A;
    letter-spacing: 0.02em;
}

.hero-tagline {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.1rem;
    color: #6E6B65;
    margin-top: 0.5rem;
}

/* --- ORNAMENTAL RULE --- */
.ornamental-rule {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.ornamental-rule::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 0.5px;
    background: #B8963E;
}

.fleuron {
    font-family: 'Lora', serif;
    font-size: 12px;
    color: #B8963E;
    background: #FAF8F3;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fleuron.revealed {
    opacity: 1;
}

/* --- LAYOUT --- */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- SIDEBAR --- */
.sidebar {
    background: #F0EBE0;
    border-right: 1px solid #E5DFD3;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 0;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem;
}

.sidebar-part {
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6E6B65;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-part:first-child {
    margin-top: 0;
}

.sidebar-link {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1E1E1C;
    text-decoration: none;
    padding: 0.35rem 0 0.35rem 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: border-color 0.2s ease-out, color 0.2s ease-out;
    opacity: 0;
    transform: translateX(-5px);
}

.sidebar-link.faded-in {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease-out, color 0.2s ease-out;
}

.sidebar-link.sub {
    padding-left: 24px;
    font-size: 0.85rem;
    color: #6E6B65;
}

.sidebar-link.active {
    border-left-color: #8C3A3A;
    color: #1B2A4A;
    font-weight: 500;
}

.sidebar-link:hover {
    color: #1B2A4A;
}

/* --- CONTENT --- */
.content {
    max-width: 680px;
    padding: 3rem 40px;
}

.content-section {
    margin-bottom: 2.5rem;
}

.content h2 {
    font-family: 'Lora', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: #1B2A4A;
    margin-bottom: 1.2rem;
}

.content h3 {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: #1B2A4A;
    margin-bottom: 1rem;
}

.section-num {
    font-weight: 700;
    color: #1B2A4A;
}

.content p {
    margin-bottom: 1.2rem;
}

.content a {
    color: #1B2A4A;
    text-decoration: underline;
    text-decoration-color: #B8963E;
    text-underline-offset: 3px;
}

/* --- CONCEPT BOX --- */
.concept-box {
    border-left: 3px solid #8C3A3A;
    background: #F5F0E6;
    padding: 20px 24px;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
}

.concept-box .concept-border-anim {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: #8C3A3A;
    transition: height 0.4s ease-out;
}

.concept-box.visible .concept-border-anim {
    height: 100%;
}

.concept-label {
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8C3A3A;
    display: block;
    margin-bottom: 0.5rem;
}

.concept-box p {
    margin-bottom: 0;
    font-size: 1rem;
}

.concept-box strong {
    font-weight: 700;
}

.concept-box em {
    font-style: italic;
}

/* --- PULL QUOTE --- */
.pull-quote {
    position: relative;
    margin: 2rem 0;
    padding: 1.5rem 2rem 1.5rem 3rem;
    border: none;
}

.quote-mark {
    position: absolute;
    top: 0;
    left: 0;
    font-family: 'Lora', serif;
    font-size: 4rem;
    color: #B8963E;
    opacity: 0.25;
    line-height: 1;
}

.pull-quote p {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #1E1E1C;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.pull-quote cite {
    font-family: 'Karla', sans-serif;
    font-size: 0.85rem;
    font-style: normal;
    color: #6E6B65;
}

/* --- FOOTNOTES --- */
.footnote-ref {
    font-family: 'Karla', sans-serif;
    font-size: 0.7rem;
    color: #1B2A4A;
    cursor: help;
    position: relative;
    vertical-align: super;
    line-height: 0;
}

.footnote-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #FAF8F3;
    border: 1px solid #1B2A4A;
    padding: 8px 12px;
    font-family: 'Karla', sans-serif;
    font-size: 0.8rem;
    color: #1E1E1C;
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    line-height: 1.4;
    max-width: 300px;
    white-space: normal;
}

.footnote-ref:hover .footnote-tooltip {
    opacity: 1;
}

.footnotes-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 0.5px solid #B8963E;
}

.footnotes-section h4 {
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6E6B65;
    margin-bottom: 1rem;
}

.footnotes-list {
    padding-left: 1.5rem;
}

.footnotes-list li {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #6E6B65;
    margin-bottom: 0.5rem;
}

/* --- PRINT --- */
@media print {
    .sidebar {
        display: none;
    }

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

    body {
        background: #FFFFFF;
    }

    .hero {
        background: #FFFFFF;
    }

    .content h2,
    .content h3 {
        color: #000000;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #E5DFD3;
    }

    .content {
        padding: 2rem 20px;
    }
}
