/* PassAfer — blog article detail (shared by all posts) */

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

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

.main-article {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 72px;
}

.post-wrap {
    width: 100%;
}

/* ── Masthead ── */
.post-masthead {
    padding: 36px 0 28px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 70% 80% at 0% 0%, rgba(34, 211, 238, 0.1), transparent 55%);
}

.post-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.post-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

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

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

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

.cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.post-date-inline {
    font-size: 0.82rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.post-masthead h1 {
    margin: 0;
    max-width: 40rem;
    font-size: clamp(1.65rem, 3.6vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.28;
}

.post-lead {
    max-width: 40rem;
    margin: 16px 0 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.post-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 22px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.post-meta-bar .meta-sep {
    color: #475569;
}

.tag-pill {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ── Two-column body ── */
.post-body-section {
    padding-top: 32px;
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 40px;
    align-items: start;
}

.article-content {
    min-width: 0;
    font-size: 1.02rem;
    line-height: 1.8;
    color: var(--text);
}

.article-content > p {
    margin: 0 0 1.15em;
}

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

.article-content a:not(.btn):hover {
    color: #67e8f9;
}

.article-content .related-list a {
    color: var(--text);
    text-decoration: none;
}

.article-content .btn {
    text-decoration: none;
}

.article-content .btn-primary {
    color: var(--bg);
}

.article-content .btn-outline:hover {
    color: var(--accent);
}

.article-content h2 {
    margin: 2.1em 0 0.7em;
    padding-top: 0.2em;
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
    scroll-margin-top: 88px;
}

.article-content h3 {
    margin: 1.5em 0 0.55em;
    font-size: 1.05rem;
    font-weight: 650;
    color: #f1f5f9;
    scroll-margin-top: 88px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.2em;
    padding-left: 1.25em;
}

.article-content li {
    margin: 0.35em 0;
}

.article-content li::marker {
    color: var(--accent);
}

.article-content code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 0.12em 0.4em;
    border-radius: 5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: #a5f3fc;
}

/* ── Callouts ── */
.callout {
    margin: 1.4em 0;
    padding: 14px 16px 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.callout.tip {
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.06);
}

.callout.warning {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.06);
}

.callout-title {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.callout.warning .callout-title {
    color: var(--danger);
}

.callout p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

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

/* ── Tables ── */
.data-table-wrap {
    margin: 1.3em 0 1.5em;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.data-table th {
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.45);
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

/* ── Steps ── */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 1.2em 0 1.5em;
}

.step-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.step-num {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.6;
}

.step-body {
    min-width: 0;
}

.step-body p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.step-body p + p {
    margin-top: 0.55em;
}

.step-body strong {
    color: #f8fafc;
}

/* ── End CTA ── */
.article-cta {
    margin: 2.4em 0 0;
    padding: 22px 22px 20px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse 80% 80% at 100% 0%, rgba(34, 211, 238, 0.1), transparent 50%),
        var(--bg-elevated);
}

.article-cta h2 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 1.15rem;
}

.article-cta p {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.article-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-cta .btn {
    text-decoration: none;
}

/* ── Related reads ── */
.related-reads {
    margin: 2.2em 0 0;
    padding-top: 1.4em;
    border-top: 1px solid var(--border);
}

.related-reads h2 {
    margin: 0 0 14px;
    padding: 0;
    font-size: 1.05rem;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list a {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    text-decoration: none;
    color: var(--text);
}

.related-list a:hover {
    border-color: var(--accent);
}

.related-kicker {
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.related-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ── Sidebar ── */
.post-aside {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-toc {
    padding: 16px 16px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.post-toc-title {
    margin: 0 0 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

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

.post-toc li {
    margin: 0;
}

.post-toc a {
    display: grid;
    grid-template-columns: 1.6em 1fr;
    gap: 6px;
    padding: 6px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.45;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}

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

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

.post-toc .toc-num {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: #64748b;
}

.sidebar-cta {
    padding: 16px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: var(--radius);
    background: rgba(34, 211, 238, 0.06);
}

.sidebar-cta h2 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

.sidebar-cta p {
    margin: 0 0 14px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.sidebar-cta .btn {
    width: 100%;
    text-decoration: none;
}

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

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

    .post-toc a {
        padding: 8px 0;
    }

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