/* ============================================================================
   blog.css — the public blog: listing + article.

   Loads AFTER theme.css/paper.css and consumes their tokens, so both themes are
   handled by the token layer rather than by a second set of colour rules here.
   Everything is namespaced `bl-` (listing/shell) or `bx-` (article body content,
   which is the same prefix the editor writes into stored HTML — see
   EDITORIAL_CLASSES in controllers/admin/blog.controller.js).
   ========================================================================== */

:root {
  /* Reading serif. Source Serif 4 is drawn for screen text and carries a real
     italic; the fallbacks are the two faces most likely to already be installed
     if the webfont never lands, both of which have similar x-height so the
     measure does not reflow noticeably. */
  --font-read: 'Source Serif 4', Charter, 'Iowan Old Style', Georgia, Cambria, serif;

  /* The article measure. Deliberately narrower than --w-prose (760px): at 20px
     serif, 760px runs to ~78 characters, past the point where the eye reliably
     finds the next line. 690px lands around 68. */
  --bl-measure: 690px;
  --bl-rail:    226px;
}

/* ══════════════════════════════════════════════════════════════════════════
   Shared: category chip
   ═════════════════════════════════════════════════════════════════════════ */
.bl-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 11px 5px 9px; border-radius: var(--radius-pill);
  color: var(--bl-cat-color, var(--accent));
  background: color-mix(in srgb, var(--bl-cat-color, var(--accent)) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--bl-cat-color, var(--accent)) 22%, transparent);
  line-height: 1;
}
.bl-cat i { font-size: 13px; }
/* The chip lives inside column flex containers (the card and the feature body),
   where the default `align-items: stretch` blows a 90px pill out to the full
   card width. It has to shrink to its label everywhere it is used. */
.bl-card > .bl-cat,
.bl-feature-body > .bl-cat,
.bx-header > .bl-cat { align-self: flex-start; }

/* ══════════════════════════════════════════════════════════════════════════
   Shared: cover renderer (partials/blog-cover.ejs)
   Three kinds behind one box so a card's geometry never depends on which one
   the editor picked — an icon post and a photo post must line up in a grid.
   ═════════════════════════════════════════════════════════════════════════ */
.bl-cover {
  position: relative; overflow: hidden;
  background: var(--bg-elevated-2);
  display: grid; place-items: center;
}
.bl-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* TWO layers, and the second is what makes this work on the light theme. The
   stored `cover_gradient` values were authored at .10–.15 alpha against a near
   black ground; on bone stock they are all but invisible, which is why an emoji
   cover read as a grey box. The category tint underneath gives every cover a
   floor of presence and ties it to the chip above it, while the stored gradient
   still paints on top and remains the thing the admin's swatch picker controls. */
.bl-cover--glyph {
  background-image:
    var(--bl-cover-grad, none),
    linear-gradient(140deg,
      color-mix(in srgb, var(--bl-cat-color, var(--accent)) 20%, transparent),
      color-mix(in srgb, var(--bl-cat-color, var(--accent)) 7%,  transparent));
  background-color: var(--bg-elevated);
}
/* A light source from the top-left, so the tile reads as a surface rather than a
   flat swatch. Strength is a token because the same white that lifts a tile on
   bone stock BLEACHES it on the dark ground — at .34 the top third of a dark
   cover greys out and the tint stops reading as a colour at all. */
:root                    { --bl-sheen: .10; }
[data-theme="light"]     { --bl-sheen: .34; }
.bl-cover--glyph::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(130% 110% at 22% 0%,
              rgba(255,255,255,var(--bl-sheen)), transparent 58%);
  pointer-events: none;
}
.bl-cover-glyph {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  line-height: 1; color: var(--bl-cat-color, var(--accent));
}
.bl-cover-glyph i { font-size: inherit; }

/* ══════════════════════════════════════════════════════════════════════════
   LISTING
   ═════════════════════════════════════════════════════════════════════════ */
.bl-wrap { max-width: var(--w-content); margin: 0 auto; padding: 56px 24px 96px; }

