/* Charter5m blog — two-column reader layout. Tokens inherited from site.css. */

.blog-layout {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 48px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ---- Left sidebar: archive grouped by year ---- */
.blog-aside {
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    font-size: 14px;
}
.blog-aside__title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 0 0 14px;
    font-weight: 600;
}
.blog-year { margin-bottom: 6px; }
.blog-year > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.blog-year > summary::-webkit-details-marker { display: none; }
.blog-year > summary::before {
    content: "";
    width: 0; height: 0;
    border-left: 5px solid var(--text-secondary);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.15s ease;
}
.blog-year[open] > summary::before { transform: rotate(90deg); }
.blog-year__count { color: var(--text-secondary); font-weight: 400; font-size: 12px; }
.blog-year ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 13px; }
.blog-year li { margin: 0; }
.blog-year a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 10px 5px 12px;
    border-left: 2px solid var(--border);
    line-height: 1.4;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.blog-year a:hover { color: var(--text-primary); border-left-color: var(--text-secondary); }
.blog-year a.is-current {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* ---- Main reading column ---- */
.blog-main { min-width: 0; }
.blog-latest-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--pill-bg);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.blog-main h1 { font-size: 32px; line-height: 1.22; margin: 0 0 12px; letter-spacing: -0.01em; }
.article-meta { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 30px; }
.article-meta a { color: var(--primary); }
.article-meta .dot { margin: 0 7px; opacity: 0.5; }
/* Language pills sit directly under the meta line — same metadata cluster. */
.article-meta:has(+ .post-langs) { margin-bottom: 14px; }

/* ---- "This article in other languages" pills ---- */
.post-langs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 30px;
}
.post-langs__icon { color: var(--text-secondary); opacity: 0.7; flex: none; margin-inline-end: 3px; }
.post-langs__pill {
    display: inline-block;
    font-size: 12.5px;
    line-height: 1.3;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 11px;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.post-langs__pill:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.post-langs__pill.is-current {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--pill-bg);
    font-weight: 600;
}

article p { font-size: 16.5px; line-height: 1.72; color: var(--text-primary); margin: 0 0 18px; }
article h2 { font-size: 22px; margin: 34px 0 12px; letter-spacing: -0.01em; }
article strong { color: var(--primary); font-weight: 600; }
article em { color: var(--text-primary); }
article a { color: var(--primary); }
article table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
article th, article td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; line-height: 1.5; vertical-align: top; }
article th { background: var(--surface); }
article ul { margin: 0 0 18px; padding-left: 22px; }
article li { font-size: 16.5px; line-height: 1.72; margin-bottom: 8px; }

.callout {
    border-left: 3px solid var(--primary);
    background: var(--surface);
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
    margin: 0 0 18px;
}
.callout p { margin: 0; font-size: 15px; }
.cta-box {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 32px 0 0;
}
.cta-box p { font-size: 15px; margin: 0 0 10px; }
.cta-box p:last-child { margin-bottom: 0; }
.disclaimer { font-size: 12.5px; color: var(--text-secondary); margin-top: 28px; line-height: 1.5; }
/* End-of-post footnote block: bias disclosure + trademark line read as one group. */
.disclaimer + .disclaimer { margin-top: 10px; }

/* ---- Prev / next post nav ---- */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.post-nav a {
    flex: 1;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    transition: border-color 0.12s ease;
}
.post-nav a:hover { border-color: var(--primary); }
.post-nav a.next { text-align: right; }
.post-nav span { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.post-nav strong { font-size: 14.5px; color: var(--text-primary); font-weight: 600; }

/* ---- Mobile ---- */
@media (max-width: 880px) {
    .blog-layout { grid-template-columns: 1fr; gap: 8px; padding: 24px 18px 64px; }
    .blog-aside {
        position: static;
        max-height: none;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 14px 16px;
        margin-bottom: 28px;
        background: var(--surface);
    }
    .blog-main h1 { font-size: 27px; }
    .post-nav { flex-direction: column; }
    .post-nav a.next { text-align: left; }
}
