/* =========================================================
   Another Boring Tech Blog — Paper of Record
   Components (.abtb-*)
   Depends on colors_and_type.css (tokens).
   ========================================================= */

/* ---------- Shell ---------- */

.abtb-shell {
  max-width: var(--w-shell);
  margin: 0 auto;
  padding: 0 var(--sp-8);
}
.abtb-container {
  max-width: var(--w-container);
  margin: 0 auto;
}
.abtb-prose {
  max-width: var(--w-prose);
  margin: 0 auto;
}

/* ---------- Reading progress ---------- */

.abtb-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 50;
  pointer-events: none;
}
.abtb-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 80ms linear;
}

/* ---------- Running head (top strip) ---------- */

.abtb-running-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3) 0 var(--sp-2);
  border-bottom: 1px solid var(--rule);
}
.abtb-running-head__left  { justify-self: start; }
.abtb-running-head__page  { justify-self: center; }
.abtb-running-head__right { justify-self: end; }
.abtb-running-head > * {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- Masthead ---------- */

.abtb-masthead {
  padding: var(--sp-8) 0 var(--sp-6);
  border-bottom: 1px solid var(--rule-strong);
  position: relative;
}
.abtb-masthead__ribbon {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--rule);
}

/* Cover-page single-line ribbon (home / archive / page / search). Replaces the
   two-sided ribbon above the wordmark on non-single-post pages. */
.abtb-masthead__issue {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) 0 var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.abtb-masthead__issue .sep { color: var(--ink-5); }

.abtb-masthead--cover { padding-top: var(--sp-6); }

/* Running head article variant — center cell is a short deadpan "mood" phrase
   (picked from a rotating bank on each page render). Serif-italic to signal
   editorial voice, distinct from the mono metadata on the flanks. */
.abtb-running-head__mood {
  font-family: var(--font-serif) !important;
  font-style: italic !important;
  font-size: var(--fs-xs) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--ink-3) !important;
}
.abtb-masthead__ribbon .issue {
  display: inline-flex;
  gap: var(--sp-4);
  font-variant-numeric: tabular-nums;
}
.abtb-masthead__title-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-7) 0 var(--sp-4);
}
.abtb-masthead__title-row--centered {
  grid-template-columns: 1fr;
  place-items: center;
}
.abtb-masthead__title-row--centered .abtb-masthead__blurb-left,
.abtb-masthead__title-row--centered .abtb-masthead__blurb-right { display: none; }
.abtb-wordmark {
  text-align: center;
  text-decoration: none;
  color: var(--ink-1);
  display: inline-block;
  line-height: 1;
}
.abtb-wordmark em {
  font-style: italic;
  color: var(--accent);
  font-weight: 900;
}
.abtb-wordmark__tag {
  display: block;
  margin-top: var(--sp-3);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-md);
  color: var(--ink-3);
  letter-spacing: 0;
}
.abtb-masthead__blurb-left,
.abtb-masthead__blurb-right {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  max-width: 28ch;
  line-height: var(--lh-normal);
}
.abtb-masthead__blurb-left  { text-align: right; }
.abtb-masthead__blurb-right { text-align: left; }
.abtb-masthead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--ink-1);
}

/* ---------- Primary nav ---------- */

.abtb-nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--rule);
}
.abtb-nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
}
.abtb-nav a[aria-current="page"] { color: var(--accent); }
.abtb-nav a:hover { color: var(--accent); }

/* Mode toggle — sun / moon icon pair. Shows the icon that represents the
   TARGET mode (click = go there), not the current mode. Label kept visible
   so users unfamiliar with the pattern still read a word.
   !important needed on the hide rule because the base `svg { display: block }`
   would otherwise cascade through when the active-variant rule can't win against
   competing selectors in the future. */
.abtb-nav a.abtb-nav__mode {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--sp-2);
  white-space: nowrap;
}
.abtb-nav__mode .abtb-nav__mode-icon {
  display: none !important;
  width: 14px;
  height: 14px;
  flex: none;
}
:root:not([data-theme="dark"]) .abtb-nav__mode .abtb-nav__mode-icon--moon {
  display: inline-block !important;
}
:root[data-theme="dark"] .abtb-nav__mode .abtb-nav__mode-icon--sun {
  display: inline-block !important;
}
.abtb-nav__mode-label { display: inline; }

/* ---------- Toolbar (theme toggle, cmd-k hint) ---------- */

