/* Substack-like reading experience — overrides dark site shell when body.article-page */
body.article-page {
    background: #ffffff !important;
    color: #242424 !important;
}

body.article-page .grid-background {
    display: none !important;
}

.article-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.article-topbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    padding: 0.75rem 1.25rem;
    position: relative;
    z-index: 1;
}

.article-topbar-inner {
    max-width: 1220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.article-topbar a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #242424;
    text-decoration: none;
}

.article-topbar a:hover {
    text-decoration: underline;
}

.article-body-wrap {
    flex: 1;
    padding: 2.5rem 1rem 4rem;
}

/* Three-column layout: author | article | sticky article list */
.article-layout {
    display: grid;
    max-width: 1220px;
    margin: 0 auto;
    grid-template-columns: minmax(0, 248px) minmax(0, 720px) minmax(0, 240px);
    gap: 2rem 2.25rem;
    align-items: start;
}

.article-author {
    padding-top: 0.25rem;
}

/* Horizontal byline: small avatar left, text stacked right (reduces visible pixelation) */
.article-author-inner {
    position: sticky;
    top: 1rem;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    align-items: start;
}

.article-author-photo {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0;
    align-self: start;
}

/* Brand isotype (not a headshot): square mark, contained artwork */
.article-author-photo--mark {
    border-radius: 6px;
    object-fit: contain;
    background: #f4f4f4;
    padding: 5px;
    box-sizing: border-box;
}

.article-author-name {
    grid-column: 2;
    grid-row: 1;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: #111;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.article-author-bio {
    grid-column: 2;
    grid-row: 2;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #444;
    margin: 0;
}

.article-main-column {
    min-width: 0;
}

.article-post {
    max-width: 720px;
    margin: 0;
}

.article-sidebar-nav {
    padding-top: 0.25rem;
}

.article-sidebar-nav-inner {
    position: sticky;
    top: 1rem;
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 1rem 1.125rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.article-sidebar-heading {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b6b6b;
    margin: 0 0 0.85rem;
}

.article-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-sidebar-list li {
    margin-bottom: 0.65rem;
}

.article-sidebar-list li:last-child {
    margin-bottom: 0;
}

.article-sidebar-list a {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    color: #242424;
    text-decoration: none;
    line-height: 1.4;
    display: block;
}

.article-sidebar-list a:hover {
    text-decoration: underline;
}

.article-sidebar-list a.is-current {
    font-weight: 700;
    color: #111;
}

.article-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.article-related-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 1rem;
}

.article-related-card {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.article-related-card:hover {
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.article-related .article-related-card + .article-related-card {
    margin-top: 1rem;
}

.article-related-eyebrow {
    display: block;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6b6b;
    margin-bottom: 0.4rem;
}

.article-related-headline {
    display: block;
    font-family: 'Newsreader', 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.article-related-deck {
    display: block;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .article-author {
        order: 1;
    }

    .article-main-column {
        order: 2;
    }

    .article-sidebar-nav {
        order: 3;
    }

    .article-author-inner {
        position: static;
        padding-bottom: 1.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .article-sidebar-nav-inner {
        position: static;
    }
}

.article-kicker {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b6b6b;
    margin-bottom: 0.75rem;
}

.article-title {
    font-family: 'Newsreader', 'Georgia', 'Times New Roman', serif;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #111;
    margin-bottom: 0.75rem;
}

.article-meta {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    color: #6b6b6b;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.article-content {
    font-family: 'Newsreader', 'Georgia', serif;
    font-size: 1.25rem;
    line-height: 1.65;
    color: #242424;
}

.article-content p {
    margin: 0 0 1.25rem;
}

.article-content h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
    margin: 2.25rem 0 1rem;
}

.article-content h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    color: #111;
}

.article-content ul {
    margin: 0 0 1.25rem 1.25rem;
    padding: 0;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 2rem 0;
}

.article-content hr.section-rule {
    margin: 2.5rem 0;
}

.article-content .lead {
    font-size: 1.35rem;
    line-height: 1.55;
    color: #363636;
}

.article-content .compare-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0 2rem;
    -webkit-overflow-scrolling: touch;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.45;
}

.article-content th,
.article-content td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.article-content th {
    background: #fafafa;
    font-weight: 600;
    color: #111;
}

.article-content td:first-child {
    font-weight: 600;
}

.article-figure {
    margin: 2rem 0;
}

.article-figure img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.article-figure figcaption {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8125rem;
    color: #6b6b6b;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.article-content .callout {
    border-left: 3px solid #111;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #363636;
}

.article-content .tldr {
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
}

.article-content .tldr ul {
    margin-bottom: 0;
}

/* Footer: keep site footer readable on white scroll area */
body.article-page footer.hub-footer {
    margin-top: 0;
}

/* script.js wraps .f-logo in <a>; inline link breaks flex vertical alignment */
body.article-page .hub-footer .f-top {
    align-items: center;
}

body.article-page .hub-footer .f-top > a {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

body.article-page .hub-footer .f-logo {
    height: 1.75rem;
    width: auto;
    object-fit: contain;
    display: block;
    transform: translateY(2px);
}

/* Optical align with wordmark (PNG padding / text metrics) */
body.article-page .hub-footer .f-tagline {
    margin: 0;
    padding: 0;
    line-height: 1.35;
    transform: translateY(3px);
}
