/* Blog (/blog and /blog/<slug>). Loaded after ds.css and site-ds.css, only on blog pages.
   Source: tools/blog/blog.css, copied by tools/build-blog.mjs. Bump ?v= in build-blog.mjs on change. */

/* ---- post header ---------------------------------------------------------- */
.bl-hero .dv-hero__copy { max-width: 46rem; gap: var(--ds-space-4); }
.bl-title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); text-wrap: balance; }
.bl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2) var(--ds-space-4); margin: 0; font-size: var(--ds-text-sm); color: var(--ds-ink-3); }
.bl-meta > * + :not(.dv-chip)::before { content: ""; display: inline-block; width: 3px; height: 3px; margin-inline-end: var(--ds-space-4); border-radius: 50%; background: var(--ds-ink-4); vertical-align: middle; }
.bl-meta .dv-chip { text-decoration: none; }
a.dv-chip:hover { color: var(--ds-ink); }

/* ---- article --------------------------------------------------------------- */
.bl-section { padding-top: 0; }
.bl-article { grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 1.5rem + 2vw, 3rem); }
.bl-article > * { min-width: 0; }
/* about 70 characters a line; tables, code and figures may run wider than the text */
.bl-body { max-width: none; font-size: 1.0625rem; }
.dv-guide .bl-body > :where(p, ul, ol, h2, h3) { max-width: 57ch; }
.bl-body > :where(h2) { margin-top: 2.2em; }
.dv-guide .bl-body > :where(.ds-table-wrap, .ds-code, figure) { margin-block: 1.5em; }
.bl-body p { text-wrap: pretty; }
.bl-body :where(code) { font-size: 0.9em; overflow-wrap: anywhere; }
.bl-body .ds-code :where(code) { overflow-wrap: normal; }
.bl-body .ds-table :where(td, th) { vertical-align: top; }
.bl-body .ds-table td:not(.ds-table__primary) { white-space: normal; }  /* prose tables wrap on phones */
.bl-mono-table td:last-child code { white-space: nowrap; overflow-wrap: normal; }

/* TL;DR: the takeaway before the article */
.bl-tldr { max-width: 42rem; padding: var(--ds-space-5) var(--ds-space-6); border: 1px solid var(--lp-edge); border-inline-start: 3px solid var(--ds-accent); border-radius: var(--lp-radius); background: var(--lp-surface); }
.bl-tldr__title { margin: 0 0 var(--ds-space-2); font: 600 var(--ds-text-xs)/1 var(--ds-font-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ds-accent); }
.bl-tldr ul { display: grid; gap: var(--ds-space-2); margin: 0; padding-inline-start: 1.1em; font-size: 1.0625rem; color: var(--ds-ink); line-height: 1.5; }

/* pass-rate bar inside a table cell */
.bl-body .bl-score td:nth-child(2) { white-space: nowrap; }
.bl-bar { display: inline-block; width: 4.5rem; height: 0.5rem; margin-inline-end: var(--ds-space-3); border-radius: 999px; vertical-align: 0.05em;
  background: linear-gradient(90deg, var(--ds-accent) var(--p), color-mix(in oklab, var(--ds-ink) 14%, transparent) var(--p)); }
.bl-score tfoot :where(th, td) { font-weight: 600; color: var(--ds-ink); }
@media (max-width: 40rem) { .bl-score .bl-bar { display: none; } .bl-score :where(td, th) { padding-inline: 0.5rem; } .bl-score td:first-child { min-width: 8.5rem; } }