.bl-head { max-width: 720px; margin: 0 0 44px; }
.bl-head-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.bl-head-label::before {
  content: ''; width: 22px; height: 1px; background: currentColor; opacity: .5;
}
.bl-head h1 {
  font-family: var(--font-head);
  font-size: clamp(34px, 5.5vw, 54px); font-weight: 800; letter-spacing: -.025em;
  line-height: 1.06; color: var(--text-primary); margin: 0 0 16px;
}
.bl-head p {
  font-family: var(--font-read);
  font-size: 19px; line-height: 1.62; color: var(--text-body); margin: 0; max-width: 60ch;
}

/* ── Filter chips ─────────────────────────────────────────────────────────── */
.bl-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 0 26px; margin-bottom: 34px;
  border-bottom: 1px solid var(--border-subtle);
}
.bl-chip {
  font-family: var(--font-sans);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-body);
  background: transparent; border: 1px solid var(--border);
  padding: 7px 14px; border-radius: var(--radius-pill);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.bl-chip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.bl-chip[aria-pressed="true"] {
  color: var(--text-on-brand); background: var(--brand-fill); border-color: var(--brand-fill);
}
.bl-chip i { font-size: 15px; }

/* ── Featured post ────────────────────────────────────────────────────────── */
.bl-feature {
  display: grid; grid-template-columns: 1fr; gap: 0;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  overflow: hidden; background: var(--bg-elevated);
  box-shadow: var(--ring); text-decoration: none;
  margin-bottom: 52px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.bl-feature:hover {
  border-color: var(--border-hover); transform: translateY(-2px);
  box-shadow: 0 12px 34px -18px rgba(74,39,16,.34);
}
.bl-feature .bl-cover { aspect-ratio: 16 / 9; }
.bl-feature .bl-cover-glyph { font-size: 96px; }
.bl-feature-body { padding: 30px 30px 32px; display: flex; flex-direction: column; }
.bl-feature-flag {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-subtle); margin-bottom: 14px;
}
.bl-feature h2 {
  font-family: var(--font-head);
  font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.02em;
  line-height: 1.15; color: var(--text-primary); margin: 14px 0 12px;
}
.bl-feature p {
  font-family: var(--font-read);
  font-size: 17px; line-height: 1.62; color: var(--text-body); margin: 0 0 22px;
}
@media (min-width: 900px) {
  .bl-feature { grid-template-columns: 1.15fr 1fr; align-items: stretch; }
  .bl-feature .bl-cover { aspect-ratio: auto; height: 100%; min-height: 340px; }
  .bl-feature-body { padding: 40px; justify-content: center; }
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.bl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(304px, 1fr)); gap: 30px 28px;
}
.bl-card {
  display: flex; flex-direction: column; text-decoration: none;
  background: transparent; border-radius: var(--radius-lg);
}
.bl-card-cover {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16 / 10; margin-bottom: 16px;
  transition: border-color .2s ease, transform .2s ease;
}
.bl-card-cover .bl-cover { width: 100%; height: 100%; }
.bl-card-cover .bl-cover-glyph { font-size: 46px; }
.bl-card:hover .bl-card-cover { border-color: var(--border-hover); transform: translateY(-3px); }
.bl-card h3 {
  font-family: var(--font-head);
  font-size: 19px; font-weight: 700; letter-spacing: -.012em; line-height: 1.32;
  color: var(--text-primary); margin: 12px 0 8px;
  transition: color .15s ease;
}
.bl-card:hover h3 { color: var(--accent); }
.bl-card p {
  font-family: var(--font-read);
  font-size: 15.5px; line-height: 1.6; color: var(--text-body); margin: 0 0 16px;
  flex: 1;
  /* Three lines keeps every card's meta row on the same baseline; an excerpt
     that runs long otherwise pushes one card's byline out of the row. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}
.bl-card:hover { text-decoration: none; }

/* ── Byline (shared by cards + feature) ───────────────────────────────────── */
.bl-by {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-sans);
  font-size: 12.5px; color: var(--text-subtle); margin-top: auto;
}
.bl-by-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-1, #80461B), var(--accent-3, #C9793F));
  color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: 0;
}
.bl-by-name { color: var(--text-body); font-weight: 600; }
.bl-by-dot { opacity: .45; }

