/* ============================================================
   Blog (v18). Styles the same markup api/blog.js renders
   (.post-list, .post-entry*, .post-header, .post-meta, .post-dek,
   .post-body, .post-sources, .post-footer-nav), so it can be moved
   into the live blog's stylesheet unchanged.
   ============================================================ */

/* ---- Heroes: a quiet dawn sky ---- */
.blog-hero .hero-inner { padding-top: 188px; padding-bottom: 112px; }
.blog-hero .page-intro { display: block; margin-bottom: 18px; }
.blog-hero .page-description { margin: 22px auto 0; max-width: 56ch; }
.blog-hero--post .post-header { max-width: 820px; margin: 0 auto; }
.blog-hero--post h1 { font-size: clamp(2rem, 3.35vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; max-width: none; }
.post-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 22px; font-size: 0.875rem; color: var(--ink-600); }
.post-meta a { color: var(--lavender-700); }
.post-meta a:hover { color: var(--lavender-800); }
.post-meta .sep { color: var(--ink-300); }
.post-tag { color: var(--lavender-700); }
.post-tag + .post-tag::before { content: ", "; color: var(--ink-500); }
.post-dek { margin: 22px auto 0; max-width: 56ch; font-size: 1.125rem; line-height: 1.6; color: var(--ink-700); }
@media (max-width: 900px) { .blog-hero .hero-inner { padding-top: 136px; padding-bottom: 80px; } }

/* ---- The list of posts ---- */
.blog-list { padding-top: 96px; }
.post-list { max-width: 880px; margin: 0 auto; border-top: 1px solid var(--ink-900); }
.post-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 72px; align-items: start; padding: 52px 0; border-bottom: 1px solid var(--line); color: inherit; }
.post-entry-body { display: block; }
.post-entry-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 18px; font-size: 0.8125rem; font-weight: 500; }
.post-entry-topic { color: var(--lavender-700); }
.post-entry-when { color: var(--ink-500); font-weight: 450; }
.post-entry-title { display: block; font-family: var(--serif); font-weight: 450; font-size: clamp(1.5rem, 1.95vw, 1.75rem); line-height: 1.28; letter-spacing: -0.012em; color: var(--ink-900); transition: color .2s ease; max-width: 26ch; }
.post-entry-summary { display: block; margin-top: 16px; font-size: 1rem; line-height: 1.7; color: var(--ink-600); max-width: 58ch; }
.post-entry-cover { width: 264px; margin-top: 4px; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--r); }
.post-entry-arrow { font-size: 1.25rem; color: var(--lavender-600); transition: transform .2s ease; }
.post-entry:hover .post-entry-title { color: var(--lavender-700); }
.post-entry:hover .post-entry-arrow { transform: translateX(4px); }
.post-empty { max-width: 880px; margin: 0 auto; color: var(--ink-600); }
@media (max-width: 640px) { .post-entry { grid-template-columns: 1fr; gap: 12px; } .post-entry-arrow, .post-entry-cover { display: none; } }

