/**
 * DocuPOW — Single blog post styles (single.php only).
 *
 * Scope: everything lives under .single-post-page (BEM). Global chrome,
 * container, buttons, links and scroll-reveal come from main.css — this
 * file adds the reading-progress bar, the three-zone layout (share rail /
 * 720px article column / TOC rail), the full article prose scope, the
 * author box, the contextual CTA band, the obsidian newsletter band, the
 * related-posts band and the final CTA band.
 *
 * Light-canvas contrast contract (tokens only; no raw hex):
 *  - Chip / eyebrows / TOC active / prose links are var(--techblue) —
 *    4.54:1 on white (AA at their sizes/weights).
 *  - h1 / headings / author names / strong are var(--ink) — 16.68:1 (AA).
 *  - Prose body, meta, TOC resting links are var(--text-muted) — 9.34:1 on
 *    white, 8.70:1 on --gray (AA).
 *  - On obsidian: white headings; var(--text-muted-dark) body (7.58:1 — AA).
 *
 * Motion contract (transform/opacity only — STANDARD tier):
 *  - The reading progress bar is the page's ONE bespoke scroll-driven
 *    moment: single.js scales it (transform: scaleX) from a passive,
 *    rAF-throttled scroll listener — the SANCTIONED exception to the
 *    no-scroll-listeners rule. Under prefers-reduced-motion the whole
 *    track is hidden here AND single.js no-ops (safe default: it is
 *    decorative-ish scroll state, not content).
 *  - Everything else is functional (TOC, share, newsletter) and is NEVER
 *    motion-gated. TOC anchor jumps ride main.css's scroll-behavior
 *    (smooth, auto under reduce) — no JS scrolling.
 *  - main.js owns [data-dp-reveal]/[data-dp-reveal-stagger]; single.js
 *    clears the inline stagger delays post-reveal (resources.js pattern)
 *    so the related-card hover lifts are never postponed.
 */

/* =========================================================================
   Page scope
   ========================================================================= */
.single-post-page {
  overflow-x: clip; /* insurance: nothing may cause horizontal scroll @320px */
}

/* [hidden] must always win (the resources.css lesson): authored display
   values (the flex form row, the TOC rail's block, the tooltip) would
   otherwise beat the UA's [hidden] rule. Unconditional and page-scoped —
   single.js drives all hidden-state toggling. */
.single-post-page [hidden] {
  display: none !important;
}

/* =========================================================================
   Reading progress — 3px techblue bar on a gray track, fixed under the
   sticky 72px site header (z below the header's 1000 so the drawer and
   header chrome always win).
   ========================================================================= */
.single-post-page__progress {
  position: fixed;
  top: 72px; /* .dp-nav__inner height in main.css */
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--gray);
  z-index: 900;
  pointer-events: none;
}

.single-post-page__progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--techblue);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* Reduced motion: the progress bar is the sanctioned decorative scroll
   state — hidden entirely (single.js also no-ops its listener). */
@media (prefers-reduced-motion: reduce) {
  .single-post-page__progress {
    display: none;
  }
}

/* =========================================================================
   Three-zone layout — share rail (>=1024) / article (max 720) / TOC (>=1280)
   ========================================================================= */
.single-post-page__layout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding-block: var(--space-5) var(--space-7);
}

.single-post-page__article {
  flex: 1 1 auto;
  max-width: 720px;
  margin-inline: auto;
  min-width: 0;
}

@media (max-width: 767.98px) {
  .single-post-page__layout {
    padding-block: var(--space-4) var(--space-6);
  }
}

/* =========================================================================
   Share rail — sticky white rounded-pill stack, desktop (>=1024) only
   ========================================================================= */
.single-post-page__share {
  display: none;
  flex: 0 0 auto;
  width: 64px;
}

@media (min-width: 1024px) {
  .single-post-page__share {
    display: block;
  }
}