.bl-empty {
  text-align: center; padding: 80px 20px; color: var(--text-subtle);
  border: 1px dashed var(--border); border-radius: var(--radius-xl);
}
.bl-empty i { font-size: 40px; display: block; margin-bottom: 14px; opacity: .7; }
.bl-empty p { font-family: var(--font-read); font-size: 17px; margin: 0; }
/* Shown by blog.js when a filter matches nothing — never on first paint, or a
   JS-less visitor sees "no posts" under a grid that is plainly full of posts. */
.bl-noresult { display: none; }
.bl-noresult.is-on { display: block; }

/* ── Newsletter strip ─────────────────────────────────────────────────────── */
.bl-sub {
  margin-top: 72px; padding: 44px 36px; border-radius: var(--radius-xl);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  box-shadow: var(--ring); text-align: center;
}
.bl-sub h3 {
  font-family: var(--font-head); font-size: 23px; font-weight: 800;
  letter-spacing: -.015em; color: var(--text-primary); margin: 0 0 8px;
}
.bl-sub p {
  font-family: var(--font-read); font-size: 16px; color: var(--text-body);
  margin: 0 auto 22px; max-width: 52ch;
}
.bl-sub-row { display: flex; gap: 10px; max-width: 430px; margin: 0 auto; }
.bl-sub-row input {
  flex: 1; min-width: 0; padding: 11px 15px; font-family: var(--font-sans); font-size: 14px;
  color: var(--text-primary); background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); outline: none;
}
.bl-sub-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
@media (max-width: 520px) { .bl-sub-row { flex-direction: column; } }

/* ══════════════════════════════════════════════════════════════════════════
   ARTICLE
   ═════════════════════════════════════════════════════════════════════════ */

/* Reading progress. Fixed, 3px, painted by scaleX from blog-post.js so the
   scroll handler never touches layout. */
.bx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.bx-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent-1, #80461B), var(--accent-3, #C9793F));
  transform: scaleX(0); transform-origin: 0 50%;
}

.bx-shell { max-width: var(--w-content); margin: 0 auto; padding: 40px 24px 100px; }

.bx-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  color: var(--text-subtle); text-decoration: none; margin-bottom: 34px;
}
.bx-back:hover { color: var(--accent); }

/* Header sits on the measure, not the full shell, so the title's line length
   matches the body it introduces. */
.bx-header { max-width: var(--bl-measure); margin: 0 auto 34px; }
.bx-title {
  font-family: var(--font-head);
  font-size: clamp(31px, 5.2vw, 47px); font-weight: 800;
  letter-spacing: -.028em; line-height: 1.08;
  color: var(--text-primary); margin: 18px 0 0;
  /* Stops a two-word orphan on the last line of a long headline. */
  text-wrap: balance;
}
.bx-standfirst {
  font-family: var(--font-read);
  font-size: 20.5px; line-height: 1.55; color: var(--text-body);
  margin: 18px 0 0; font-weight: 400;
}

.bx-byline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 30px 0 0; padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-sans);
}
.bx-byline-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-1, #80461B), var(--accent-3, #C9793F));
  color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.bx-byline-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bx-byline-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.bx-byline-meta {
  font-size: 13px; color: var(--text-subtle);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.bx-byline-meta .dot { opacity: .45; }
.bx-share { display: flex; gap: 7px; margin-left: auto; }
.bx-share-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: transparent; color: var(--text-subtle);
  cursor: pointer; font-size: 16px; text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.bx-share-btn:hover {
  color: var(--accent); border-color: var(--border-hover); background: var(--accent-tint);
}
.bx-share-btn.is-copied { color: var(--success); border-color: var(--success); }

/* Cover — full measure-plus, the one element allowed to break the text column. */
.bx-cover {
  max-width: 940px; margin: 40px auto 8px;
  border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border-subtle); box-shadow: var(--ring);
}
.bx-cover .bl-cover { aspect-ratio: 16 / 8; }
.bx-cover .bl-cover-glyph { font-size: 92px; }
.bx-cover-cap {
  max-width: 940px; margin: 12px auto 0; text-align: center;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--text-subtle);
}