.abtb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.abtb-iconbtn {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  width: 32px; height: 32px;
  border-radius: var(--r-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.abtb-iconbtn:hover { border-color: var(--ink-2); color: var(--ink-1); }
.abtb-iconbtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.abtb-kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: var(--r-2);
  color: var(--ink-3);
  background: var(--paper-elev);
  font-variant-ligatures: none;
  letter-spacing: 0;
}

/* ---------- Hero grid ---------- */

.abtb-hero {
  display: grid;
  grid-template-columns: 2fr 1px 1fr;
  gap: var(--sp-8);
  padding: var(--sp-10) 0 var(--sp-8);
  border-bottom: 1px solid var(--rule);
}
.abtb-hero--solo {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
}
.abtb-hero__divider {
  background: var(--rule);
  width: 1px;
}
.abtb-hero__secondary {
  display: grid;
  gap: var(--sp-6);
  align-content: start;
}
.abtb-hero__secondary > * + * {
  padding-top: var(--sp-6);
  border-top: 1px solid var(--rule);
}
@media (max-width: 900px) {
  .abtb-hero { grid-template-columns: 1fr; }
  .abtb-hero__divider { display: none; }
}

/* ---------- Post card ---------- */

.abtb-postcard {
  display: grid;
  gap: var(--sp-3);
}
.abtb-postcard__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.abtb-postcard__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
  text-wrap: balance;
  letter-spacing: -0.005em;
  margin: 0;
}
.abtb-postcard__title a { text-decoration: none; }
.abtb-postcard__title a:hover { color: var(--accent); }
.abtb-postcard__dek {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}
.abtb-postcard__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  gap: var(--sp-3);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.abtb-postcard__meta .sep { color: var(--ink-5); }

.abtb-postcard--lead .abtb-postcard__title {
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 800;
  letter-spacing: var(--tr-display);
  line-height: 1.04;
}
.abtb-postcard--lead .abtb-postcard__dek {
  font-size: var(--fs-lg);
}

.abtb-postcard--compact .abtb-postcard__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

/* ---------- Archive list ---------- */

.abtb-archive {
  padding: var(--sp-10) 0 var(--sp-11);
}
.abtb-archive__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--ink-1);
  margin-bottom: var(--sp-7);
}
.abtb-archive__head h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-2xl);
  font-style: italic;
  margin: 0;
  letter-spacing: -0.01em;
}
.abtb-archive__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.abtb-archive__item {
  display: grid;
  grid-template-columns: 60px 1fr 120px 80px;
  gap: var(--sp-5);
  align-items: baseline;
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--rule);
}
.abtb-archive__item:last-child { border-bottom: 0; }
.abtb-archive__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.abtb-archive__title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
.abtb-archive__title a { text-decoration: none; }
.abtb-archive__title a:hover { color: var(--accent); }
.abtb-archive__cat {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
}
.abtb-archive__date {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .abtb-archive__item { grid-template-columns: 40px 1fr 80px; }
  .abtb-archive__cat { display: none; }
}

/* ---------- Article layout ---------- */

.abtb-article {
  display: grid;
  grid-template-columns: 1fr var(--w-sidebar);
  column-gap: var(--sp-11);
  row-gap: 0;
  padding: var(--sp-10) 0 var(--sp-11);
}
/* All post-body blocks live in column 1, stacking vertically. */
.abtb-article > .abtb-article__main,
.abtb-article > .abtb-comments,
.abtb-article > .abtb-related,
.abtb-article > .abtb-newsletter,
.abtb-article > .post-navigation,
.abtb-article > .navigation.post-navigation {
  grid-column: 1;
}
/* Sidebar spans the full height of column 2. */
.abtb-article > .abtb-sidebar {
  grid-column: 2;
  grid-row: 1 / -1;
}
@media (max-width: 960px) {
  .abtb-article {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: var(--sp-9);
  }
  .abtb-article > .abtb-sidebar {
    grid-column: 1;
    grid-row: auto;
  }
}

.abtb-article__head {
  max-width: 760px;
  margin: 0 auto var(--sp-9);
  text-align: center;
}
.abtb-article__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--accent);
  margin-bottom: var(--sp-5);
}
.abtb-article__title {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(36px, 4.8vw, 56px);
  line-height: 1.05;
  letter-spacing: var(--tr-display);
  margin: 0 0 var(--sp-5);
  text-wrap: balance;
}
.abtb-article__dek {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: var(--fs-xl);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 56ch;
  text-wrap: pretty;
}

