/* Insights (the blog index and every post), "the firm" direction (DESIGN.md, color.firm). Loads after /home.css and reads its
   tokens and shell classes (top bar, type, buttons, bands, the case file panel, footer). The newest article sits on ink in the
   first screen of the index; inside an article a quoted block is the one thing on ink. Everything else reads on paper. */

/* ---------- Index: the newest article on ink ---------- */
/* One heading style for an article title in a list and a section heading inside an article. */
.b-latest__title, .b-row__title, .b-prose h2 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.b-latest__title { margin: 20px 0 12px; }
body.firm .b-latest .b-latest__title a { color: var(--gold-light); text-decoration: none; transition: color 0.3s ease; }
body.firm .b-latest .b-latest__title a:hover { color: var(--teal); }
.b-latest__say { color: var(--text-muted); margin-bottom: 24px; }
.b-empty { color: var(--text-dim); }

/* ---------- Index: the earlier articles as ruled rows ---------- */
section.b-first { padding-top: 48px; }
.b-list { border-top: 1px solid var(--bg); }
.b-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr); gap: 32px; align-items: baseline; padding: 32px 0; border-bottom: 1px solid var(--text-muted); }
.b-row:last-child { border-bottom: 0; padding-bottom: 0; }
.b-row__date, .b-meta { font-size: 14px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.b-row__title { margin-bottom: 8px; }
body.firm .b-row__title a { text-decoration: none; transition: color 0.3s ease; }
body.firm .b-row__title a:hover { color: var(--teal-deep); }
.b-row__what p { color: var(--text-dim); max-width: 40em; }
.b-row__go { justify-self: end; white-space: nowrap; }

/* ---------- Article ---------- */
.b-head { padding-top: 48px; padding-bottom: 48px; }
.b-back { display: inline-block; font-size: 14px; margin-bottom: 24px; }
.b-head__title { max-width: 20em; }
.b-head .f-lead { max-width: 40em; margin-bottom: 0; }
.b-post { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 64px; align-items: start; border-top: 1px solid var(--bg); padding: 48px 0 96px; }
.b-meta { position: sticky; top: 96px; display: grid; gap: 4px; }
.b-meta span { font-weight: 600; color: var(--bg); }

/* The article text, as the markdown renderer writes it: bare elements, no classes. */
.b-prose { font-size: 18px; min-width: 0; }
.b-prose > * { max-width: 36em; }
.b-prose p, .b-prose ul, .b-prose ol { margin-bottom: 20px; }
.b-prose h2 { margin: 48px 0 12px; }
.b-prose h3 { font-size: 18px; font-weight: 600; line-height: 1.4; margin: 32px 0 8px; }
.b-prose > :first-child { margin-top: 0; }
.b-prose > :last-child { margin-bottom: 0; }
.b-prose ul, .b-prose ol { padding-left: 24px; }
.b-prose li { margin-bottom: 8px; }
.b-prose li::marker { color: var(--teal-deep); }
.b-prose strong { font-weight: 600; }
body.firm .b-prose a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 4px; transition: color 0.3s ease; }
body.firm .b-prose a:hover { color: var(--bg); }
.b-prose code { font-family: inherit; font-weight: 600; color: var(--teal-deep); }
.b-prose pre { background: var(--gold); padding: 24px; margin: 32px 0; overflow-x: auto; font-size: 16px; }
.b-prose pre code { font-family: ui-monospace, Consolas, monospace; font-weight: 400; color: var(--bg); }
.b-prose hr { border: 0; border-top: 1px solid var(--text-muted); margin: 40px 0; }
.b-prose img { display: block; max-width: 100%; height: auto; margin: 32px 0; }

/* A real table across the column; only on a phone does it become a block that scrolls sideways. */
.b-prose table { width: 100%; border-collapse: collapse; margin: 32px 0; font-size: 16px; line-height: 1.5; }
.b-prose th, .b-prose td { padding: 12px 24px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--text-muted); }
.b-prose th { font-weight: 600; border-bottom-color: var(--bg); }
.b-prose tr:last-child td { border-bottom: 0; }

/* A quoted block is the article's exhibit, so it sits on ink. */
.b-prose blockquote { background: var(--bg); color: var(--text); padding: 32px; margin: 32px 0; font-size: 16px; }
/* 16px text, so the measure is restated to keep the block as wide as the 18px paragraphs around it. */
.b-prose > blockquote, .b-prose > pre { max-width: 40.5em; }
.b-prose blockquote > :last-child { margin-bottom: 0; }
.b-prose blockquote p, .b-prose blockquote ul { margin-bottom: 12px; }
.b-prose blockquote strong { color: var(--gold-light); }
.b-prose blockquote code { color: var(--teal); }
.b-prose blockquote li::marker { color: var(--teal); }
body.firm .b-prose blockquote a { color: var(--teal); }
body.firm .b-prose blockquote a:hover { color: var(--gold-light); }

/* ---------- Not found ---------- */
.b-missing { padding-top: 96px; padding-bottom: 96px; }

/* ---------- Closing band on ink ---------- */
.b-close { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: end; }
.b-close .f-sub { max-width: 36em; }
.b-close__go { text-align: right; }
.b-close__go p { margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* ---------- Tablet and phone ---------- */
@media (max-width: 960px) {
    section.b-first { padding-top: 16px; }
    .b-row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
    .b-row__go { justify-self: start; margin-top: 8px; }
    .b-head { padding-top: 40px; padding-bottom: 32px; }
    .b-post { grid-template-columns: 1fr; gap: 24px; padding: 24px 0 64px; }
    .b-meta { position: static; display: flex; gap: 16px; }
    .b-missing { padding-top: 64px; padding-bottom: 64px; }
    .b-close { grid-template-columns: 1fr; gap: 32px; }
    .b-close__go { text-align: left; }
}

@media (max-width: 560px) {
    .b-latest .f-case__head { flex-direction: column; gap: 0; }
    .b-prose blockquote { padding: 24px; }
    .b-prose table { display: block; overflow-x: auto; }
    .b-close__go .f-btn { width: 100%; text-align: center; }
}

/* home.css already stops every transition under body.firm. The design checker reads each stylesheet on its own, so the guard is repeated here. */
@media (prefers-reduced-motion: reduce) {
    body.firm .b-latest .b-latest__title a, body.firm .b-row__title a, body.firm .b-prose a { transition: none; }
}