/* ── Layout: rail + measure ───────────────────────────────────────────────── */
.bx-layout {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
  margin-top: 46px;
  /* align-items:start is what lets the sticky rail slide — a stretched grid item
     is as tall as its row and has nowhere to move. */
  align-items: start;
  justify-content: center;
}
.bx-main { max-width: var(--bl-measure); width: 100%; margin: 0 auto; min-width: 0; }

@media (min-width: 1180px) {
  .bx-layout {
    grid-template-columns: var(--bl-rail) minmax(0, var(--bl-measure)) var(--bl-rail);
    gap: 0 44px;
  }
  .bx-rail { grid-column: 1; }
  .bx-main { grid-column: 2; }
}

/* ── Table of contents ────────────────────────────────────────────────────── */
.bx-rail { display: none; }
@media (min-width: 1180px) {
  .bx-rail {
    display: block; position: sticky; top: 96px; align-self: start;
    /* A sticky element taller than its slot pins with its lower half permanently
       unreachable — no amount of page scrolling moves it. */
    max-height: calc(100vh - 130px); overflow-y: auto;
    padding-right: 8px;
  }
}
.bx-toc-title {
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; color: var(--text-subtle);
  margin: 0 0 14px;
}
.bx-toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.bx-toc-list a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-family: var(--font-sans); font-size: 13px; line-height: 1.45;
  color: var(--text-subtle); text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.bx-toc-list a:hover { color: var(--text-primary); }
.bx-toc-list a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.bx-toc-list .lvl-3 a { padding-left: 26px; font-size: 12.5px; }

/* Mobile contents — a real <details>, so it works with no JS. */
.bx-toc-m {
  display: block; margin: 0 auto 30px; max-width: var(--bl-measure);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--bg-elevated); overflow: hidden;
}
@media (min-width: 1180px) { .bx-toc-m { display: none; } }
.bx-toc-m > summary {
  cursor: pointer; list-style: none; padding: 13px 16px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 700;
  color: var(--text-primary); display: flex; align-items: center; gap: 8px;
}
.bx-toc-m > summary::-webkit-details-marker { display: none; }
.bx-toc-m > summary i { color: var(--accent); font-size: 16px; }
.bx-toc-m .bx-toc-list { border-left: none; padding: 0 16px 14px; }

/* ══════════════════════════════════════════════════════════════════════════
   ARTICLE BODY — the stored HTML. Every selector under .bx-body must survive
   the sanitizer's allowlist (see cleanBlogHtml), so nothing here relies on a
   class the editor cannot actually emit.
   ═════════════════════════════════════════════════════════════════════════ */
.bx-body {
  font-family: var(--font-read);
  font-size: 20px; line-height: 1.75; color: var(--text-body);
  /* Serif numerals default to old-style in some faces, which reads oddly in a
     stat sentence; lining figures keep "225 words" upright. */
  font-variant-numeric: lining-nums;
}
.bx-body > *:first-child { margin-top: 0; }

.bx-body p { margin: 0 0 1.45em; }
.bx-body h2, .bx-body h3, .bx-body h4 {
  font-family: var(--font-head); color: var(--text-primary);
  letter-spacing: -.02em; scroll-margin-top: 92px;
}
.bx-body h2 { font-size: 29px; font-weight: 800; line-height: 1.22; margin: 2em 0 .55em; }
.bx-body h3 { font-size: 23px; font-weight: 700; line-height: 1.28; margin: 1.75em 0 .5em; }
.bx-body h4 { font-size: 19px; font-weight: 700; line-height: 1.35; margin: 1.6em 0 .45em; }
/* An h1 inside the body would compete with the article title; render it as an h2. */
.bx-body h1 { font-family: var(--font-head); font-size: 29px; font-weight: 800; line-height: 1.22; color: var(--text-primary); margin: 2em 0 .55em; letter-spacing: -.02em; }