.single-post-page__share-rail {
  position: sticky;
  top: 128px; /* clears the 72px header + progress bar with breathing room */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding-block: var(--space-2);
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 9999px; /* pill — sanctioned for this chip-like rail */
}

.single-post-page__share-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color .18s ease, background-color .18s ease;
}

.single-post-page__share-btn:hover,
.single-post-page__share-btn:focus-visible {
  color: var(--techblue);
  background-color: var(--gray);
}

.single-post-page__share-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Copied state — single.js adds .is-copied to the button (and unhides the
   tooltip) for ~2s after a successful clipboard write. The button reads
   techblue while copied; visibility itself is [hidden]-driven, so the
   confirmation works with transitions nuked under reduced motion. */
.single-post-page__share-btn.is-copied {
  color: var(--techblue);
}

/* "Copied" tooltip — sits beside the copy button while unhidden. */
.single-post-page__share-tip {
  position: absolute;
  left: calc(100% + var(--space-1));
  top: 50%;
  translate: 0 -50%;
  padding: 4px var(--space-1);
  background-color: var(--ink);
  color: var(--white);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
}

/* =========================================================================
   Article header — breadcrumbs, chip, h1, standfirst, meta row
   ========================================================================= */
.single-post-page__header {
  margin-bottom: var(--space-5);
}

.single-post-page__breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-3);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

.single-post-page__crumb {
  color: var(--text-muted);
  transition: color .18s ease;
}

.single-post-page__crumb:hover,
.single-post-page__crumb:focus-visible {
  color: var(--techblue);
}

.single-post-page__crumb-sep {
  display: inline-flex;
  color: var(--text-muted);
}

.single-post-page__crumb-sep svg {
  display: block;
}

.single-post-page__crumb-current {
  color: var(--ink);
}

/* Category chip — mono 13 techblue on a white pill (1px border). */
.single-post-page__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px var(--space-2);
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 9999px; /* pill — sanctioned for chips/tags per DESIGN.md */
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--techblue);
  margin-bottom: var(--space-3);
}

/* The single h1 — 52/1.1/700 Ink (the export's headline-xl scaled to the
   720px article column), 36 on mobile. */
.single-post-page__title {
  font-size: 52px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-3);
}

/* Excerpt-as-standfirst — 20/1.6 muted (manual excerpts only). */
.single-post-page__standfirst {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* Meta row — hairlines above and below (1px y-hairlines). */
.single-post-page__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* 48px avatar circle — author INITIALS on the gray surface (resources.php
   pattern; decorative — the full name sits beside it). When WP resolves a
   real avatar, the --img variant clips it into the same circle. */
.single-post-page__avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--gray);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--techblue);
  overflow: hidden;
}

.single-post-page__avatar--img .single-post-page__avatar-img,
.single-post-page__avatar--img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.single-post-page__byline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.single-post-page__author-name {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink);
}

/* Right cluster — mono 13 muted: date • reading time. */
.single-post-page__meta-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* <480: the meta row wraps rather than squeezing the mono cluster. */
@media (max-width: 479.98px) {
  .single-post-page__meta {
    flex-wrap: wrap;
  }

  .single-post-page__meta-right {
    margin-left: calc(48px + var(--space-2)); /* aligns under the byline */
  }
}

/* =========================================================================
   Featured image — aspect-video rounded media (skipped when absent)
   ========================================================================= */
.single-post-page__media {
  aspect-ratio: 16 / 9;
  margin: 0 0 var(--space-5);
  border-radius: 12px; /* the resources.css card-media scale */
  border: 1px solid var(--border);
  overflow: hidden;
  background-color: var(--gray);
}

.single-post-page__media-img,
.single-post-page__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================================
   Article body — the full prose scope around the_content()
   ========================================================================= */

/* p 18/1.6 muted. */
.single-post-page__content p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* h2 28/600 Ink — scroll-margin clears the sticky header + progress bar so
   TOC anchor jumps land the heading below the chrome. */