/* timeline figure */
.bl-timeline { margin: 0; padding: var(--ds-space-5); border: 1px solid var(--lp-edge); border-radius: var(--lp-radius); background: var(--lp-surface); }
.bl-timeline ol { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ds-space-3); margin: 0; padding: var(--ds-space-6) 0 0; list-style: none; }
.bl-timeline ol::before { content: ""; position: absolute; top: 0.4rem; inset-inline: 0.4rem; height: 2px; background: var(--lp-edge); }
.bl-timeline li { position: relative; display: grid; gap: 0.125rem; font-size: var(--ds-text-sm); line-height: 1.35; color: var(--ds-ink-2); }
.bl-timeline li::before { content: ""; position: absolute; top: calc(-1 * var(--ds-space-6)); width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--ds-ink-3); box-shadow: 0 0 0 3px var(--lp-surface); }
.bl-timeline li.is-miss::before { background: var(--ds-amber-ink, #d9a441); }
.bl-timeline li.is-go::before { background: var(--ds-accent); }
.bl-timeline li + li { margin-top: 0; }
.bl-timeline b { color: var(--ds-ink); font-weight: 600; }
.bl-timeline figcaption { margin-top: var(--ds-space-4); font-size: var(--ds-text-sm); color: var(--ds-ink-3); }
@media (max-width: 40rem) {
  .bl-timeline ol { grid-template-columns: minmax(0, 1fr); padding: 0 0 0 var(--ds-space-6); }
  .bl-timeline ol::before { top: 0.4rem; bottom: 0.4rem; inset-inline: 0.35rem auto; width: 2px; height: auto; }
  .bl-timeline li::before { top: 0.2rem; left: calc(-1 * var(--ds-space-6)); }
}

/* sources and related */
.bl-sources { font-size: var(--ds-text-sm); color: var(--ds-ink-3); }
.bl-sources :where(a) { color: var(--ds-ink-2); }
.bl-related { display: grid; gap: var(--ds-space-4); max-width: 46rem; padding-top: var(--ds-space-8); border-top: 1px solid var(--lp-edge); }
.bl-related > h2 { font: 600 var(--ds-text-h4)/1.2 var(--ds-font-display); color: var(--ds-ink); }
.bl-related .lp-tile__text { color: var(--ds-ink-3); }

/* ---- index ----------------------------------------------------------------- */
.bl-index { display: grid; gap: var(--ds-space-8); }
.bl-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); }
.bl-filter[hidden] { display: none; }
.bl-rss { display: inline-flex; align-items: center; gap: var(--ds-space-2); color: var(--ds-ink-2); font-size: var(--ds-text-sm); text-decoration: none; }
.bl-rss:hover { color: var(--ds-ink); }
.bl-rss svg { width: 1rem; height: 1rem; color: var(--ds-accent); }
.bl-feature { display: grid; gap: var(--ds-space-4); padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border: 1px solid var(--lp-edge); border-radius: var(--lp-radius-lg); background: var(--lp-surface); box-shadow: var(--lp-shadow); color: var(--ds-ink); text-decoration: none; transition: border-color var(--ds-dur-1), transform var(--ds-dur-2) var(--ds-ease-out); }
.bl-feature { position: relative; overflow: hidden; }
.bl-feature > :not(.bl-feature__art) { position: relative; }
.bl-feature__art { position: absolute; inset-block: 0; inset-inline-end: clamp(1rem, 6vw, 6rem); display: none; align-items: center; color: var(--ds-accent); opacity: 0.14; pointer-events: none; }
.bl-feature__art .ds-icon { width: 13rem; height: 13rem; stroke-width: 1; }
@media (min-width: 60rem) { .bl-feature__art { display: flex; } }
.bl-feature:hover { border-color: var(--lp-edge-2); transform: translateY(-2px); }
.bl-feature__kicker { font: 600 var(--ds-text-xs)/1 var(--ds-font-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ds-accent); }
.bl-feature__title { max-width: 32ch; font: 650 clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem)/1.08 var(--ds-font-display); font-stretch: 108%; letter-spacing: -0.035em; text-wrap: balance; }
.bl-feature__text { max-width: 62ch; color: var(--ds-ink-2); }
.bl-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--lp-edge); }
.bl-list > li { border-bottom: 1px solid var(--lp-edge); }
.bl-list > li[hidden] { display: none; }
.bl-item { display: grid; gap: var(--ds-space-2); padding: var(--ds-space-6) 0; color: var(--ds-ink); text-decoration: none; }
.bl-item__title { font: 600 var(--ds-text-xl)/1.2 var(--ds-font-display); font-stretch: 104%; letter-spacing: -0.02em; text-wrap: balance; }
.bl-item:hover .bl-item__title { text-decoration: underline; text-decoration-color: var(--ds-accent); text-underline-offset: 4px; }
.bl-item__text { max-width: 68ch; color: var(--ds-ink-2); }
@media (prefers-reduced-motion: reduce) { .bl-feature, .bl-feature:hover { transition: none; transform: none; } }