/* Byline */
.abtb-byline {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  margin-top: var(--sp-7);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.abtb-byline__author { color: var(--ink-1); }
.abtb-byline .sep { color: var(--ink-5); }

/* Prose */
.abtb-prose p,
.abtb-prose ul,
.abtb-prose ol,
.abtb-prose figure,
.abtb-prose .abtb-codeblock,
.abtb-prose .abtb-callout,
.abtb-prose blockquote,
.abtb-prose table {
  margin: 0 0 var(--sp-5);
}
.abtb-prose p { font-size: var(--fs-md); line-height: var(--lh-body); text-wrap: pretty; }
.abtb-prose p:first-of-type { margin-top: 0; }

.abtb-prose h2,
.abtb-prose h3,
.abtb-prose h4 { scroll-margin-top: 96px; }

.abtb-prose h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-3xl);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  margin: var(--sp-10) 0 var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule-strong);
  text-wrap: balance;
}
.abtb-prose h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
  margin: var(--sp-8) 0 var(--sp-4);
  text-wrap: balance;
}
.abtb-prose h3::before {
  content: "§";
  color: var(--ink-4);
  margin-right: var(--sp-3);
  font-weight: 500;
}
.abtb-prose h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  margin: var(--sp-7) 0 var(--sp-3);
  color: var(--ink-1);
}

.abtb-prose ul, .abtb-prose ol { padding-left: var(--sp-7); }
.abtb-prose li { margin-bottom: var(--sp-3); line-height: var(--lh-body); }
.abtb-prose ol { list-style: decimal; font-variant-numeric: lining-nums; }
.abtb-prose ol li::marker { color: var(--ink-4); font-family: var(--font-mono); font-size: 0.9em; }

.abtb-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-paper);
  padding: 2px 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--code-rule);
  color: var(--code-ink);
  font-variant-ligatures: none;
}
.abtb-prose a {
  text-decoration-color: var(--accent);
}

/* Drop cap lead paragraph */
.abtb-lede {
  font-size: var(--fs-lg);
  line-height: var(--lh-body);
  color: var(--ink-1);
}
.abtb-lede::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: calc(var(--fs-lg) * 4.2);
  line-height: 0.86;
  padding: 0.08em var(--sp-3) 0 0;
  margin: 0.04em 0 0 0;
  color: var(--accent);
  font-feature-settings: "lnum";
}
.abtb-lede + p:first-of-type::first-line { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

/* ---------- Footnotes ---------- */
.abtb-footnote-ref {
  font-family: var(--font-serif);
  font-variant-numeric: lining-nums;
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  color: var(--accent);
  text-decoration: none;
  padding: 0 2px;
}
.abtb-footnote-ref:hover { text-decoration: underline; }
.abtb-footnotes {
  margin-top: var(--sp-11);
  padding-top: var(--sp-7);
  border-top: 1px solid var(--rule-strong);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-2);
}
.abtb-footnotes__head {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--sp-4);
}
.abtb-footnotes ol {
  padding-left: var(--sp-6);
  list-style: decimal;
}
.abtb-footnotes li + li { margin-top: var(--sp-3); }
.abtb-footnotes li::marker {
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ---------- Marginalia ---------- */
.abtb-marginalia {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-3);
  padding-left: var(--sp-4);
  border-left: 1px solid var(--rule);
  margin: var(--sp-5) 0;
}
@media (min-width: 1100px) {
  .abtb-marginalia {
    float: right;
    clear: right;
    width: 240px;
    margin-right: -280px;
    margin-top: 0;
    padding-left: var(--sp-5);
  }
}

/* ---------- Blockquote / pull quote ---------- */
.abtb-prose blockquote {
  margin: var(--sp-7) 0;
  padding: var(--sp-2) var(--sp-6);
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-2);
  font-size: var(--fs-lg);
  line-height: var(--lh-normal);
}
.abtb-prose blockquote p { margin: 0; }
.abtb-prose blockquote p + p { margin-top: var(--sp-3); }
.abtb-prose blockquote cite {
  display: block;
  margin-top: var(--sp-3);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
}

.abtb-pullquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-2xl);
  line-height: 1.25;
  color: var(--ink-1);
  margin: var(--sp-9) 0;
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--ink-1);
  border-bottom: 1px solid var(--ink-1);
  text-wrap: balance;
}

/* ---------- Callouts ---------- */
.abtb-callout {
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--rule-strong);
  border-left-width: 3px;
  background: var(--paper-sink);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  border-radius: var(--r-1);
}
.abtb-callout__label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
  color: var(--ink-2);
}
.abtb-callout p { margin: 0; }
.abtb-callout p + p { margin-top: var(--sp-2); }
.abtb-callout--note    { border-left-color: var(--note);    background: var(--note-soft); }
.abtb-callout--note    .abtb-callout__label { color: var(--note); }
.abtb-callout--caution { border-left-color: var(--warn);    background: var(--warn-soft); }
.abtb-callout--caution .abtb-callout__label { color: var(--warn); }
.abtb-callout--spec    { border-left-color: var(--accent);  background: var(--accent-soft); }
.abtb-callout--spec    .abtb-callout__label { color: var(--accent); }

/* ---------- Code block (first-class) ---------- */