.single-post-page__content h2 {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--ink);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  scroll-margin-top: 104px; /* 72 header + 3 bar + breathing room */
}

/* h3 22/600 Ink. */
.single-post-page__content h3 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  scroll-margin-top: 104px;
}

/* Lists — 18/1.6 muted, 8px between items. */
.single-post-page__content ul,
.single-post-page__content ol {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  padding-left: var(--space-3);
}

.single-post-page__content li {
  margin-bottom: var(--space-1);
}

.single-post-page__content strong {
  color: var(--ink);
}

/* Prose links — techblue, underline on hover/focus. */
.single-post-page__content a {
  color: var(--techblue);
}

.single-post-page__content a:hover,
.single-post-page__content a:focus-visible {
  color: var(--techblue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Images in prose — rounded, never overflow. */
.single-post-page__content img {
  border-radius: var(--radius);
  max-width: 100%;
  height: auto;
}

/* WP core alignment/image blocks — sane defaults inside the 720px column
   (alignwide/alignfull cannot exceed the column; no horizontal scroll). */
.single-post-page__content .wp-block-image {
  margin-block: var(--space-4);
}

.single-post-page__content .alignwide,
.single-post-page__content .alignfull {
  max-width: 100%;
}

.single-post-page__content .aligncenter {
  margin-inline: auto;
  text-align: center;
}

/* Default blockquote (and core wp-block-quote) = the export's gray CALLOUT
   design: gray panel, 4px techblue left border, 24px padding. The export's
   indigo PULL-QUOTE maps to core's .wp-block-pullquote below — comment
   preserved as the mapping record. */
.single-post-page__content blockquote {
  background-color: var(--gray);
  border-left: 4px solid var(--techblue);
  padding: var(--space-3);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--space-4) 0;
}

.single-post-page__content blockquote p {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.single-post-page__content blockquote p:last-child {
  margin-bottom: 0;
}

.single-post-page__content blockquote cite {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  font-style: normal;
  color: var(--text-muted);
}

/* Pull-quote (core .wp-block-pullquote) = the export's indigo pull-quote:
   4px indigo left border, 24px left padding, 24/600 indigo text — the
   inner blockquote resets the gray callout treatment. */
.single-post-page__content .wp-block-pullquote {
  border-left: 4px solid var(--indigo);
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  margin: var(--space-5) 0;
}

.single-post-page__content .wp-block-pullquote blockquote {
  background: none;
  border-left: 0;
  padding: 0;
  border-radius: 0;
  margin: 0;
}

.single-post-page__content .wp-block-pullquote p {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 0;
}

/* Tables — 1px hairline collapsed grid; th on the gray surface. A table
   cannot wrap itself in a scroll container from CSS alone, so the table
   itself becomes the scroll box: display block + overflow-x auto keeps
   wide tables inside the column (the page never h-scrolls). */
.single-post-page__content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin-block: var(--space-4);
  font-size: 16px;
  line-height: 1.6;
}

.single-post-page__content th,
.single-post-page__content td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
}

.single-post-page__content th {
  background-color: var(--gray);
  font-weight: 600;
  color: var(--ink);
}

.single-post-page__content td {
  color: var(--text-muted);
}

/* Inline code — mono 14 Ink on the gray surface. */
.single-post-page__content code {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  background-color: var(--gray);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Code blocks — the export's obsidian panel: dark surface, hairline dark
   border, mono 13/1.6 muted-dark, scrolls internally (never the page). */
.single-post-page__content pre {
  background-color: var(--obsidian);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-block: var(--space-4);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted-dark);
  overflow-x: auto;
}

