.blog-page {
    background: var(--bg-canvas);
}

.blog-title {
    max-width: 12ch;
}

.blog-hero {
    padding-bottom: 60px;
}

.blog-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 34px;
    align-items: center;
}

.blog-hero-stack {
    display: grid;
    gap: 18px;
}

.blog-hero-card,
.blog-library-card,
.sidebar-panel,
.blog-article-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: none;
}

.blog-hero-card::after,
.blog-library-card::after,
.sidebar-panel::after,
.blog-article-shell::after {
    content: none;
}

.blog-hero-card {
    padding: 24px;
}

.blog-hero-card h2,
.blog-library-card h3,
.article-header h1 {
    margin: 0;
    color: var(--heading-dark);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.blog-hero-card h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.blog-hero-card p:last-of-type {
    margin-bottom: 0;
}

.blog-hero-card img {
    width: 100%;
    margin-top: 18px;
    border-radius: calc(var(--radius-md) - 4px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f7f8fa;
}

.blog-hero-card-secondary {
    background: #ffffff;
}

.blog-library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.blog-library-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, 220px);
    gap: 18px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.blog-library-card:hover,
.blog-library-card.is-active {
    transform: none;
    border-color: rgba(37, 99, 235, 0.24);
    box-shadow: none;
}

.blog-library-card h3 {
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
}

.blog-library-card p {
    margin: 14px 0 0;
    color: var(--text-secondary);
}

.blog-library-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.blog-library-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 6px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.blog-reader-section {
    padding-top: 20px;
}

.blog-reader {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.blog-sidebar {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 96px;
}

.sidebar-panel {
    padding: 20px;
}

.blog-sidebar-list,
.blog-outline {
    display: grid;
    gap: 10px;
}

.blog-sidebar-link,
.blog-outline a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    background: #f7f8fa;
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.blog-sidebar-link:hover,
.blog-sidebar-link.is-active,
.blog-outline a:hover {
    color: var(--heading-dark);
    background: #edf1f5;
    border-color: rgba(37, 99, 235, 0.18);
}

.blog-sidebar-link strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.blog-sidebar-link span {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.blog-outline-child {
    margin-left: 12px;
}

.blog-notes {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
}

.blog-notes li + li {
    margin-top: 10px;
}

.blog-article-shell {
    padding: 30px;
}

.article-loading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.article-loading p:last-child {
    color: var(--text-secondary);
}

.article-header {
    display: grid;
    gap: 20px;
}

.article-header h1 {
    font-size: clamp(2.4rem, 4.5vw, 4rem);
}

.article-dek {
    margin: 0;
    max-width: 68ch;
    color: var(--text-secondary);
    font-size: 1.08rem;
}

.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #f7f8fa;
    color: #425466;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-cover {
    width: 100%;
    border-radius: calc(var(--radius-md) - 4px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f7f8fa;
}

.article-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.article-fact {
    padding: 16px;
    border-radius: 8px;
    background: #f7f8fa;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.article-fact span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.article-body {
    margin-top: 30px;
    color: var(--text-primary);
}

.article-body > *:first-child {
    margin-top: 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 40px;
    margin-bottom: 14px;
    color: var(--heading-dark);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.article-body h2 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.article-body h3 {
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.article-body p,
.article-body li {
    color: var(--body-dark);
    font-size: 1rem;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body table,
.article-body figure {
    margin: 16px 0 0;
}

.article-body ul,
.article-body ol {
    padding-left: 22px;
}

.article-body li + li {
    margin-top: 10px;
}

.article-body blockquote {
    padding: 16px 18px;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    background: #f7f8fa;
}

.article-body code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.92em;
}

.article-body p code,
.article-body li code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
}

.article-body pre {
    padding: 18px;
    overflow-x: auto;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
}

.article-body pre code {
    color: inherit;
}

.article-body a {
    color: var(--primary-color);
    font-weight: 600;
}

.article-body a:hover {
    color: var(--primary-color-hover);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.article-body th,
.article-body td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.article-body thead th {
    background: rgba(237, 244, 255, 0.88);
    color: var(--heading-dark);
    font-size: 0.92rem;
}

.article-body figure {
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f7f8fa;
}

.article-body figure img {
    width: 100%;
    background: #f7f8fa;
}

.article-body figcaption {
    padding: 14px 16px 18px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.article-top-anchor {
    position: relative;
    top: -96px;
}

.blog-footer {
    padding-top: 32px;
}

@media (max-width: 1100px) {
    .blog-hero-grid,
    .blog-reader,
    .blog-library-card {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
    }

    .blog-library {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .article-facts {
        grid-template-columns: 1fr;
    }

    .blog-article-shell,
    .sidebar-panel,
    .blog-hero-card,
    .blog-library-card {
        padding: 22px;
    }
}

@media (max-width: 560px) {
    .blog-article-shell,
    .sidebar-panel,
    .blog-hero-card,
    .blog-library-card {
        padding: 18px;
    }
}