.abtb-codeblock {
  position: relative;
  background: var(--code-paper);
  border: 1px solid var(--code-rule);
  border-radius: var(--r-2);
  overflow: hidden;
  font-variant-ligatures: none;
}
.abtb-codeblock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--code-rule);
  background: var(--code-paper);
}
.abtb-codeblock__lang {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--code-meta);
  font-variant-numeric: tabular-nums;
}
.abtb-codeblock__lang::before {
  content: "ʟᴀɴɢ / ";
  color: var(--ink-5);
}
.abtb-codeblock__copy {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--code-rule);
  border-radius: var(--r-2);
  padding: 3px var(--sp-2);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.abtb-codeblock__copy:hover { color: var(--accent); border-color: var(--accent); }
.abtb-codeblock__copy[data-copied="true"] { color: var(--note); border-color: var(--note); }

.abtb-codeblock__body {
  padding: var(--sp-4) var(--sp-5);
  overflow-x: auto;
}
.abtb-codeblock pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--code-ink);
  font-variant-numeric: tabular-nums;
  tab-size: 2;
}
.abtb-codeblock pre code { all: unset; white-space: pre; }

/* Syntax tint (selector-based — JS can wrap tokens in these) */
.abtb-codeblock .tok-kw  { color: var(--code-kw); font-weight: 600; }
.abtb-codeblock .tok-str { color: var(--code-str); }
.abtb-codeblock .tok-num { color: var(--code-num); font-variant-numeric: tabular-nums; }
.abtb-codeblock .tok-com { color: var(--code-com); font-style: italic; }
.abtb-codeblock .tok-var { color: var(--code-var); }
.abtb-codeblock .tok-fn  { color: var(--code-kw); }

/* Line-numbered variant */
.abtb-codeblock--numbered .abtb-codeblock__body {
  counter-reset: ln;
  padding-left: 0;
}
.abtb-codeblock--numbered pre code {
  display: block;
}
.abtb-codeblock--numbered .ln {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--sp-4);
  padding-right: var(--sp-5);
}
.abtb-codeblock--numbered .ln::before {
  counter-increment: ln;
  content: counter(ln);
  text-align: right;
  color: var(--code-meta);
  padding-right: var(--sp-2);
  border-right: 1px solid var(--code-rule);
}

/* ---------- Listings / figures ---------- */

.abtb-figure {
  margin: var(--sp-8) 0;
}
.abtb-figure__caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-3);
  margin-top: var(--sp-3);
  padding-left: var(--sp-4);
  border-left: 1px solid var(--rule);
}
.abtb-figure__label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-2);
  margin-right: var(--sp-2);
  font-weight: 600;
}

/* ---------- Tables ---------- */
.abtb-prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums lining-nums;
}
.abtb-prose th, .abtb-prose td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.abtb-prose thead th {
  border-top: 1px solid var(--ink-1);
  border-bottom: 1px solid var(--ink-1);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
}
.abtb-prose tbody tr:last-child td { border-bottom: 1px solid var(--ink-1); }

/* ---------- Sidebar ---------- */

.abtb-sidebar {
  display: grid;
  gap: var(--sp-8);
  align-content: start;
  position: sticky;
  top: var(--sp-5);
}

.abtb-widget__head {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--ink-1);
  margin: 0 0 var(--sp-4);
  display: flex;
  justify-content: space-between;
}
.abtb-widget__head .num {
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* Inline ToC — sits above the prose at the top of a single post.
   Two-column grid (predictable) on wider viewports, tight row rhythm. */
.abtb-toc--inline {
  max-width: var(--w-prose);
  margin: 0 auto var(--sp-8);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--rule);
  background: var(--paper-sink);
  border-radius: var(--r-1);
}
.abtb-toc--inline .abtb-widget__head {
  margin: 0 0 var(--sp-2);
  border-bottom-color: var(--rule);
  color: var(--ink-2);
}
.abtb-toc--inline ol {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}
.abtb-toc--inline li {
  margin: 0;
  padding: 0;
}
.abtb-toc--inline li a {
  padding: 2px 0;
  margin: 0;
  border-left: 0;
  line-height: 1.35;
}
.abtb-toc--inline li a[aria-current="true"] {
  padding-left: var(--sp-2);
  margin-left: calc(var(--sp-2) * -1);
  border-left: 1px solid var(--accent);
}
.abtb-toc--inline li.is-h4 a { padding-left: var(--sp-5); }
@media (max-width: 720px) {
  .abtb-toc--inline { padding: var(--sp-3) var(--sp-4); }
}

