/* Clunky Design System — Batch 1 migration for legacy topic/article pages */
:root {
    --cds-header-height: 72px;
    --cds-reading: 780px;
    --cds-wide: 1180px
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--clr-bg, #f8fafc);
    color: var(--clr-text, #1e293b);
    font-family: var(--font-primary, Inter, system-ui, sans-serif);
    line-height: var(--lh-body, 1.75)
}

a {
    color: var(--clr-primary, #2563eb)
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: -5rem;
    z-index: 9999;
    padding: .7rem 1rem;
    background: #0f172a;
    color: #fff;
    border-radius: 8px
}

.skip-link:focus {
    top: 1rem
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--clr-border, #dbe4ee)
}

.header-container {
    width: min(calc(100% - 2rem), 1280px);
    min-height: 72px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: var(--clr-text, #1e293b);
    font-weight: 800;
    font-size: 1.35rem
}

.site-logo-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 800
}

.site-logo-text {
    letter-spacing: -.02em
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    list-style: none;
    margin: 0;
    padding: 0
}

.nav-link {
    text-decoration: none;
    color: var(--clr-text-light, #475569);
    font-weight: 600;
    font-size: .94rem
}

.nav-link:hover {
    color: var(--clr-primary, #2563eb)
}

.header-actions {
    display: flex;
    align-items: center
}

.nav-toggle {
    display: none;
    border: 0;
    background: transparent;
    padding: .5rem
}

.nav-toggle-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #1e293b;
    margin: 5px
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .8rem 1.1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    transition: .2s ease
}

.btn-primary {
    background: #2563eb;
    color: #fff !important
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px)
}

.btn-secondary {
    background: #fff;
    color: #1e293b !important;
    border-color: #dbe4ee
}

.btn-secondary:hover {
    background: #eef2f7
}

.btn-small {
    padding: .6rem .9rem;
    font-size: .9rem
}

.page-hero {
    padding: 4.5rem 0 4rem;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    border-bottom: 1px solid var(--clr-border, #dbe4ee)
}

.container-wide {
    width: min(calc(100% - 2rem), var(--cds-wide));
    margin-inline: auto
}

.breadcrumb {
    font-size: .84rem;
    color: #64748b;
    margin-bottom: 2rem
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none
}

.breadcrumb a:hover {
    color: #2563eb
}

.breadcrumb span {
    padding: 0 .45rem
}

.hero-copy {
    max-width: 900px
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    margin: 0 0 1rem;
    padding: .4rem .75rem;
    border-radius: 999px;
    background: #eef4ff;
    color: #2563eb;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase
}

.page-hero h1 {
    margin: 0;
    max-width: 18ch;
    font-size: clamp(2.6rem, 6vw, 4.7rem);
    line-height: 1.06;
    letter-spacing: -.04em;
    color: #0f172a
}

.hero-lead {
    max-width: 72ch;
    margin: 1.5rem 0 0;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #475569
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1.5rem
}

.hero-meta span {
    padding: .5rem .75rem;
    background: #fff;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    color: #64748b;
    font-size: .85rem;
    font-weight: 600
}

.page-main {
    padding: 4rem 0 6rem
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: stretch;
}

.article-sidebar {
    min-width: 0;
    align-self: stretch;
}

.article-sidebar .article-toc {
    align-self: start;
}

.article-toc {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 7rem);
    overflow: visible;
}

.article-toc-inner {
    padding: 1rem;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.article-toc-title {
    margin: 0 0 .75rem;
    color: #0f172a;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase
}

.article-toc-list {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin: 0;
    padding: 0;
    list-style: none
}

.article-toc-link {
    display: block;
    padding: .48rem .6rem;
    border-radius: 7px;
    color: #64748b;
    font-size: .86rem;
    line-height: 1.4;
    text-decoration: none
}

.article-toc-link:hover {
    background: #f8fafc;
    color: #0f172a
}

.article-toc-link:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px
}

.article-content {
    min-width: 0;
    width: 100%;
    max-width: var(--cds-reading);
    justify-self: start;
}

.article-content>h2,
.article-content>section>h2 {
    margin: 4rem 0 1.25rem;
    color: #0f172a;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1.2;
    letter-spacing: -.025em;
    scroll-margin-top: 6rem
}

.article-content>h2:first-child {
    margin-top: 0
}

.article-content>p,
.article-content>ul,
.article-content>ol,
.article-content>blockquote,
.article-content>div {
    font-size: 1.03rem
}

.article-content p {
    color: #475569
}

.article-content strong {
    color: #1e293b
}

.article-content li {
    margin: .45rem 0;
    color: #475569
}

.article-content ul,
.article-content ol {
    padding-left: 1.4rem
}

.article-content h3 {
    margin: 2rem 0 .7rem;
    color: #1e293b;
    font-size: 1.25rem;
    line-height: 1.35;
    scroll-margin-top: 6rem
}

.article-content a {
    font-weight: 600
}

.article-content hr {
    border: 0;
    border-top: 1px solid #dbe4ee;
    margin: 3rem 0
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0
}

.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.6rem;
    background: #fff;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    transition: .2s ease
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08)
}