.bx-body a {
  color: var(--accent); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: text-decoration-color .15s ease;
}
.bx-body a:hover { text-decoration-color: currentColor; }
.bx-body strong, .bx-body b { font-weight: 600; color: var(--text-primary); }
.bx-body em, .bx-body i:not([class]) { font-style: italic; }
.bx-body mark, .bx-body .bx-mark {
  background: var(--accent-tint); color: var(--text-primary);
  padding: .05em .25em; border-radius: 3px;
}

.bx-body ul, .bx-body ol { margin: 0 0 1.45em; padding-left: 1.35em; }
.bx-body li { margin-bottom: .5em; padding-left: .2em; }
.bx-body li::marker { color: var(--accent); }
.bx-body ul ul, .bx-body ol ol, .bx-body ul ol, .bx-body ol ul { margin: .5em 0 0; }

/* Lead paragraph — larger opening, the editor's `bx-lead`. */
.bx-body .bx-lead {
  font-size: 22.5px; line-height: 1.6; color: var(--text-primary);
  margin-bottom: 1.3em;
}

/* Standard quote */
.bx-body blockquote {
  margin: 1.7em 0; padding: 2px 0 2px 22px;
  border-left: 3px solid var(--accent);
  color: var(--text-body); font-style: italic;
}
.bx-body blockquote p:last-child { margin-bottom: 0; }

/* Pull quote — display type, breaks the measure slightly. */
.bx-body blockquote.bx-pullquote {
  border: none; padding: 8px 0; margin: 2em 0;
  font-family: var(--font-head); font-style: normal;
  font-size: clamp(23px, 3.4vw, 30px); font-weight: 700; line-height: 1.32;
  letter-spacing: -.018em; color: var(--text-primary);
  text-align: center;
  position: relative;
}
.bx-body blockquote.bx-pullquote::before,
.bx-body blockquote.bx-pullquote::after {
  content: ''; display: block; width: 46px; height: 2px; margin: 0 auto;
  background: var(--accent); opacity: .55;
}
.bx-body blockquote.bx-pullquote::before { margin-bottom: 22px; }
.bx-body blockquote.bx-pullquote::after  { margin-top: 22px; }

/* Callouts */
.bx-body .bx-callout {
  display: flex; gap: 13px;
  margin: 1.7em 0; padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--bx-c, var(--accent)) 26%, transparent);
  background: color-mix(in srgb, var(--bx-c, var(--accent)) 8%, transparent);
  font-size: 17.5px; line-height: 1.62;
}
.bx-body .bx-callout > *:first-child { margin-top: 0; }
.bx-body .bx-callout > *:last-child  { margin-bottom: 0; }
.bx-body .bx-callout p { margin-bottom: .6em; font-size: inherit; }
.bx-body .bx-info { --bx-c: var(--info); }
.bx-body .bx-tip  { --bx-c: var(--success); }
.bx-body .bx-warn { --bx-c: var(--warning); }
.bx-body .bx-note { --bx-c: var(--accent); }
/* The glyph is a real inline <i class="ph-light ph-*"> that the editor inserts as
   part of the callout markup — NOT a ::before with a hardcoded codepoint. Icon
   font PUA codepoints move between releases, so a pseudo-element glyph silently
   becomes the wrong picture on a Phosphor version bump. */
.bx-body .bx-callout > i[class*="ph-"] {
  font-size: 21px; line-height: 1.35; flex-shrink: 0; color: var(--bx-c, var(--accent));
}
/* The text column of a callout — everything that is not the icon. */
.bx-body .bx-callout-body { flex: 1; min-width: 0; margin: 0; }