/* ToC widget */
.abtb-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: var(--sp-2);
}
.abtb-toc li { counter-increment: toc; }
.abtb-toc li a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 1px solid transparent;
  padding-left: var(--sp-3);
  margin-left: calc(var(--sp-3) * -1);
  transition: color 120ms ease, border-color 120ms ease;
  text-wrap: pretty;
}
.abtb-toc li a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.abtb-toc li a:hover { color: var(--accent); }
.abtb-toc li a[aria-current="true"] {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.abtb-toc li.is-h4 a { padding-left: var(--sp-7); color: var(--ink-3); font-size: var(--fs-xs); }

/* Editor's picks */
.abtb-picks { display: grid; gap: var(--sp-4); }
.abtb-picks__item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.abtb-picks__item:last-child { border-bottom: 0; padding-bottom: 0; }
.abtb-picks__num {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.abtb-picks__title {
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--ink-1);
  font-weight: 600;
  margin: 0 0 var(--sp-1);
  text-wrap: pretty;
}
.abtb-picks__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.abtb-picks__item:hover .abtb-picks__title { color: var(--accent); }

/* Mascot / about widget */
.abtb-about {
  display: grid;
  gap: var(--sp-3);
}
.abtb-about__portrait {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-0);
  background: var(--paper-sink);
  margin: 0 auto var(--sp-3);
  position: relative;
}
.abtb-about__portrait::after {
  content: "fig. 1";
  position: absolute;
  bottom: -20px;
  left: 0; right: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-4);
  text-align: center;
}
.abtb-about__portrait img {
  max-width: 84%;
  max-height: 84%;
  filter: grayscale(1) contrast(1.08);
  mix-blend-mode: multiply;
}
[data-theme="dark"] .abtb-about__portrait img { mix-blend-mode: screen; }
.abtb-about__copy {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  text-align: center;
  padding-top: var(--sp-5);
  margin: 0;
  text-wrap: pretty;
}

/* ---------- Newsletter ---------- */

.abtb-newsletter {
  padding: var(--sp-7) var(--sp-7);
  border: 1px solid var(--ink-1);
  border-radius: var(--r-0);
  background: var(--paper-sink);
  margin: var(--sp-9) 0;
}
.abtb-newsletter__label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.abtb-newsletter__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
  letter-spacing: -0.005em;
}
.abtb-newsletter__dek {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-md);
  color: var(--ink-3);
  margin: 0 0 var(--sp-5);
  text-wrap: pretty;
}
.abtb-newsletter__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
}
@media (max-width: 520px) {
  .abtb-newsletter__form { grid-template-columns: 1fr; }
}
.abtb-newsletter__fine {
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-4);
}

.abtb-newsletter--sidebar {
  padding: var(--sp-5);
  margin: 0;
}
.abtb-newsletter--sidebar .abtb-newsletter__title { font-size: var(--fs-lg); }
.abtb-newsletter--sidebar .abtb-newsletter__form { grid-template-columns: 1fr; }

/* ---------- Forms ---------- */

.abtb-input {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  padding: var(--sp-3) var(--sp-4);
  background: var(--paper-elev);
  color: var(--ink-1);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-1);
  outline: none;
  width: 100%;
  transition: border-color 120ms ease;
}
.abtb-input:focus { border-color: var(--accent); }

.abtb-button {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  padding: var(--sp-3) var(--sp-5);
  background: var(--ink-1);
  color: var(--paper);
  border: 1px solid var(--ink-1);
  border-radius: var(--r-1);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: background 120ms ease, color 120ms ease;
}
.abtb-button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.abtb-button--ghost {
  background: transparent;
  color: var(--ink-1);
}
.abtb-button--ghost:hover { background: var(--ink-1); color: var(--paper); border-color: var(--ink-1); }

/* ---------- Chips ---------- */
.abtb-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  text-decoration: none;
}
.abtb-chip:hover { border-color: var(--accent); color: var(--accent); }
.abtb-chip--accent { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */

.abtb-footer {
  margin-top: var(--sp-12);
  padding: var(--sp-9) 0 var(--sp-7);
  border-top: 1px solid var(--ink-1);
}
.abtb-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
  padding-bottom: var(--sp-7);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 720px) {
  .abtb-footer__grid { grid-template-columns: 1fr 1fr; }
}
.abtb-footer__col h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--rule);
}
.abtb-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.abtb-footer__col a {
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-decoration: none;
}
.abtb-footer__col a:hover { color: var(--accent); }
.abtb-footer__colophon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--sp-6);
  gap: var(--sp-4);
}

/* The actual credits line lives inside .abtb-footer__colophon-line now, so the
   mark can breathe on its own row above it. */
.abtb-footer__colophon-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

/* Footer brand mark — the cyan ; that bookends the page and links home.
   Sits alone, centered, above the credits line. Sized to read as a mark,
   not as stray punctuation. */
