/* economic.wiki - Education Scholarly Layout */
/* Palette: #faf9f6, #f1f0eb, #1a1a1a, #1e3a5f, #2563eb, #1d4ed8, #eff6ff */
/* Fonts: Merriweather (700), Inter (400/600/700), Source Code Pro (400) */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #faf9f6;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.75;
    font-size: 16px;
}

/* ========== HEADER ========== */
.site-header {
    background: #faf9f6;
    border-bottom: 1px solid #e0dbd2;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wiki-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.brand-icon {
    flex-shrink: 0;
}

.wiki-name {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #1e3a5f;
    line-height: 1.2;
}

.wiki-desc {
    font-size: 0.72rem;
    color: #8a8070;
    letter-spacing: 0.02em;
}

.header-nav {
    display: flex;
    gap: 1.25rem;
}

.nav-link {
    font-size: 0.8rem;
    color: #1a1a1a;
    cursor: pointer;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
    color: #1d4ed8;
}

.nav-link.active {
    color: #1e3a5f;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* ========== LAYOUT ========== */
.layout {
    max-width: 1060px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2.5rem;
    padding: 2rem 1.5rem 4rem;
}

.main-content {
    max-width: 720px;
    min-width: 0;
}

/* ========== HERO ZONE (0-100vh) ========== */
.hero-zone {
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0dbd2;
    margin-bottom: 2rem;
}

.article-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 2.1rem;
    color: #1e3a5f;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.article-meta {
    font-size: 0.78rem;
    color: #8a8070;
    margin-bottom: 1.5rem;
}

.last-updated {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.72rem;
    color: #8a8070;
}

/* Key Concepts */
.key-concepts {
    border: 1px solid #d8e6f3;
    border-left: 4px solid #2563eb;
    padding: 1.125rem 1.375rem;
    background: #eff6ff;
    border-radius: 0 4px 4px 0;
    margin-bottom: 0.5rem;
}

.concepts-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e3a5f;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.concepts-icon {
    flex-shrink: 0;
}

.concepts-list {
    list-style: disc;
    padding-left: 1.375rem;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #1a1a1a;
}

.concepts-list li {
    margin-bottom: 0.2rem;
}

/* ========== CONTENT SECTIONS ========== */
.section-heading {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: #1e3a5f;
    margin: 2.5rem 0 0.875rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e0dbd2;
    line-height: 1.35;
}

.body-text {
    font-size: 0.92rem;
    line-height: 1.75;
    margin-bottom: 1.125rem;
    color: #1a1a1a;
}

.body-text strong {
    font-weight: 600;
    color: #1a1a1a;
}

.body-text em {
    font-style: italic;
}

/* ========== DEFINITION BOXES ========== */
.definition-box {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 16px 20px;
    border-radius: 0 4px 4px 0;
    margin: 1.25rem 0;
}

.def-term {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e3a5f;
    margin-bottom: 0.375rem;
}

.def-text {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #1a1a1a;
}

.def-text strong {
    font-weight: 600;
}

.def-formula {
    margin-top: 0.5rem;
}

.formula {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    color: #2563eb;
    letter-spacing: 0.01em;
}

/* ========== EXAMPLE BOXES ========== */
.example-box {
    background: #faf9f6;
    border: 1px solid #e0dbd2;
    border-left: 4px solid #1e3a5f;
    padding: 16px 20px;
    border-radius: 0 4px 4px 0;
    margin: 1.25rem 0;
}

.example-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e3a5f;
    margin-bottom: 0.5rem;
}

.example-box .body-text {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* ========== REFERENCES ========== */
.references-zone {
    margin-top: 1rem;
    padding-top: 1rem;
}

.ref-list {
    list-style: none;
    padding: 0;
}

.ref-list li {
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    padding-left: 2rem;
    text-indent: -2rem;
    line-height: 1.6;
}

.ref-num {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.72rem;
    color: #2563eb;
    margin-right: 0.3rem;
}

/* Further Reading */
.further-reading {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0dbd2;
}

.further-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1rem;
    color: #1e3a5f;
    margin-bottom: 0.75rem;
}

.further-list {
    list-style: none;
    padding: 0;
}

.further-list li {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: #1d4ed8;
    cursor: pointer;
    transition: color 0.2s ease;
}

.further-list li:hover {
    color: #2563eb;
}

.further-link {
    color: #1d4ed8;
}

.related-arrow {
    color: #2563eb;
    margin-right: 0.25rem;
}

/* Explore More */
.explore-more {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0dbd2;
    text-align: center;
}

.explore-text {
    font-size: 0.92rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.topic-tag {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    background: #eff6ff;
    color: #1e3a5f;
    border: 1px solid #d8e6f3;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.topic-tag:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: sticky;
    top: 72px;
    height: fit-content;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
}

.sidebar-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e3a5f;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #2563eb;
}

/* Minimap */
.minimap {
    margin-bottom: 1.75rem;
    background: #f1f0eb;
    padding: 1rem 1.125rem;
    border-radius: 4px;
}

.minimap-list {
    list-style: none;
    padding: 0;
}

.minimap-list li {
    margin-bottom: 0.15rem;
}

.minimap-link {
    display: block;
    font-size: 0.78rem;
    color: #1a1a1a;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-left: 2px solid transparent;
    border-radius: 0 2px 2px 0;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.minimap-link:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.05);
}

.minimap-link.active {
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.06);
}

/* Glossary */
.glossary {
    margin-bottom: 1.75rem;
    background: #f1f0eb;
    padding: 1rem 1.125rem;
    border-radius: 4px;
}

.glossary-item {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #e0dbd2;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 2px;
}

.glossary-item:last-child {
    border-bottom: none;
}

.glossary-item:hover {
    background: rgba(37, 99, 235, 0.06);
}

.glossary-item.highlight {
    background: rgba(37, 99, 235, 0.1);
}

.glossary-term {
    font-size: 0.8rem;
    color: #1d4ed8;
}

/* Related Articles */
.related {
    margin-bottom: 1.75rem;
    background: #f1f0eb;
    padding: 1rem 1.125rem;
    border-radius: 4px;
}

.related-link {
    display: block;
    font-size: 0.8rem;
    color: #1d4ed8;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.related-link:hover {
    color: #2563eb;
}

/* ========== FOOTER ========== */
.site-footer {
    border-top: 1px solid #e0dbd2;
    padding: 2rem 1.5rem;
    background: #f1f0eb;
}

.footer-inner {
    max-width: 1060px;
    margin: 0 auto;
    text-align: center;
}

.footer-text {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e3a5f;
    margin-bottom: 0.3rem;
}

.footer-note {
    font-size: 0.72rem;
    color: #8a8070;
}

/* ========== ANIMATIONS ========== */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Definition box highlight when scrolled to from glossary */
.definition-box.highlight-pulse {
    animation: defPulse 1.2s ease;
}

@keyframes defPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
    40% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .header-nav {
        display: none;
    }

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

    .main-content {
        max-width: 100%;
    }

    .sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .minimap {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .article-title {
        font-size: 1.6rem;
    }

    .section-heading {
        font-size: 1.15rem;
    }

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

    .layout {
        padding: 1.25rem 1rem 3rem;
    }
}

/* ========== SCROLLBAR STYLING ========== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d8d3c8;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #b8b3a8;
}
