@import url('/common/css/site.css');

:root {
    --finance-width: 800px;
    --editorial-space-1: 0.5rem;
    --editorial-space-2: 0.9rem;
    --editorial-space-3: 1.3rem;
    --editorial-space-4: 2rem;
    --editorial-space-5: 2.8rem;
    --editorial-line-height: 1.8;
    --editorial-h1: clamp(2rem, 4vw, 2.8rem);
    --editorial-h2: clamp(1.35rem, 2.5vw, 1.8rem);
    --editorial-h3: clamp(1.1rem, 2vw, 1.3rem);
    --editorial-body: 1.03rem;
}

.finance-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

.finance-hub {
    margin-top: 2rem;
}

.finance-intro {
    margin-bottom: 2rem;
}

.finance-intro h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0.75rem;
}

.finance-intro p {
    color: var(--text-secondary);
    max-width: 70ch;
}

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

.finance-card {
    display: block;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.finance-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
}

.finance-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.finance-card p {
    margin: 0;
    color: var(--text-secondary);
}

.article-layout {
    max-width: var(--finance-width);
    margin: 0 auto;
    padding-top: var(--editorial-space-4);
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 50;
}

.reading-progress-bar {
    width: 0;
    height: 100%;
    background: var(--accent-gradient);
}

.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.article-breadcrumb a {
    color: var(--accent-primary);
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

.article-hero {
    margin-bottom: var(--editorial-space-4);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--editorial-space-3);
}

.article-hero h1 {
    font-size: var(--editorial-h1);
    line-height: 1.2;
    margin-bottom: var(--editorial-space-2);
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.article-content {
    display: grid;
    gap: var(--editorial-space-4);
}

.article-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--editorial-space-4);
}

.article-toc {
    position: sticky;
    top: 1rem;
    align-self: start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--editorial-space-3);
}

.article-toc h3 {
    font-size: 0.95rem;
    margin-top: 0;
    margin-bottom: var(--editorial-space-2);
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.article-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
}

.article-toc a:hover,
.article-toc a.is-active {
    color: var(--accent-primary);
}

.article-toc-mobile {
    display: none;
    margin-bottom: var(--editorial-space-3);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
}

.article-toc-mobile summary {
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
}

.article-toc-mobile ul {
    list-style: none;
    padding: 0.75rem 0 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.article-toc-mobile a {
    color: var(--text-secondary);
    text-decoration: none;
}

.article-section {
    display: grid;
    gap: var(--editorial-space-2);
}

.article-content h2 {
    font-size: var(--editorial-h2);
    margin-bottom: 0;
}

.article-content h3 {
    font-size: var(--editorial-h3);
    margin-top: var(--editorial-space-3);
    margin-bottom: 0;
}

.article-content p,
.article-content li {
    line-height: var(--editorial-line-height);
    font-size: var(--editorial-body);
    color: var(--text-secondary);
    margin: 0;
}

.article-content ul {
    padding-left: 1.2rem;
    margin: 0;
    display: grid;
    gap: var(--editorial-space-1);
}

.article-callout,
.article-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--editorial-space-3);
}

.article-callout h3,
.article-summary h3 {
    margin-top: 0;
}

.article-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

.article-table th,
.article-table td {
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.article-table th {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.article-chart {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--editorial-space-3);
    background: var(--bg-card);
}

.article-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.related-articles {
    margin-top: var(--editorial-space-4);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--editorial-space-3);
}

.related-articles h3 {
    margin-top: 0;
    font-size: var(--editorial-h3);
}

.related-articles ul {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.4rem;
}

.related-articles a {
    color: var(--accent-primary);
}

.article-faq {
    margin-top: var(--editorial-space-4);
}

.article-faq h3 {
    margin-top: 0;
    font-size: var(--editorial-h3);
}

.article-faq details {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    background: var(--bg-card);
}

.article-faq summary {
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
}

.article-faq p {
    margin-top: 0.6rem;
}

@media (max-width: 768px) {
    .finance-shell {
        padding: 0 1rem 3rem;
    }

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

    .article-toc {
        display: none;
    }

    .article-toc-mobile {
        display: block;
    }

    .article-content p,
    .article-content li {
        font-size: 1rem;
    }
}
