/* Blog index and articles. Loaded only on /blog/ pages. Uses the tokens in site.css. */

.blog-main { padding: 0 0 104px; }
.blog-wrap { width: min(760px, calc(100% - 80px)); margin-inline: auto; }
.blog-wrap.with-toc { width: min(1100px, calc(100% - 80px)); }

/* ---------- Shared header (index + article) ---------- */
.blog-hero, .post-header { padding: 40px 0 56px; text-align: center; border-bottom: 1px solid var(--line); }
.blog-hero .blog-wrap, .post-header .blog-wrap { display: flex; flex-direction: column; align-items: center; }
.blog-main h1 { font-size: clamp(52px, 7vw, 96px); line-height: .98; letter-spacing: -.02em; margin: 0 0 20px; text-wrap: balance; }
.post-header h1 { font-size: clamp(42px, 5.4vw, 72px); line-height: 1.02; max-width: 17ch; }
.lede { font-size: 19px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 54ch; text-wrap: pretty; }
.blog-hero .eyebrow { margin-bottom: 18px; }

.crumbs { margin: 0 0 44px; font-size: 13px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; padding: 5px 14px; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow-xs); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; max-width: 46ch; }
.crumbs li:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--sunk); }

.dateline { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.byline::before, .updated::before { content: "·"; margin: 0 9px; color: var(--line-strong); }
.draft-banner { background: var(--peach-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; font-size: 14px; line-height: 1.5; margin: -20px 0 24px; max-width: 520px; }

/* Reading progress: a mint line under the sticky header */
.progress { position: sticky; top: 68px; z-index: 25; height: 3px; margin-bottom: -3px; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--leaf)); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Index ---------- */
.blog-index { padding-top: 56px; width: min(1100px, calc(100% - 80px)); }
.empty-note { margin: 0 auto; text-align: center; color: var(--muted); font-size: 15px; max-width: 46ch; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.post-list article { height: 100%; }
.post-list a {
  height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post-list a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.post-cover { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--sunk); border-bottom: 1px solid var(--line); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.post-list a:hover .post-cover img { transform: scale(1.035); }
.post-text { display: flex; flex-direction: column; flex: 1; padding: 24px 26px 26px; }
.post-meta { display: flex; gap: 9px; font-size: 12.5px; color: var(--faint); margin-bottom: 12px; }
.post-meta > * + *::before { content: "·"; margin-right: 9px; color: var(--line-strong); }
.post-list h2 { font-size: clamp(28px, 2.8vw, 34px); line-height: 1.05; letter-spacing: -.015em; margin: 0 0 12px; text-wrap: balance; }
.post-list p { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.read-chip { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 550; }
.read-chip span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.post-list a:hover .read-chip span { transform: translateX(3px); }

/* Newest post spans the grid: image left, words right */
.post-list .is-featured { grid-column: 1 / -1; }
.post-list .is-featured a { flex-direction: row; }
.post-list .is-featured .post-cover { flex: 1.25; aspect-ratio: auto; min-height: 380px; border-bottom: 0; border-right: 1px solid var(--line); }
.post-list .is-featured .post-text { flex: 1; padding: 40px 40px 38px; justify-content: center; }
.post-list .is-featured h2 { font-size: clamp(34px, 3.6vw, 48px); }
.post-list .is-featured .post-text::before { content: "Latest"; align-self: flex-start; margin-bottom: 16px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--mint-soft); color: var(--leaf); font-size: 12px; font-weight: 600; }

/* ---------- Article layout ---------- */
.post-header + .blog-wrap { padding-top: 56px; }
.blog-layout.has-toc { display: grid; grid-template-columns: 200px minmax(0, 34em); gap: 72px; justify-content: center; align-items: start; }
.post { min-width: 0; max-width: 34em; }
.blog-wrap:not(.with-toc) .post { margin-inline: auto; }

.toc { font-size: 13.5px; line-height: 1.4; }
.toc-label { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--muted); transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--ink); border-left-color: var(--leaf); font-weight: 550; }

/* ---------- Article body ---------- */
.post-body { font-size: 17.5px; line-height: 1.72; color: var(--ink-2); overflow-wrap: break-word; }
.post-body > *:first-child { margin-top: 0; }
.post-body > p:first-child::first-letter { float: left; font-family: var(--font-display); font-size: 4.1em; line-height: .82; padding: .06em .08em 0 0; color: var(--leaf); }
.post-body p { margin: 0 0 1.1em; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body h2 { font-size: clamp(32px, 3.6vw, 42px); line-height: 1.05; letter-spacing: -.015em; color: var(--ink); margin: 1.7em 0 .5em; scroll-margin-top: 100px; }
.post-body h3 { font-size: 20px; line-height: 1.3; letter-spacing: -.025em; color: var(--ink); margin: 1.4em 0 .4em; scroll-margin-top: 100px; }
.post-body a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--mint); transition: text-decoration-color .15s, color .15s; }
.post-body a:hover { color: var(--leaf); text-decoration-color: var(--leaf); }
.post-body ul, .post-body ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.post-body li { margin: .4em 0; padding-left: .2em; }
.post-body ul li::marker { color: var(--leaf); }
.post-body ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: .15em; }
.post-body li:has(> input[type="checkbox"]) { padding-left: 0; }
.post-body li > input[type="checkbox"] {
  appearance: none; width: .92em; height: .92em; margin: 0 .55em 0 0;
  border: 1.5px solid var(--line-strong); border-radius: 4px; vertical-align: -.12em;
  background: var(--surface); pointer-events: none;
}
.post-body ol li::marker { color: var(--leaf); font-weight: 600; font-variant-numeric: tabular-nums; }
.post-body li > ul, .post-body li > ol { margin: .3em 0 0; }
.post-body blockquote { position: relative; margin: 1.8em 0; padding: 4px 0 4px 28px; border-left: 2px solid var(--mint); font-family: var(--font-display); font-style: italic; font-size: 1.55em; line-height: 1.25; color: var(--ink); }
.post-body blockquote p { margin: 0; }
.post-body .table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.post-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.post-body th, .post-body td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.post-body tr:last-child td { border-bottom: 0; }
.post-body th { background: var(--paper); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.post-body figure { margin: 2em 0; }
.post-body figure:first-child, .post-body p:first-child + figure { margin-top: 1.4em; }
.post-body img { border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.post-body figcaption { margin-top: 10px; font-family: var(--font-display); font-style: italic; font-size: 17px; line-height: 1.4; color: var(--muted); text-align: center; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.post-body :not(pre) > code { background: var(--sunk); border: 1px solid var(--line); padding: .08em .35em; border-radius: 6px; }
.post-body pre { margin: 0 0 1.4em; padding: 18px 20px; background: var(--ink); color: #f4f2ea; border-radius: var(--r-md); overflow-x: auto; line-height: 1.55; }
.post-body pre code { font-size: 13px; color: inherit; background: none; border: 0; padding: 0; }
.post-body hr { border: 0; height: 24px; margin: 2em 0; background: radial-gradient(circle, var(--line-strong) 2px, transparent 2.5px) center / 18px 24px repeat-x; width: 72px; margin-inline: auto; }

/* ---------- Article CTA: inverted ink card ---------- */
.post-cta {
  margin-top: 56px; padding: 40px 36px 38px; overflow: hidden; text-align: center;
  background: var(--ink); color: #f4f2ea; border-radius: var(--r-lg);
  box-shadow: 0 24px 50px -28px rgba(14, 21, 18, .6);
  --dot: rgba(168, 231, 177, .3);
}
.post-cta.has-dots::before { background: radial-gradient(70% 80% at 50% 100%, rgba(168, 231, 177, .25), transparent 75%); }
.post-cta .eyebrow { margin-bottom: 14px; color: rgba(244, 242, 234, .7); }
.post-cta .eyebrow::before { background: var(--mint); box-shadow: 0 0 0 3px rgba(168, 231, 177, .18); }
.post-cta h2 { font-size: clamp(34px, 4.4vw, 48px); line-height: 1.02; margin: 0 0 14px; color: #f6f4ee; }
.post-cta h2 em { color: var(--mint); }
.post-cta p:not(.eyebrow) { color: rgba(244, 242, 234, .68); font-size: 15.5px; margin: 0 auto 24px; max-width: 40ch; }
.post-cta .button { background: #f6f4ee; color: var(--ink); border-color: #f6f4ee; }
.post-cta .button span[aria-hidden] { background: var(--ink); color: var(--mint); }

/* ---------- Related ---------- */
.related { margin-top: 64px; }
.related h2 { font-size: 38px; margin: 0 0 18px; }
.related-empty { color: var(--muted); font-size: 15px; margin: 0; }
.related-empty a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--mint); }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.related-list a { display: block; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); transition: transform .2s, box-shadow .2s; }
.related-list a:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.related-list .post-meta { margin-bottom: 6px; }
.related-title { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.08; letter-spacing: -.01em; margin: 0 0 6px; }
.related-excerpt { display: block; color: var(--muted); font-size: 14px; line-height: 1.55; }
.related-list a:hover .related-title { color: var(--leaf); }

/* ---------- Responsive ---------- */
@media (min-width: 901px) { .toc { position: sticky; top: 100px; max-height: calc(100svh - 130px); overflow: auto; } }
@media (max-width: 1050px) {
  .blog-wrap, .blog-wrap.with-toc, .blog-index { width: calc(100% - 48px); }
  .blog-layout.has-toc { grid-template-columns: 190px minmax(0, 34em); gap: 40px; }
}
@media (max-width: 900px) {
  .blog-layout.has-toc { grid-template-columns: 1fr; gap: 28px; }
  .post-list .is-featured a { flex-direction: column; }
  .post-list .is-featured .post-cover { min-height: 0; aspect-ratio: 1200 / 630; border-right: 0; border-bottom: 1px solid var(--line); }
  .post-list .is-featured .post-text { padding: 28px; }
}
@media (max-width: 760px) {
  .blog-wrap, .blog-wrap.with-toc, .blog-index { width: calc(100% - 32px); }
  .progress { top: 62px; }
  .blog-hero, .post-header { padding: 28px 0 40px; }
  .crumbs { margin-bottom: 30px; font-size: 12px; max-width: 100%; }
  .crumbs li { max-width: 22ch; }
  .post-list { grid-template-columns: 1fr; }
  .blog-index, .post-header + .blog-wrap { padding-top: 36px; }
  .lede { font-size: 16.5px; }
  .post-body { font-size: 16.5px; }
  .post-cta { padding: 32px 22px; }
  .post-cta .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .post-cover img, .read-chip span { transition: none; } }
.post-body h2 strong { font-weight: 400; font-style: italic; color: var(--leaf); }
.post-body > p:first-child::first-letter { font-size: 3.5em; line-height: .9; padding: .04em .1em 0 0; }
.post-header h1 { font-size: clamp(40px, 4.8vw, 64px); }