.single-post-page__content pre code {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* =========================================================================
   Contextual CTA band — in-flow after the content (the export's inline CTA)
   ========================================================================= */
.single-post-page__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background-color: var(--gray);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-block: var(--space-5);
}

.single-post-page__cta-copy {
  min-width: 0;
}

.single-post-page__cta-title {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.single-post-page__cta-lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.single-post-page__cta-btn {
  flex: none;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .single-post-page__cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================================
   Author box — hairline top; 64px avatar + name (+ mono line + bio when
   the author profile has a description)
   ========================================================================= */
.single-post-page__author-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* 64px avatar/initials circle (same treatment as the meta row's 48px). */
.single-post-page__author-box-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--gray);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--techblue);
  overflow: hidden;
}

.single-post-page__author-box-body {
  min-width: 0;
}

.single-post-page__author-box-name {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

/* Mono affiliation line — only rendered when a bio exists. */
.single-post-page__author-box-role {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.single-post-page__author-box-bio {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* =========================================================================
   TOC rail — >=1280 only; ships [hidden] until single.js builds it (and
   only when the article has 2+ h2s)
   ========================================================================= */
.single-post-page__toc {
  display: none;
  flex: 0 0 auto;
  width: 256px;
  padding-left: var(--space-4);
  border-left: 1px solid var(--border);
}

/* The [hidden] attribute (fewer than 2 h2s, or JS never ran) always wins. */
.single-post-page__toc[hidden] {
  display: none !important;
}

@media (min-width: 1280px) {
  .single-post-page__toc {
    display: block;
  }
}

.single-post-page__toc-inner {
  position: sticky;
  top: 128px;
}

.single-post-page__toc-title {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.single-post-page__toc-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* TOC links (built by single.js) — muted 14, 2px left indicator; active =
   techblue + 600 + techblue indicator (the export's .toc-link.active). */
.single-post-page__toc-link {
  display: block;
  padding-left: var(--space-2);
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
  transition: color .18s ease, border-color .18s ease;
}

.single-post-page__toc-link:hover,
.single-post-page__toc-link:focus-visible {
  color: var(--techblue);
}

.single-post-page__toc-link.is-active {
  color: var(--techblue);
  font-weight: 600;
  border-left-color: var(--techblue);
}

/* =========================================================================
   Newsletter band — obsidian, full width, centered stub form
   ========================================================================= */
.single-post-page__newsletter {
  background-color: var(--obsidian);
  padding-block: var(--space-6);
}

.single-post-page__nl-inner {
  max-width: 672px;
  margin-inline: auto;
  text-align: center;
}

.single-post-page__nl-title {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-2);
}

.single-post-page__nl-lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted-dark);
  margin-bottom: var(--space-4);
}

.single-post-page__nl-form {
  display: flex;
  gap: var(--space-2);
  max-width: 512px;
  margin-inline: auto;
}

.single-post-page__nl-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px var(--space-2);
  background-color: var(--white);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
}

.single-post-page__nl-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Focus ring — explicit techblue ring on the dark band (mouse focus too;
   keyboard focus additionally gets the global :focus-visible outline). */
.single-post-page__nl-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--techblue);
  border-color: var(--techblue);
}

.single-post-page__nl-btn {
  flex: none;
  white-space: nowrap;
}

/* Honeypot — visually hidden (standard clip pattern), tabindex -1 in the
   markup; real visitors never see or reach it. */
.single-post-page__nl-hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Designed success state — replaces the form row (aria-live wrapper). */
.single-post-page__nl-success {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--white);
}

.single-post-page__nl-success[hidden] {
  display: none !important;
}

@media (max-width: 639.98px) {
  .single-post-page__nl-form {
    flex-direction: column;
  }
}

/* Named markup hook that intentionally carries no styles of its own —
   named here so every markup class resolves in this sheet (build rule). */
.single-post-page__nl-row {
  /* no-op: the aria-live wrapper around the form/success swap */
}

/* =========================================================================
   Related posts — "Keep reading." gray band, resources small-card pattern
   ========================================================================= */
.single-post-page__related {
  background-color: var(--gray);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-7);
}

.single-post-page__related-title {
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-5);
}