.abtb-footer__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  text-decoration: none;
  line-height: 1;
  padding: 4px;
  transition: opacity 120ms ease, transform 120ms ease;
}
.abtb-footer__mark:hover { opacity: 0.75; transform: translateY(-1px); }
.abtb-footer__mark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--r-2);
}
.abtb-footer__mark svg { display: block; }

/* 404 page brand mark — the failure-state signature. Sits above the "404"
   numeric block at ~85% opacity so it doesn't dominate the layout. */
.abtb-not-found__mark {
  display: block;
  margin: 0 auto var(--sp-4);
  color: var(--accent);
  opacity: 0.85;
}

/* ---------- Command palette (⌘K) ---------- */

.abtb-cmdk {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  place-items: start center;
  padding-top: 12vh;
  z-index: 100;
}
[data-theme="dark"] .abtb-cmdk { background: rgba(0, 0, 0, 0.7); }
.abtb-cmdk[data-open="true"] { display: grid; }
.abtb-cmdk__panel {
  width: min(680px, 92vw);
  background: var(--paper-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  font-family: var(--font-serif);
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: 72vh;
}
.abtb-cmdk__input {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  padding: var(--sp-5) var(--sp-6);
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-1);
  outline: none;
  width: 100%;
}
.abtb-cmdk__list {
  list-style: none;
  margin: 0;
  padding: var(--sp-2) 0;
  overflow-y: auto;
}
.abtb-cmdk__item {
  padding: var(--sp-3) var(--sp-6);
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: var(--sp-4);
  align-items: baseline;
  cursor: pointer;
}
.abtb-cmdk__item[aria-selected="true"] {
  background: var(--paper-sink);
  color: var(--accent);
}
.abtb-cmdk__item-num {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.abtb-cmdk__item-title {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  color: inherit;
  text-wrap: pretty;
}
.abtb-cmdk__item-kind {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-4);
}
.abtb-cmdk__footer {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-6);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  gap: var(--sp-4);
}
.abtb-cmdk__footer span { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* ---------- Animated section rules ---------- */

.abtb-rule {
  display: block;
  border: 0;
  border-top: 1px solid var(--rule);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 700ms cubic-bezier(.2,.7,.2,1);
  margin: var(--sp-7) 0;
}
.abtb-rule.is-in { transform: scaleX(1); }
.abtb-rule--ink { border-top-color: var(--ink-1); }
.abtb-rule--accent { border-top-color: var(--accent); }

/* Auto-upgrade cited blockquotes (blockquote with <cite>) to the note-callout
   visual treatment. Applied by the `the_content` filter in functions.php.
   No text is changed; only the class attribute. */
.abtb-prose blockquote.abtb-quote-cited {
  padding: var(--sp-5) var(--sp-6);
  border-left: 3px solid var(--note);
  border-top: 1px solid var(--note-soft);
  border-right: 1px solid var(--note-soft);
  border-bottom: 1px solid var(--note-soft);
  background: var(--note-soft);
  border-radius: var(--r-1);
  font-style: italic;
  color: var(--ink-1);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
}
.abtb-prose blockquote.abtb-quote-cited cite {
  display: block;
  margin-top: var(--sp-3);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--note);
}

/* ---------- Full archive (year-grouped) ---------- */
.abtb-archive--full .abtb-archive__year {
  margin-top: var(--sp-9);
}
.abtb-archive--full .abtb-archive__year:first-of-type { margin-top: var(--sp-6); }

.abtb-archive--full .abtb-archive__year-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: var(--sp-5);
}
.abtb-archive--full .abtb-archive__year-head h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: var(--fs-xl);
  margin: 0;
  letter-spacing: -0.005em;
}
.abtb-archive--full .abtb-archive__item {
  grid-template-columns: 60px 1fr 120px 110px;
}

/* ---------- Breadcrumbs ---------- */
.abtb-breadcrumbs {
  max-width: 760px;
  margin: 0 auto var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}
