/* Blog article. Tokens come from layout.css. */

.grid-bg {
    display: none;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 3px;
    pointer-events: none;
    background: transparent;
}

.reading-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
}

.post-masthead {
    padding: 148px 0 40px;
}

.post-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.post-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.post-breadcrumb a:hover {
    color: var(--accent);
}

.post-breadcrumb .bc-current {
    color: var(--text-primary);
}

.post-meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    margin-bottom: 16px;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.post-date-inline {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.post-masthead h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.35;
    margin-bottom: 16px;
    max-width: 18em;
}

.post-lead {
    max-width: 720px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.9;
}

.post-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.tag-pill {
    display: inline-flex;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-primary);
}

.post-body-section {
    padding: 24px 0 96px;
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 48px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    align-items: start;
}

#articleContent {
    min-width: 0;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-primary);
}

#articleContent > p {
    margin: 0 0 1.2em;
    max-width: 68ch;
}

#articleContent a:not(.btn) {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

#articleContent a:not(.btn):hover {
    color: var(--accent-light);
}

#articleContent h2 {
    margin: 2.2em 0 0.7em;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--accent);
    scroll-margin-top: 100px;
}

#articleContent h3 {
    margin: 1.6em 0 0.5em;
    font-size: 18px;
    font-weight: 700;
    scroll-margin-top: 100px;
}

#articleContent ul:not(.step-list) {
    list-style: disc;
    margin: 0 0 1.4em;
    padding-left: 1.3em;
    max-width: 68ch;
    color: var(--text-secondary);
}

#articleContent ul:not(.step-list) li + li {
    margin-top: 0.4em;
}

#articleContent code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.callout {
    margin: 1.8em 0;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-surface);
    max-width: 68ch;
}

.callout.tip {
    border-color: rgba(29, 78, 216, 0.25);
}

.callout.warning {
    border-color: rgba(180, 83, 9, 0.35);
    background: #fffbeb;
}

.callout p {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.8;
}

.callout p + p {
    margin-top: 0.7em;
}

.data-table {
    width: 100%;
    max-width: 68ch;
    margin: 1.6em 0 2em;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    background: var(--bg-surface);
}

.data-table td:first-child {
    font-weight: 700;
    white-space: nowrap;
}

.step-list {
    margin: 1.4em 0 2em;
    padding: 0;
    list-style: none;
    counter-reset: step;
    max-width: 68ch;
}

.step-list > li {
    position: relative;
    margin: 0;
    padding: 18px 0 18px 48px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    line-height: 1.8;
}

.step-list > li::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.post-aside {
    position: sticky;
    top: 108px;
}

.post-toc {
    padding: 20px 20px 8px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
    margin-bottom: 16px;
}

.post-toc-title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
}

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

.post-toc a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.post-toc li:last-child a {
    border-bottom: none;
}

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

.sidebar-cta {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-surface);
}

.sidebar-cta h2 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
}

.sidebar-cta p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.article-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 36px;
    margin: 56px 0 0;
    padding: 28px 32px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: 16px;
    background: var(--bg-surface);
}

.article-cta-copy {
    flex: 1 1 260px;
    min-width: 0;
}

.article-cta-kicker {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
}

#articleContent .article-cta h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-cta-lead {
    margin: 0;
    max-width: 48ch;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.75;
}

.article-cta-actions {
    display: flex;
    flex: 0 1 220px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.article-cta-actions .btn {
    width: 100%;
    padding: 12px 18px;
}

#articleContent .article-cta-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

#articleContent .article-cta-back:hover {
    color: var(--accent);
}

.related-reads {
    margin: 40px 0 0;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

.related-reads h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.related-reads p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 60ch;
}

@media (max-width: 960px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .post-aside {
        position: static;
        order: -1;
    }

    .post-toc ol {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 20px;
    }
}

@media (max-width: 720px) {
    .post-masthead {
        padding: 128px 0 28px;
    }

    .post-toc ol {
        grid-template-columns: 1fr;
    }

    .data-table td:first-child {
        white-space: normal;
    }

    .article-cta {
        padding: 24px;
        gap: 20px;
    }

    .article-cta-actions {
        flex-basis: 100%;
    }
}
