/* ===================================
   Professional Tech Blog Article Styles
   Clean, readable, production-ready
   =================================== */

/* Header Override */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--background);
    border-bottom: 1px solid var(--border-subtle);
}

.site-header .container {
    padding: 16px;
}

.site-header .header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header .header-nav .header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.site-header .site-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.site-header .site-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--link-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 0;
    border: 1px solid transparent;
    transition: all 70ms;
    flex-shrink: 0;
}

.back-link:hover {
    background: var(--background-hover);
    border-color: var(--border-subtle);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Layout */
.article-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 64px;
    align-items: start;
}

/* Sidebar TOC */
.toc-sidebar {
    position: relative;
}

.toc-sticky {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 128px);
    overflow-y: auto;
    padding: 24px;
    background: var(--layer-01);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
}

.toc-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

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

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    display: block;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: all 70ms;
}

.toc-list a:hover {
    color: var(--text-primary);
    border-left-color: var(--link-primary);
}

.toc-list a.active {
    color: var(--link-primary);
    border-left-color: var(--link-primary);
    font-weight: 500;
}

/* Article Content */
.research-report {
    max-width: 720px;
    margin: 0 auto;
}

/* Article Header */
.article-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

.article-title {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-description {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Typography - Professional Defaults */
.section {
    margin-bottom: 48px;
}

.section h2 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 48px 0 24px 0;
    scroll-margin-top: 96px;
}

.section h3 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 32px 0 16px 0;
    scroll-margin-top: 96px;
}

.section h4 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 24px 0 12px 0;
}

.section p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.section ul,
.section ol {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    padding-left: 32px;
}

.section li {
    margin-bottom: 12px;
}

.section strong {
    font-weight: 600;
    color: var(--text-primary);
}

.section code {
    font-family: var(--font-mono);
    font-size: 16px;
    background: var(--layer-01);
    padding: 2px 6px;
    border-radius: 0;
    border: 1px solid var(--border-subtle);
}

.section pre {
    background: var(--layer-01);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    padding: 16px;
    overflow-x: auto;
    margin: 0 0 24px 0;
}

.section pre code {
    background: none;
    border: none;
    padding: 0;
}

.section blockquote {
    border-left: 4px solid var(--link-primary);
    padding-left: 24px;
    margin: 32px 0;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
}

.section a {
    color: var(--link-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 70ms;
}

.section a:hover {
    border-bottom-color: var(--link-primary);
}

/* Tables */
.section table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 16px;
}

.section th {
    background: var(--layer-01);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.section td {
    padding: 12px 16px;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

/* Highlights/Callouts */
.highlight-box {
    background: var(--layer-01);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--link-primary);
    padding: 24px;
    margin: 32px 0;
    border-radius: 0;
}

.highlight-box h4 {
    margin-top: 0;
    font-size: 18px;
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

/* Images */
.section img {
    max-width: 100%;
    height: auto;
    margin: 32px 0;
    border: 1px solid var(--border-subtle);
}

.section figure {
    margin: 32px 0;
}

.section figcaption {
    font-size: 14px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 12px;
}

/* Mobile TOC Toggle */
.toc-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--link-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 200px 1fr;
        gap: 48px;
    }

    .article-title {
        font-size: 36px;
    }

    .section h2 {
        font-size: 28px;
    }

    .section h3 {
        font-size: 22px;
    }
}

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

    .toc-sidebar {
        display: none;
    }

    .toc-toggle {
        display: block;
    }

    .article-title {
        font-size: 32px;
    }

    .section h2 {
        font-size: 24px;
        margin-top: 32px;
    }

    .section h3 {
        font-size: 20px;
    }

    .section p,
    .section ul,
    .section ol {
        font-size: 16px;
    }

    .site-header .header-nav {
        gap: 12px;
    }

    .site-header .site-title {
        font-size: 16px;
    }

    .site-header .site-subtitle {
        font-size: 12px;
    }

    .back-link {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .article-layout {
        padding: 24px 16px;
    }

    .article-title {
        font-size: 28px;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .toc-sidebar,
    .toc-toggle,
    .back-link,
    .theme-toggle {
        display: none;
    }

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

    .section p,
    .section ul,
    .section ol {
        font-size: 12pt;
        line-height: 1.6;
    }
}