.card h3 {
    margin: .1rem 0 .65rem;
    color: #0f172a
}

.card p {
    margin: 0
}

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

.callout {
    margin: 2rem 0;
    padding: 1.4rem 1.5rem;
    border: 1px solid #bae6fd;
    border-left: 5px solid #06b6d4;
    border-radius: 14px;
    background: #ecfeff;
    color: #334155
}

.callout strong {
    color: #0f172a
}

.framework-quote {
    margin: 2.5rem 0;
    padding: 1.6rem 1.8rem;
    border: 1px solid #c7d2fe;
    border-left: 5px solid #4f46e5;
    border-radius: 16px;
    background: #eef2ff;
    color: #312e81;
    font-size: 1.2rem;
    font-weight: 700
}

.framework-quote p {
    color: #312e81;
    margin: 0
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: #fff
}

.table-scroll table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse
}

.table-scroll th,
.table-scroll td {
    padding: 1rem 1.1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e2e8f0
}

.table-scroll th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 800
}

.table-scroll td {
    color: #475569
}

.table-scroll tr:last-child td {
    border-bottom: 0
}

.article-end-cta {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) auto;
    gap: 2rem;
    align-items: center;
    margin-top: 5rem;
    padding: 2.5rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #dbe4ee
}

.article-end-cta h2 {
    margin: .2rem 0 .7rem;
    color: #0f172a;
    font-size: 2rem
}

.article-end-cta p:not(.section-kicker) {
    margin: 0;
    color: #475569
}

.cta-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end
}

.site-footer {
    margin-top: 0;
    background: #0f172a;
    color: rgba(255, 255, 255, .88);
    overflow: hidden
}

.footer-container {
    max-width: 1280px;
    margin: auto;
    padding: 5rem 1.5rem 2rem
}

.footer-banner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem;
    margin-bottom: 4rem;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(59, 130, 246, .12), rgba(16, 185, 129, .08));
    border: 1px solid rgba(255, 255, 255, .08)
}

.footer-banner h2 {
    margin: 0 0 1rem;
    color: #fff
}

.footer-banner p {
    margin: 0;
    color: rgba(255, 255, 255, .78)
}

.footer-banner-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem
}

.footer-brand {
    max-width: 420px
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none
}

.footer-description {
    line-height: 1.8;
    color: rgba(255, 255, 255, .75)
}

.footer-feature {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .1)
}

.footer-feature h3 {
    margin: 0 0 .5rem;
    color: #fff
}

.footer-feature p {
    color: rgba(255, 255, 255, .7)
}

.footer-feature a {
    color: #fff;
    text-decoration: none;
    font-weight: 700
}

.footer-title {
    margin: 0 0 1.25rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase
}

.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .7rem
}

.footer-nav a {
    color: rgba(255, 255, 255, .72);
    text-decoration: none
}

.footer-nav a:hover {
    color: #fff
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .85rem;
    color: rgba(255, 255, 255, .6)
}

@media(max-width:1000px) {
    .site-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        background: #fff;
        border-bottom: 1px solid #dbe4ee;
        box-shadow: 0 18px 30px rgba(15, 23, 42, .08)
    }

    .site-nav.is-open {
        display: flex
    }

    .nav-toggle {
        display: block
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: .25rem
    }

    .nav-link {
        display: block;
        padding: .75rem;
        border-radius: 8px
    }

    .nav-link:hover {
        background: #f8fafc
    }

    .header-actions {
        margin-top: .5rem
    }

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

    .article-sidebar {
        display: block
    }

    .article-toc {
        position: relative;
        top: auto;
        max-height: none;
        margin-bottom: 2rem
    }

    .article-toc-inner {
        max-height: none
    }

    .article-content {
        max-width: none
    }

    .footer-banner {
        grid-template-columns: 1fr
    }

    .footer-banner-actions {
        justify-content: flex-start
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:640px) {
    .header-container {
        min-height: 64px
    }

    .site-nav {
        top: 64px
    }

    .page-hero {
        padding: 3rem 0
    }

    .page-hero h1 {
        font-size: clamp(2.3rem, 12vw, 3.4rem)
    }

    .hero-lead {
        font-size: 1.08rem
    }

    .page-main {
        padding: 2.5rem 0 4rem
    }

    .article-toc-inner {
        padding: .85rem
    }

    .article-content>h2 {
        margin-top: 3rem
    }

    .card-grid,
    .grid {
        grid-template-columns: 1fr
    }

    .article-end-cta {
        grid-template-columns: 1fr;
        padding: 1.6rem
    }

    .cta-actions {
        justify-content: flex-start
    }

    .footer-grid {
        grid-template-columns: 1fr
    }

    .footer-container {
        padding: 3rem 1rem 1.5rem
    }

    .footer-banner {
        padding: 1.5rem;
        border-radius: 20px
    }

    .table-scroll {
        border-radius: 12px
    }
}