.blog-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px 24px 80px;
}

.blog-wrap h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    margin: 0 0 14px;
    line-height: 1.3;
}

.blog-wrap .lead {
    color: var(--text-muted);
    margin: 0 0 40px;
}

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

.post-list time,
.post-meta {
    display: block;
    color: var(--accent);
    font-family: monospace;
    font-size: 0.85rem;
}

.post-list a {
    display: inline-block;
    margin-top: 4px;
    font-size: 1.15rem;
    font-weight: 600;
}

.post-list p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.post-empty {
    color: var(--text-muted);
}

.blog-browse {
    max-width: 760px;
    margin: 24px auto 0;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-browse a,
.archive-months a,
.post-topics a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.blog-browse a[aria-current],
.blog-browse a:hover,
.archive-months a:hover,
.topic-grid a:hover,
.post-topics a:hover,
.post-neighbors a:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.blog-browse a:focus-visible,
.archive-months a:focus-visible,
.archive-list a:focus-visible,
.topic-grid a:focus-visible,
.post-topics a:focus-visible,
.post-neighbors a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.archive-months {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.archive-months span {
    margin-left: 10px;
    color: var(--text-muted);
}

.archive-section + .archive-section {
    margin-top: 44px;
}

.archive-section h2 {
    font-size: 1.3rem;
}

.archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-list li {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.archive-list time {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-top: 3px;
}

.archive-list a,
.post-neighbors a {
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.topic-grid,
.post-topics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-grid a {
    display: block;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 600;
}

.topic-grid span,
.post-neighbors span {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.post-topics {
    margin-top: 32px;
}

.post-neighbors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 48px;
}

.post-neighbors a {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.post-neighbors span {
    margin: 0 0 8px;
}

.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}

.blog-pagination a,
.pagination-unavailable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    white-space: nowrap;
}

.blog-pagination a:hover {
    background: var(--bg-elevated);
}

.blog-pagination a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.pagination-unavailable,
.pagination-status {
    color: var(--text-muted);
}

.pagination-status {
    text-align: center;
}

.post-meta {
    margin: 0 0 36px;
}

.post-toc {
    margin: 0 0 36px;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-wrap: anywhere;
}

.post-toc-title {
    margin: 0 0 12px;
    font-weight: 700;
}

.post-toc ol,
.post-toc ul {
    margin: 0;
    padding-left: 1.4em;
}

.post-toc ul {
    margin-top: 6px;
    font-size: 0.92em;
}

.post-toc li + li {
    margin-top: 6px;
}

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

.post-toc a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.post-body h2 {
    margin: 2.2em 0 0.6em;
    font-size: 1.4rem;
}

.post-body h3 {
    margin: 1.8em 0 0.5em;
    font-size: 1.15rem;
}

.post-body p,
.post-body li {
    line-height: 1.9;
}

.post-body ul,
.post-body ol {
    padding-left: 1.4em;
}

.post-body blockquote {
    margin: 1.4em 0;
    padding: 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

.post-body code {
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.post-body pre {
    overflow-x: auto;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.post-body pre code {
    padding: 0;
    border: 0;
    background: none;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.post-table {
    margin: 28px 0;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.post-table:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.post-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.75;
}

.post-table th,
.post-table td {
    min-width: 8rem;
    padding: 14px 18px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.post-table thead {
    background: var(--bg-elevated-2);
}

.post-table th {
    color: var(--accent);
    font-weight: 600;
}

.post-table tbody tr {
    border-top: 1px solid var(--border);
}

.post-table tbody tr:nth-child(even) {
    background: var(--bg-elevated);
}

.post-table td:first-child {
    font-weight: 600;
}

/* Two-column comparisons keep the label compact and give explanations room. */
.post-table table:has(thead th:nth-child(2):last-child) th:first-child,
.post-table table:has(thead th:nth-child(2):last-child) td:first-child {
    width: 30%;
    min-width: 8rem;
}

.post-back {
    margin-top: 56px;
}

.post-updated {
    display: block;
    margin-top: 6px;
}

.post-revisions {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.post-revisions h2 {
    font-size: 1.2rem;
}

.post-revisions ul {
    padding-left: 1.4em;
}

.post-revisions li {
    margin-top: 16px;
}

.post-revisions time {
    color: var(--accent);
    font-size: 0.85rem;
}

.post-revisions p {
    margin: 4px 0 0;
    color: var(--text-muted);
    line-height: 1.8;
}

@media (max-width: 640px) {
    .archive-list li,
    .topic-grid,
    .post-neighbors {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-list li {
        gap: 4px;
    }

    .post-table th,
    .post-table td {
        padding: 12px;
    }

    .post-body h2,
    .post-body h3 {
        /* The blog's mobile header displays its navigation on multiple rows. */
        scroll-margin-top: 100px;
    }
}

.post-author {
    display: block;
    margin-bottom: 6px;
}

.post-author-box {
    margin-top: 56px;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.post-author-box h2 {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.post-author-box p {
    margin: 0 0 8px;
    line-height: 1.8;
}

.post-author-box p:last-child {
    margin-bottom: 0;
}