/* Code */
.bx-body code {
  font-family: var(--font-mono); font-size: .84em;
  background: var(--bg-elevated-2); color: var(--accent);
  padding: .15em .42em; border-radius: 5px;
  border: 1px solid var(--border-subtle);
}
.bx-body pre {
  margin: 1.7em 0; padding: 20px 22px; overflow-x: auto;
  background: var(--bg-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 14.5px; line-height: 1.65;
  color: var(--text-primary);
}
.bx-body pre code {
  background: none; border: none; padding: 0; font-size: inherit; color: inherit;
}
.bx-body kbd, .bx-body .bx-kbd {
  font-family: var(--font-mono); font-size: .8em;
  padding: .15em .45em; border-radius: 5px;
  background: var(--bg-elevated-2); border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border-strong); color: var(--text-primary);
}

/* Media */
.bx-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.bx-body figure, .bx-body .bx-figure { margin: 2em 0; }
.bx-body figure img { display: block; width: 100%; }
.bx-body figcaption, .bx-body .bx-caption {
  font-family: var(--font-sans); font-size: 13px; line-height: 1.55;
  color: var(--text-subtle); text-align: center; margin-top: 11px;
}

.bx-body hr {
  border: none; margin: 2.6em auto; width: 92px;
  border-top: 1px solid var(--border-strong);
}

/* Tables — the wrapper is added by blog-post.js so a wide table scrolls inside
   itself instead of making the whole page scroll sideways. */
.bx-tablewrap { overflow-x: auto; margin: 1.9em 0; -webkit-overflow-scrolling: touch; }
.bx-body table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-sans); font-size: 15px; line-height: 1.55;
}
.bx-body table th, .bx-body table td {
  padding: 11px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}
.bx-body table th {
  font-weight: 700; color: var(--text-primary); white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
  font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
}
.bx-body table tr:last-child td { border-bottom: none; }
.bx-body table td { color: var(--text-body); }

/* ── Article footer ───────────────────────────────────────────────────────── */
.bx-foot { max-width: var(--bl-measure); margin: 60px auto 0; }
.bx-foot-share {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 22px 0; border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-sans); font-size: 13.5px; color: var(--text-subtle);
}
.bx-foot-share .bx-share { margin-left: 0; }

.bx-cta {
  margin-top: 44px; padding: 38px 32px; text-align: center;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  box-shadow: var(--ring);
}
.bx-cta h3 {
  font-family: var(--font-head); font-size: 24px; font-weight: 800;
  letter-spacing: -.02em; color: var(--text-primary); margin: 0 0 9px;
}
.bx-cta p {
  font-family: var(--font-read); font-size: 16.5px; line-height: 1.6;
  color: var(--text-body); margin: 0 auto 22px; max-width: 46ch;
}

/* ── Related ──────────────────────────────────────────────────────────────── */
.bx-related { max-width: 940px; margin: 76px auto 0; }
.bx-related-title {
  font-family: var(--font-sans); font-size: 11px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; color: var(--text-subtle);
  margin: 0 0 24px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle);
}
.bx-related .bl-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px; }
.bx-related .bl-card-cover { aspect-ratio: 16 / 9; }
.bx-related .bl-card h3 { font-size: 17px; }
.bx-related .bl-card p { font-size: 14.5px; -webkit-line-clamp: 2; line-clamp: 2; }

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bl-feature, .bl-card-cover, .bl-card h3, .bx-share-btn, .bl-chip { transition: none; }
  .bl-feature:hover, .bl-card:hover .bl-card-cover { transform: none; }
  html { scroll-behavior: auto; }
}

/* ── Narrow ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .bl-wrap, .bx-shell { padding-left: 18px; padding-right: 18px; }
  .bx-body { font-size: 18.5px; line-height: 1.72; }
  .bx-body .bx-lead { font-size: 20.5px; }
  .bx-body h2 { font-size: 25px; }
  .bx-body h3 { font-size: 20.5px; }
  .bx-standfirst { font-size: 18px; }
  .bx-cover .bl-cover-glyph { font-size: 62px; }
  .bx-share { margin-left: 0; width: 100%; }
  .bx-cta { padding: 30px 22px; }
  .bl-sub { padding: 34px 22px; }
}