/* ---- One post: a comfortable reading column ---- */
.blog-article { padding-top: 88px; }
.blog-article article { max-width: 68ch; margin: 0 auto; }
.post-cover { margin: 0 0 48px; }
.post-cover img { width: 100%; height: auto; border-radius: var(--r-card); }
.post-cover figcaption { margin-top: 10px; font-size: 0.8125rem; color: var(--ink-500); }
.post-body { font-size: 1.125rem; line-height: 1.75; color: var(--ink-800); }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { margin-top: 2.2em; font-family: var(--serif); font-weight: 450; font-size: clamp(1.5rem, 1.95vw, 1.75rem); line-height: 1.2; letter-spacing: -0.015em; color: var(--ink-900); }
.post-body h3 { margin-top: 1.8em; font-size: 1.125rem; font-weight: 600; color: var(--ink-900); }
.post-body h2 + *, .post-body h3 + * { margin-top: 0.6em; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: 0.45em; }
.post-body li::marker { color: var(--lavender-600); }
.post-body a { color: var(--lavender-700); border-bottom: 1px solid var(--lavender-200); }
.post-body a:hover { border-bottom-color: var(--lavender-700); }
.post-body strong { color: var(--ink-900); font-weight: 600; }
.post-body blockquote { padding-left: 20px; border-left: 2px solid var(--lavender-500); font-family: var(--serif); font-size: 1.375rem; line-height: 1.45; color: var(--ink-900); }
.post-body code { font-family: var(--mono); font-size: 0.875em; background: var(--sand); padding: 1px 5px; border-radius: 4px; }
.post-body img { max-width: 100%; border-radius: var(--r); }
.post-sources { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-sources h2 { font-family: var(--font); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; color: var(--ink-500); }
.post-sources ol { margin-top: 14px; padding-left: 1.3em; font-size: 0.875rem; line-height: 1.55; color: var(--ink-600); }
.post-sources li + li { margin-top: 8px; }
.post-sources li::marker { color: var(--ink-400); }
.post-sources a { color: var(--ink-700); overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.post-sources a:hover { color: var(--lavender-700); border-bottom-color: var(--lavender-300); }
.post-footer-nav { max-width: 68ch; margin: 56px auto 0; }
.back-link { color: var(--lavender-700); font-weight: 500; }
.back-link::before { content: "\2190  "; }
.back-link:hover { color: var(--lavender-800); }

/* 1) the blog heroes size to their content (they were filling the screen) */
.blog-hero { min-height: 0; }

/* ---- Blog index masthead: a large "Blog" with the latest post set against
   it on the right. The hero gets the homepage's quill cursor and ink. ---- */
.blog-hero--index .hero-inner { text-align: left; padding-top: 188px; padding-bottom: 56px; }
.blog-mast-dek { margin-top: 22px; max-width: 36ch; font-size: 1.1875rem; line-height: 1.55; color: var(--ink-700); }
.blog-mast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 64px; align-items: end; }
.blog-mast-title { justify-self: stretch; text-align: left; max-width: none; margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(4.5rem, 9vw, 8rem); line-height: 0.9; letter-spacing: -0.045em; color: var(--ink-900); }
.blog-hero--index h1.blog-mast-title { font-size: clamp(4.5rem, 9vw, 8rem); margin: 0; max-width: none; }
.blog-latest { display: grid; gap: 10px; padding-top: 20px; border-top: 1px solid var(--ink-900); color: inherit; margin-bottom: 6px; }
.blog-latest-label { font-size: 0.8125rem; font-weight: 500; color: var(--lavender-700); }
.blog-latest-title { text-wrap: balance; font-family: var(--serif); font-weight: 450; font-size: 1.5rem; line-height: 1.22; letter-spacing: -0.012em; color: var(--ink-900); transition: color .2s ease; }
.blog-latest-meta { font-size: 0.875rem; color: var(--ink-600); }
.blog-latest-meta .arr { display: inline-block; margin-left: 6px; color: var(--lavender-600); transition: transform .2s ease; }
.blog-latest:hover .blog-latest-title { color: var(--lavender-700); }
.blog-latest:hover .arr { transform: translateX(4px); }
@media (max-width: 900px) {
    .blog-hero--index .hero-inner { padding-top: 148px; padding-bottom: 72px; }
    .blog-mast { grid-template-columns: 1fr; gap: 56px; }
}
.blog-hero--index + .blog-list .post-list { margin: 0; max-width: none; }
/* The index list spans the full content width, so rows use the space on the right */
.blog-hero--index + .blog-list .post-entry { gap: 96px; }
.blog-hero--index + .blog-list .post-entry-title { max-width: 34ch; }
.blog-hero--index + .blog-list .post-entry-summary { max-width: 68ch; }
.blog-hero--index + .blog-list .post-entry-cover { width: 320px; }
.post-entry-title { text-wrap: pretty; }

/* Post header: left-aligned to the reading column below it */
.blog-hero--post .hero-inner { text-align: left; }
.blog-hero--post .post-header { max-width: 68ch; margin: 0 auto; }
.blog-hero--post .post-meta { justify-content: flex-start; }
.blog-hero--post h1 { margin: 0; }
.blog-hero--post .post-dek { margin: 22px 0 0; }

/* ---- Tables, rules, and the author note in posts written in the repo ---- */
.post-body table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.post-body th { text-align: left; font-weight: 600; color: var(--ink-900); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--ink-900); }
.post-body td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.post-body em { color: var(--ink-600); }
.post-author { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.6; color: var(--ink-600); }
.post-author strong { color: var(--ink-900); font-weight: 600; }
.post-author a { color: var(--lavender-700); }
@media (max-width: 640px) { .post-body table { display: block; overflow-x: auto; } }

/* ---- Topics and authors ---- */
.blog-topics { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin-bottom: 28px; font-size: 0.9375rem; }
.blog-topics-label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-500); }
.blog-topics a { color: var(--ink-800); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.blog-topics a:hover { color: var(--lavender-700); border-bottom-color: var(--lavender-700); }
.blog-topics--foot { margin-top: 40px; }
.post-meta a:hover { color: var(--lavender-700); }
.post-author-name { color: var(--ink-900); font-weight: 600; }
.post-author-name:hover { color: var(--lavender-700); }
.author-background, .author-posts-head, .blog-topics--foot { max-width: 880px; margin-left: auto; margin-right: auto; }
.author-background { margin-bottom: 64px; }
.author-background h2, .author-posts-head { font-family: var(--serif); font-weight: 450; font-size: clamp(1.5rem, 1.95vw, 1.75rem); color: var(--ink-900); margin-bottom: 16px; }
.author-background ul { list-style: disc; padding-left: 1.3em; margin: 0 0 20px; }
.author-background li { padding: 4px 0; color: var(--ink-800); line-height: 1.6; }
.author-background li + li { margin-top: 6px; }
.author-background li::marker { color: var(--lavender-600); }
.author-background p a { color: var(--lavender-700); }
.author-posts-head { margin-bottom: 20px; }
.author-name { display: inline-flex; align-items: center; gap: 14px; }
.author-li { display: inline-flex; width: 26px; height: 26px; color: var(--ink-500); transition: color .15s ease; }
.author-li svg { width: 100%; height: 100%; }
.author-li:hover { color: var(--lavender-700); }
/* Author and topic pages: the header shares the 880px column of the list below */
.page--blog-author .blog-hero--post .post-header,
.page--blog-topic .blog-hero--post .post-header { max-width: 880px; }
.page--blog-author .post-dek, .page--blog-topic .post-dek { max-width: 62ch; }
.blog-topics--hero { margin: 72px 0 0; padding-top: 20px; border-top: 1px solid rgba(30, 35, 48, 0.16); }
.blog-topics--hero a { border-bottom-color: var(--ink-300); }
/* Hit areas hug the text, so the space beside a short title stays open for the quill */
.post-entry-meta, .post-entry-title, .post-entry-summary { width: fit-content; }
/* On phones the meta row wraps; drop the dot separators so none are left dangling at a line end */
@media (max-width: 640px) { .post-meta .sep { display: none; } .post-meta { column-gap: 14px; } }