.abtb-breadcrumbs a {
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.abtb-breadcrumbs a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.abtb-breadcrumbs .breadcrumb_last,
.abtb-breadcrumbs [aria-current="page"] { color: var(--ink-1); }

/* ---------- Byline author link ---------- */
.abtb-byline__author {
  color: var(--ink-1);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.abtb-byline__author:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Author block at article end ---------- */
.abtb-author {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--sp-6);
  align-items: start;
  padding: var(--sp-7) 0 var(--sp-8);
  border-top: 1px solid var(--rule-strong);
  margin-top: var(--sp-9);
}
.abtb-author__portrait {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  background: var(--paper-sink);
  overflow: hidden;
  text-decoration: none;
}
.abtb-author__portrait img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: grayscale(0.15) contrast(1.04);
}
[data-theme="dark"] .abtb-author__portrait img { filter: grayscale(0.15) brightness(0.95); }
.abtb-author__body { min-width: 0; }
.abtb-author__label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--sp-1);
}
.abtb-author__name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  margin: 0 0 var(--sp-2);
}
.abtb-author__name a {
  color: var(--ink-1);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.abtb-author__name a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.abtb-author__bio {
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  margin: 0 0 var(--sp-3);
  text-wrap: pretty;
}
.abtb-author__more {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
}
.abtb-author__more a { color: var(--accent); text-decoration: none; }
.abtb-author__more a:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .abtb-author {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .abtb-author__portrait { margin: 0 auto; }
}

/* ---------- Related entries ---------- */
.abtb-related {
  padding: var(--sp-7) 0 var(--sp-8);
  border-top: 1px solid var(--rule-strong);
}
.abtb-related__head {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: var(--fs-xl);
  letter-spacing: -0.005em;
  margin: 0 0 var(--sp-5);
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.abtb-related__scope {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.abtb-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}
.abtb-related__item {
  display: grid;
  gap: var(--sp-2);
  text-decoration: none;
  padding: var(--sp-4);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--paper);
  transition: border-color 120ms ease, background 120ms ease;
}
.abtb-related__item:hover { border-color: var(--accent); background: var(--paper-sink); }
.abtb-related__item .abtb-postcard__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-smallcap);
  text-transform: uppercase;
  color: var(--accent);
}
.abtb-related__item .abtb-postcard__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  margin: 0;
  color: var(--ink-1);
  text-wrap: balance;
}
.abtb-related__item:hover .abtb-postcard__title { color: var(--accent); }
.abtb-related__item .abtb-postcard__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  gap: var(--sp-2);
}
.abtb-related__item .abtb-postcard__meta .sep { color: var(--ink-5); }
@media (max-width: 720px) {
  .abtb-related__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Responsive pass — desktop → tablet → phone
   ========================================================= */

/* Running head: the right cell (tagline) can overflow — truncate on desktop,
   allow wrap on tablet, hide on phone. */
.abtb-running-head__right {
  max-width: 44ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep flex-friendly wrap on the masthead ribbon */
.abtb-masthead__ribbon { flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); }

/* Tighten the lead postcard title so it doesn't dominate on wide screens */
.abtb-postcard--lead .abtb-postcard__title {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.06;
}

/* Nav wraps across rows when it has to; keep alignment consistent */
.abtb-nav { flex-wrap: wrap; row-gap: var(--sp-3); }

/* ---------- Tablet (≤ 960 px) ---------- */
@media (max-width: 960px) {
  .abtb-shell { padding: 0 var(--sp-6); }

  .abtb-masthead__title-row {
    grid-template-columns: 1fr;
    place-items: center;
    text-align: center;
  }
  .abtb-masthead__blurb-left,
  .abtb-masthead__blurb-right {
    max-width: 52ch;
    text-align: center;
  }
  /* Flip the blurb order so left-blurb sits ABOVE the wordmark on tablet */
  .abtb-masthead__title-row > .abtb-masthead__blurb-right { order: 3; }
  .abtb-masthead__title-row > .abtb-masthead__blurb-left  { order: 1; }
  .abtb-masthead__title-row > .abtb-wordmark              { order: 2; }

  .abtb-running-head__right { max-width: 36ch; }

  .abtb-archive__item {
    grid-template-columns: 48px 1fr 96px;
  }
  .abtb-archive__item .abtb-archive__cat { display: none; }
}

/* ---------- Phone (≤ 720 px) ---------- */
@media (max-width: 720px) {
  .abtb-shell { padding: 0 var(--sp-5); }

  /* Running head compacts to two cells (left label, right mood). Truncate the
     left so "Another Boring Tech Blog · Vol. IV" never wraps to 2 lines. */
  .abtb-running-head {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-2);
    gap: var(--sp-2) var(--sp-4);
  }
  .abtb-running-head__left {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .abtb-running-head__right { display: none; }
  .abtb-running-head__page  { justify-self: end; white-space: nowrap; }

  /* Masthead: hide the right (tagline) blurb on phone — redundant with running head */
  .abtb-masthead { padding: var(--sp-5) 0 var(--sp-3); }
  .abtb-masthead__blurb-right { display: none; }
  .abtb-masthead__blurb-left  { font-size: var(--fs-xs); max-width: 40ch; }

  /* On SINGLE POSTS the running head already brands the page. Shrink the
     wordmark dramatically and drop the tagline so readers see the article
     head (kicker + title) without scrolling past giant chrome. */
  body.single-post .abtb-masthead { padding: var(--sp-3) 0 var(--sp-2); }
  body.single-post .abtb-masthead .type-masthead {
    font-size: clamp(22px, 6.2vw, 30px);
    line-height: 1.05;
  }
  body.single-post .abtb-wordmark__tag { display: none; }

  /* Article: far less top/bottom padding on phone */
  .abtb-article { padding: var(--sp-6) 0 var(--sp-8); }
  .abtb-article__head { margin-bottom: var(--sp-6); }

  /* Nav: smaller gap, center-aligned already via flex */
  .abtb-nav { gap: var(--sp-4); padding: var(--sp-3) 0; }

  /* Hero: already stacks at 900 px but tighten padding here */
  .abtb-hero { padding: var(--sp-8) 0 var(--sp-6); gap: var(--sp-6); }
  .abtb-hero__secondary { gap: var(--sp-5); }
  .abtb-hero__secondary > * + * { padding-top: var(--sp-5); }

  /* Archive serial column tighter + stack title across remaining width */
  .abtb-archive__item {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    row-gap: 4px;
  }
  .abtb-archive__item .abtb-archive__date {
    grid-column: 2;
    text-align: left;
    color: var(--ink-4);
    padding-top: 2px;
  }

  /* Hero lead title caps a bit tighter on mobile */
  .abtb-postcard--lead .abtb-postcard__title { font-size: clamp(28px, 7vw, 38px); }

  /* Footer — already handled in base CSS (720px grid collapse) */
}

/* ---------- Small phone (≤ 480 px) ---------- */
@media (max-width: 480px) {
  .abtb-shell { padding: 0 var(--sp-4); }
  .abtb-masthead__ribbon { font-size: var(--fs-4xs); }
  .abtb-running-head > * { font-size: var(--fs-4xs); }
  .abtb-wordmark .abtb-wordmark__tag { font-size: var(--fs-sm); }
  .abtb-nav { font-size: var(--fs-3xs); gap: var(--sp-2) var(--sp-3); }

  /* Single-post wordmark even tighter on small phones */
  body.single-post .abtb-masthead .type-masthead {
    font-size: clamp(20px, 5.6vw, 24px);
  }

  /* Codeblock gutter: tighter padding so code doesn't feel squeezed */
  .abtb-codeblock__body { padding: var(--sp-3) var(--sp-4); }
  .abtb-codeblock pre { font-size: var(--fs-xs); }
}

/* =========================================================
   Touch targets & scroll safety — iOS / Android tapping ergonomics
   ========================================================= */

/* iOS HIG recommends ≥ 44×44 px tap targets.
   On phone widths, pad the interactive rows so the touchable area grows even
   while the visual footprint stays small. Descriptor-only selectors — zero
   impact on desktop. */
@media (max-width: 720px) {

  /* Primary nav: each link gets a tall row for fat-fingers */
  .abtb-nav a,
  .abtb-nav .abtb-nav__mode {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 var(--sp-2);
  }

  /* ToC items: wider tap zone + restore comfortable hit area */
  .abtb-toc--inline li a,
  .abtb-toc li a {
    min-height: 36px;
    padding: 8px 0;
  }

  /* Buttons + submit inputs: consistent 44 px minimum */
  .abtb-button,
  .abtb-commentform input[type="submit"],
  .abtb-newsletter__jp button,
  .abtb-newsletter__jp input[type="submit"] {
    min-height: 44px;
  }

  /* Pagination buttons: same comfort */
  .abtb-pagination a,
  .abtb-pagination .page-numbers { min-height: 40px; min-width: 40px; }

  /* Form inputs: minimum tall enough to avoid iOS auto-zoom on focus
     (iOS zooms when input font-size < 16px). */
  .abtb-input,
  input[type="email"],
  input[type="text"],
  input[type="search"],
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Related-entry cards become full taps */
  .abtb-related__item { min-height: 44px; }
}

/* Scroll safety: wide content inside posts should scroll horizontally
   within its own bounds, never push the whole page into horizontal scroll.
   Runs at every viewport — prose containers just need overflow handling. */
.abtb-prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.abtb-prose pre,
.abtb-prose .abtb-codeblock__body { overflow-x: auto; max-width: 100%; }

/* Belt-and-braces: never let a post body push the viewport horizontally */
.abtb-article,
.abtb-article__main,
.abtb-prose { min-width: 0; }
.abtb-prose .abtb-codeblock { max-width: 100%; }
.abtb-prose img,
.abtb-prose video,
.abtb-prose iframe { max-width: 100%; height: auto; }
.abtb-prose a { overflow-wrap: anywhere; }

/* Stop any element (wide table, long inline code, etc.) inside the page
   shell from pushing the whole viewport into horizontal scroll. */
html, body { overflow-x: hidden; }