.single-post-page__related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (max-width: 1023.98px) {
  .single-post-page__related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .single-post-page__related-grid {
    grid-template-columns: 1fr;
  }

  .single-post-page__related {
    padding-block: var(--space-6);
  }

  .single-post-page__related-title {
    font-size: 28px;
  }
}

/* Card — the resources.php small-card pattern: white, hairline border,
   clipped 16:9 media. CALM-MOTION: no image zoom, no shadows; hover = flat
   lift (standalone `translate`, never `transform`, so it cannot fight the
   reveal) + border/title -> techblue. */
.single-post-page__related-card {
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition:
    opacity .6s ease,
    transform .6s ease,
    translate .18s ease,
    border-color .18s ease;
}

.single-post-page__related-card:hover {
  translate: 0 -4px;
  border-color: var(--techblue);
}

.single-post-page__related-card:hover .single-post-page__related-card-title {
  color: var(--techblue);
}

.single-post-page__related-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--gray);
  border-bottom: 1px solid var(--border);
}

.single-post-page__related-thumb,
.single-post-page__related-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder media surface — centered muted document glyph (decorative). */
.single-post-page__related-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.single-post-page__related-placeholder svg {
  display: block;
}

.single-post-page__related-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--space-3);
}

/* Mono category eyebrow — techblue (4.54:1 — AA). */
.single-post-page__related-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--techblue);
  margin-bottom: var(--space-1);
}

.single-post-page__related-card-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
  transition: color .18s ease;
}

.single-post-page__related-link {
  color: inherit;
}

.single-post-page__related-link:hover,
.single-post-page__related-link:focus-visible {
  color: inherit;
}

/* Excerpt — 2-line clamp. */
.single-post-page__related-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* =========================================================================
   Final CTA band — light gray tint, hairline top, indigo dot wash
   ========================================================================= */
.single-post-page__final {
  position: relative;
  background-color: var(--gray);
  border-top: 1px solid var(--border);
  padding-block: var(--space-7);
  overflow: hidden;
}

/* Decorative indigo dot-pattern wash — radial-gradient dots at 3% opacity
   (the export's abstract pattern background); aria-hidden, non-interactive. */
.single-post-page__final-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--indigo) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .03;
  pointer-events: none;
}

.single-post-page__final-inner {
  position: relative;
  max-width: 896px;
  margin-inline: auto;
  text-align: center;
}

.single-post-page__final-title {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-3);
}

.single-post-page__final-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 672px;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

.single-post-page__final-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

@media (max-width: 767.98px) {
  .single-post-page__final {
    padding-block: var(--space-6);
  }

  .single-post-page__final-title {
    font-size: 32px;
  }
}

@media (max-width: 639.98px) {
  .single-post-page__final-ctas {
    flex-direction: column;
  }

  .single-post-page__final-ctas .dp-btn {
    width: 100%;
    max-width: 360px;
  }
}

/* =========================================================================
   Mobile type scale (<768) — 52 -> 36
   ========================================================================= */
@media (max-width: 767.98px) {
  .single-post-page__title {
    font-size: 36px;
  }

  .single-post-page__standfirst {
    font-size: 18px;
  }

  .single-post-page__content h2 {
    font-size: 24px;
  }
}

/* =========================================================================
   Reduced motion — still the hover lifts; everything functional (TOC,
   share, newsletter, tooltip class toggles) is untouched.
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .single-post-page__related-card,
  .single-post-page__related-card:hover {
    translate: none;
  }
}

/* Legal line under the inline newsletter form — on the obsidian band, so the
   text is --text-muted-dark and the Privacy link is white with a persistent
   underline (never colour-alone) + a light-halo focus ring. Centered with the
   band. Privacy only — an email signup isn't agreeing to a service. */
.single-post-page__nl-legal {
  margin-top: var(--space-3);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted-dark);
}

.single-post-page__nl-legal-link {
  color: var(--white);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 2px;
}

.single-post-page__nl-legal-link:hover {
  color: var(--white);
  text-decoration: none;
}

.single-post-page__nl-legal-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}
