/* ═══════════════ LAYOUT ═══════════════ */

body { scroll-snap-type: none !important; }

.article-layout {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 3rem;
    padding: 2rem 1.5rem 4rem;
}

/* ═══════════════ SIDEBAR ═══════════════ */

.article-sidebar {
    font-size: 0.85rem;
}

.sidebar-inner {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding-right: 1.5rem;
    border-right: 1px solid rgba(26,34,41,0.08);
}

.sidebar-back {
    display: block;
    color: #6b7480;
    text-decoration: none;
    font-size: 0.8rem;
    margin-bottom: 2rem;
    padding: 0.3rem 0;
    transition: color 0.2s;
}
.sidebar-back:hover { color: #1a2229; }

.sidebar-section { margin-bottom: 1.75rem; }

.sidebar-heading {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a9099;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li { margin-bottom: 0.15rem; }

.sidebar-links a {
    color: #6b7480;
    text-decoration: none;
    font-size: 0.82rem;
    display: block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1.4;
}

.sidebar-links a:hover {
    color: #1a2229;
    background: rgba(26,34,41,0.04);
}

.sidebar-links a.active {
    color: #1a2229;
    background: rgba(26,34,41,0.06);
}

.sidebar-links a.current-page {
    color: #8a7742;
    font-weight: 500;
}

/* Advisory CTA in sidebar */
.sidebar-cta {
    background: rgba(138,119,66,0.06);
    border: 1px solid rgba(138,119,66,0.12);
    border-radius: 10px;
    padding: 0.9rem;
    margin-top: 0.5rem;
}

.sidebar-cta p {
    font-size: 0.78rem;
    color: #6b7480;
    line-height: 1.5;
    margin: 0 0 0.6rem;
}

.sidebar-cta a {
    display: block;
    text-align: center;
    color: #8a7742;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.sidebar-cta a:hover { background: rgba(138,119,66,0.1); }

/* ═══════════════ ARTICLE ═══════════════ */

.article-layout article {
    max-width: 680px;
    min-width: 0;
}

.article-tag {
    display: inline-block;
    background: rgba(138,119,66,0.12);
    color: #8a7742;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

.article-headline {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 600;
    color: #1a2229;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.article-lede {
    font-size: 1.2rem;
    color: #6b7480;
    line-height: 1.65;
    margin-bottom: 2rem;
    font-weight: 300;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #8a9099;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(26,34,41,0.1);
    margin-bottom: 2.5rem;
}

article h2 {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a2229;
    letter-spacing: -0.01em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

article p {
    font-size: 1.05rem;
    color: #3c454c;
    line-height: 1.8;
    margin-bottom: 1.6rem;
    font-weight: 400;
}

article p strong { color: #1a2229; font-weight: 500; }

article ul, article ol {
    color: #3c454c;
    font-size: 1.05rem;
    line-height: 1.8;
    font-weight: 400;
    margin-bottom: 1.6rem;
    padding-left: 1.5rem;
}

article li { margin-bottom: 0.5rem; }
article li strong { color: #1a2229; font-weight: 500; }

/* ═══════════════ COMPONENTS ═══════════════ */

.callout {
    background: rgba(138,119,66,0.06);
    border: 1px solid rgba(138,119,66,0.15);
    border-left: 3px solid #8a7742;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}

.callout p { margin: 0; color: #8a7742; font-size: 1rem; }
.callout p strong { color: #6b5e30; }

.number-box {
    background: #fbfaf7;
    border: 1px solid rgba(26,34,41,0.12);
    border-radius: 16px;
    padding: 1.75rem;
    margin: 2rem 0;
}

.number-box .big-number {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 2.8rem;
    font-weight: 400;
    color: #1a2229;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.number-box .number-label { font-size: 0.9rem; color: #6b7480; }

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.comparison-table th {
    text-align: left;
    color: #1a2229;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(26,34,41,0.12);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

.comparison-table td {
    padding: 0.8rem 1rem;
    color: #6b7480;
    border-bottom: 1px solid rgba(26,34,41,0.08);
}

.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table td:first-child { color: #6b7480; }
.comparison-table td.highlight-bad { color: #f87171; }
.comparison-table td.highlight-good { color: #4ade80; }

.cta-box {
    background: rgba(138,119,66,0.08);
    border: 1px solid rgba(138,119,66,0.2);
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.cta-box h3 {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 1.4rem;
    color: #1a2229;
    margin-bottom: 0.75rem;
}

.cta-box p { color: #6b7480; font-size: 0.95rem; margin-bottom: 1.25rem; }

.cta-btn {
    display: inline-block;
    background: #8a7742;
    color: #fbfaf7;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.2s;
}

.cta-btn:hover { background: #6b5e30; }

/* ═══════════════ RELATED POSTS (bottom of article) ═══════════════ */

.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(26,34,41,0.1);
}

.related-posts h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a9099;
    font-weight: 600;
    margin-bottom: 1rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.related-card {
    background: #fbfaf7;
    border: 1px solid rgba(26,34,41,0.12);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    display: block;
    transition: background 0.2s, border-color 0.2s;
}

.related-card:hover {
    background: rgba(26,34,41,0.06);
    border-color: rgba(26,34,41,0.2);
}

.related-card .related-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a7742;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.related-card h4 {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a2229;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.related-card p {
    font-size: 0.8rem;
    color: #6b7480;
    line-height: 1.5;
    margin: 0;
}

/* ═══════════════ FOOTER ═══════════════ */

footer {
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid rgba(26,34,41,0.08);
    color: #8a9099;
    font-size: 0.85rem;
}

footer a { color: #6b7480; text-decoration: none; }
footer a:hover { color: #1a2229; }

/* ═══════════════ BLOG INDEX ═══════════════ */

.blog-layout {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 2.5rem;
    padding: 2rem 1.5rem 4rem;
}

.blog-content .section-label {
    font-size: 0.7rem;
    color: #8a9099;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(26,34,41,0.08);
}

.blog-content .section-label:first-child {
    border-top: none;
    padding-top: 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.post-card {
    background: #fbfaf7;
    border: 1px solid rgba(26,34,41,0.12);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    display: block;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.post-card:hover {
    background: rgba(26,34,41,0.06);
    border-color: rgba(26,34,41,0.2);
    transform: translateY(-2px);
}

.post-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    margin-bottom: 0.75rem;
}

.tag-mutual-funds { background: rgba(96,165,250,0.12); color: #60a5fa; }
.tag-tax { background: rgba(250,204,21,0.12); color: #facc15; }
.tag-insurance { background: rgba(52,211,153,0.12); color: #34d399; }
.tag-savings { background: rgba(167,139,250,0.12); color: #a78bfa; }
.tag-gold { background: rgba(251,191,36,0.12); color: #fbbf24; }
.tag-learn { background: rgba(148,163,184,0.12); color: #94a3b8; }

.featured-pill {
    display: inline-block;
    background: rgba(250,204,21,0.12);
    color: #facc15;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    margin-left: 0.4rem;
}

a.post-card, a.post-card:visited, a.post-card:hover {
    color: #1a2229;
    text-decoration: none;
}

.post-card h2 {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a2229;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.post-card p {
    color: #6b7480;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #8a9099;
}

.read-link {
    margin-left: auto;
    color: #8a7742;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ═══════════════ BLOG HERO (compact) ═══════════════ */

.blog-hero-compact {
    padding: 0.5rem 0 1.5rem;
}

.blog-hero-compact h1 {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a2229;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.blog-hero-compact p {
    color: #6b7480;
    font-size: 0.9rem;
}

/* ═══════════════ RESEARCH ARTICLES ═══════════════ */

.tag-research { background: rgba(239,68,68,0.12); color: #f87171; }

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: #8a7742;
    z-index: 1000;
    transition: width 50ms linear;
}

.pull-quote {
    border-left: 3px solid #f87171;
    padding: 0.3rem 0 0.3rem 1.5rem;
    margin: 2.5rem 0;
    font-size: 1.15rem;
    font-style: italic;
    line-height: 1.6;
    color: #3c454c;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 2rem 0;
}

.stat-box {
    background: #fbfaf7;
    border: 1px solid rgba(26,34,41,0.12);
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
}

.stat-box .stat-num {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a2229;
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.stat-box .stat-num.accent { color: #8a7742; }
.stat-box .stat-num.warn { color: #f87171; }

.stat-box .stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: #6b7480;
    line-height: 1.4;
}

.news-callout {
    background: rgba(239,68,68,0.06);
    border-left: 3px solid #f87171;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}

.news-callout-label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f87171;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.news-callout p { margin-bottom: 0.6rem; font-size: 0.95rem; line-height: 1.65; color: #3c454c; }
.news-callout p:last-child { margin-bottom: 0; }

.chart-container {
    background: #fbfaf7;
    border: 1px solid rgba(26,34,41,0.12);
    border-radius: 12px;
    padding: 1.5rem 1.2rem 1rem;
    margin: 2rem 0;
}

.chart-container canvas { width: 100%; height: auto; display: block; }

.chart-title {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7480;
    font-weight: 600;
    margin-bottom: 1rem;
}

.chart-legend {
    display: flex; gap: 1.2rem; flex-wrap: wrap;
    margin-top: 0.8rem; font-size: 0.72rem; color: #6b7480;
}

.chart-legend span { display: flex; align-items: center; gap: 0.35rem; }

.legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex-shrink: 0; }

.section-divider { border: none; border-top: 1px solid rgba(26,34,41,0.1); margin: 3rem 0; }

.comparison-table td.highlight-accent { color: #8a7742; font-weight: 500; }
.comparison-table tr.table-footer td { background: #fbfaf7; font-weight: 500; color: #1a2229; }

.big-number-centered { text-align: center; padding: 2rem 1rem; margin: 2rem 0; }

.big-number-centered .number {
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 3rem; font-weight: 400; color: #f87171; line-height: 1; margin-bottom: 0.4rem;
}

.big-number-centered .number-label { font-size: 0.85rem; color: #6b7480; }

.article-sources {
    margin-top: 3rem; padding-top: 2rem;
    border-top: 1px solid rgba(26,34,41,0.1);
    font-size: 0.8rem; color: #8a9099; line-height: 1.6;
}

.article-sources p { color: #8a9099; font-size: 0.8rem; margin-bottom: 0.5rem; }
.article-sources strong { color: #6b7480; }

@media (max-width: 768px) {
    .stat-row { grid-template-columns: 1fr; }
    .stat-box .stat-num { font-size: 1.3rem; }
}

/* ═══════════════ HOMEPAGE FOOTER ═══════════════ */
.corpus-footer { background: linear-gradient(179deg, #0c141d 0%, #0a0d11 100%); border-top: 1px solid rgba(255,255,255,0.08); }
.corpus-footer-inner { max-width: 1180px; margin: 0 auto; padding: 64px 24px 40px; }
.corpus-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.corpus-footer-col-title { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; color: rgba(240,241,238,0.35); margin-bottom: 18px; }
.corpus-footer-link { display: block; font-size: 15px; color: rgba(240,241,238,0.62); margin-bottom: 12px; text-decoration: none; }
.corpus-footer-link:hover { color: #f0f1ee; }
.corpus-footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.corpus-footer-bottom span { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.08em; color: rgba(240,241,238,0.35); }

/* ═══════════════ RESPONSIVE ═══════════════ */

@media (max-width: 768px) {
    .blog-layout,
    .article-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .article-sidebar {
        order: -1;
    }

    .sidebar-inner {
        position: static;
        max-height: none;
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid rgba(26,34,41,0.08);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    /* Hide TOC on mobile, keep nav links */
    .sidebar-section.toc-section { display: none; }

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

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

    .corpus-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 480px) {
    .corpus-footer-grid { grid-template-columns: 1fr; }
}
