/* ══════════════════════════════════════════════════════════════════
   Blog component kit — single source of truth for every blog post.

   RULE: every top-level component below is a plain block element
   that sets margin-top only (never margin-bottom, except the trailing
   :last-child reset). That's deliberate — it means any sequence of
   components, in any combination, any of them omitted, always stacks
   cleanly with no overlap and no collapsed/doubled gaps. Don't add
   margin-bottom to a new component; add margin-top instead, matching
   the pattern below.

   Nothing in here uses position:absolute/fixed relative to another
   component, and nothing depends on a specific component existing
   before or after it. Each one is self-contained.
   ══════════════════════════════════════════════════════════════════ */

.post-wrap { padding-bottom: var(--space-section); }

/* ── Breadcrumb ──────────────────────────────────────────────────── */
/* padding-top clears the fixed header — at 32px this was nowhere near
   enough (the header is ~81px tall on desktop and position:fixed, so
   the breadcrumb was rendering partially behind it, not just "close"
   to it). 180px matches the same top clearance every other page type
   uses for its first section (.blog-index-hero, .legal-page,
   .sitemap-hero), reduced the same way at the same 640px breakpoint. */
.post-breadcrumb {
    padding-top: 112px;   /* same as .svc-breadcrumb: just under the header */
    color: var(--fg);
}
.post-breadcrumb a { color: var(--fg); text-decoration: none; }
.post-breadcrumb a:hover { color: var(--accent-coral); }
.post-breadcrumb a:active { color: var(--accent-blue); }
.post-breadcrumb .post-breadcrumb-sep { margin: 0 8px; }
.post-breadcrumb [aria-current] { color: var(--fg); }

/* ── Post head: eyebrow, title, byline ──────────────────────────── */
.post-head { margin-top: 20px; }

.post-category {
    display: inline-block;
    color: var(--accent-blue);
    margin-bottom: 14px;
}

.post-title {
    max-width: 900px;
    margin: 0;
}

.post-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.post-byline-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: var(--rule);
    flex-shrink: 0;
}

.post-byline-text {
    color: var(--text-muted);
}
/* Same blue/underline treatment as every other hyperlink on the site
   (see shared.css's a[target="_blank"] rule) — a link should always
   look like a link, internal or external. */
.post-byline-text a {
    color: var(--accent-blue);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--link-underline);
    text-underline-offset: 2px;
}
.post-byline-text a:hover { text-decoration-color: var(--accent-blue); opacity: 0.8; }
.post-byline-sep { margin: 0 6px; }

/* ── Hero image ──────────────────────────────────────────────────── */
/* Lives INSIDE .post-main now (first thing in it), not above the
   two-column split — so the sidebar starts at the same vertical
   position as the hero, visible from the moment the page loads
   rather than only appearing once you scroll past it. The hero is
   narrower as a result (matches the main column, not the full
   container) — not a regression of the earlier "too large" fix,
   since the sidebar sitting right beside it now provides the visual
   balance that was missing before, from the very first viewport
   instead of only after scrolling. */
.post-hero-img {
    margin-top: 0;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-sm);
    border: var(--rule);
    overflow: hidden;
}
.post-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Optional — only add this when there's a real credit or explanation
   to give, same rule as the inline-image caption below. No color
   override on its links, for the same specificity reason noted there. */
.post-hero-caption {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-muted);
}

/* ── Two-column split ────────────────────────────────────────────── */
/* .post-main carries the actual reading content (intro through FAQ).
   .post-sidebar is ONE sticky column — TL;DR, contents, then related
   posts, all in natural document order. (An earlier version tried to
   split this into a sticky top zone and a bottom-aligned static zone
   via grid-template-areas + align-self:end — that overlapped broken
   in real browsers, not just a minor visual issue, so it's gone. One
   simple sticky box, stacked top to bottom, is the robust version of
   this pattern and what most sites with a sticky sidebar actually do.
   No max-height/overflow-y cap on it either (a nested scrollbar hid
   related posts). Instead, when the sidebar is taller than the screen,
   blog.js sets a negative top so it scrolls with the page until its
   bottom is in view, then sticks ("scroll then stick", 20 Nov 2026).
   Shorter sidebars keep top: 100px. Up to 960px it unwraps so TL;DR
   and contents follow the intro (see the media query at the end). */
.post-split {
    margin-top: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 64px;
}
.post-main { min-width: 0; }
.post-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── Intro paragraph(s) ──────────────────────────────────────────── */
/* Right after the hero, nothing else in front of it — same convention
   most publishers actually use (Axios, the common "summary right
   after the intro" pattern): the opening line is never blocked by a
   box, which is also why TL;DR/contents live in the sidebar now
   rather than stacked above the intro. */
.post-intro {
    margin-top: 40px;
}
.post-intro p {
    color: var(--text-body);
    margin-bottom: 20px;
}
.post-intro p:last-child { margin-bottom: 0; }

/* ── TL;DR box ───────────────────────────────────────────────────── */
/* Lives in .post-sidebar now — its flex gap handles spacing between
   this and the contents box, so no margin-top here. */
.post-tldr {
    background: var(--subtle);
    border: var(--rule);
    border-radius: var(--radius);
    padding: 24px;
}
.post-tldr-label {
    color: var(--accent-blue);
    margin-bottom: 10px;
    display: block;
}
.post-tldr ul {
    margin: 0;
    padding-left: 18px;
}
.post-tldr li {
    color: var(--text-body);
    margin-bottom: 8px;
}
.post-tldr li:last-child { margin-bottom: 0; }

/* ── Table of contents ──────────────────────────────────────────── */
/* Written into the HTML by scripts/build-toc.mjs from the <h2>s inside
   #post-body (so crawlers see the links), or left out under 2 headings.
   A <details>: on desktop blog.js keeps it open and the "Skip to
   Section" toggle is hidden, so it reads as the plain Contents box; up
   to 960px it's a closed toggle with the FAQ +/- icon. Without JS it
   stays a working toggle at every width. */
.post-toc {
    background: var(--subtle);
    border: var(--rule);
    border-radius: var(--radius);
    padding: 24px;
}
.post-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--fg);
    cursor: pointer;
    list-style: none;
}
.post-toc-toggle::-webkit-details-marker { display: none; }
.post-toc-toggle:hover, .post-toc[open] .post-toc-toggle { color: var(--accent-blue); }
.post-toc-toggle:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 4px; }
.post-toc-toggle:active { opacity: 0.8; }
.post-toc[open] .faq-icon::after { transform: translate(-50%,-50%) rotate(90deg); }
.post-toc[open] .post-toc-toggle { margin-bottom: 14px; }
.post-toc-toggle + .post-toc-label { display: none; }
@media (min-width: 961px) {
    .post-toc[open] .post-toc-toggle { display: none; }
    .post-toc[open] .post-toc-label { display: block; }
}
.post-toc-label {
    color: var(--text-muted);
    margin-bottom: 14px;
    display: block;
}
.post-toc ol {
    margin: 0;
    padding-left: 20px;
    counter-reset: toc;
}
.post-toc li { margin-bottom: 8px; }
.post-toc li:last-child { margin-bottom: 0; }
.post-toc a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-decoration-color: var(--link-underline);
    text-underline-offset: 2px;
}
.post-toc a:hover { text-decoration-color: var(--accent-blue); opacity: 0.8; }

/* ── Post body prose ─────────────────────────────────────────────── */
/* overflow-wrap: ordinary prose always wraps on spaces, so this does
   nothing visible for normal paragraphs — it only matters for a long
   unbroken string with no natural break point (a raw URL used as its
   own link text, e.g. a citation list), which would otherwise overflow
   its container instead of wrapping, pushing the whole page wider on
   mobile. Found on the first real migrated post's "Sources" list. */
#post-body {
    margin-top: 48px;
    overflow-wrap: break-word;
}
/* When the body opens with a paragraph (not a heading), it continues
   the intro, so keep the gap close to the paragraph rhythm. */
#post-body:has(> p:first-child) { margin-top: 24px; }
#post-body p {
    color: var(--text-body);
    margin-bottom: 20px;
}
#post-body p:last-child { margin-bottom: 0; }

/* Every media/table component below sets its own margin-top for the
   space before it, but none of them account for plain prose following
   directly after — components are normally followed by a heading
   (which has its own big margin-top), not a paragraph. Without this, a
   paragraph right after one of these sits flush against it with zero
   gap, breaking the page's 40px component rhythm. */
.post-image + p,
.post-video + p,
.post-media-split + p,
.post-image-row + p,
.post-image-grid + p,
.post-carousel + p,
.post-table-wrap + p { margin-top: 40px; }

/* scroll-margin-top: blog.js's _buildTOC() gives these the IDs the
   sidebar's Contents links jump to. Without this, a TOC click scrolls
   the heading flush to the very top of the viewport — right where the
   fixed header sits (~81px desktop, ~62px mobile) — so the heading
   lands hidden underneath it instead of visible. 100px matches the
   sticky sidebar's own top offset (.post-sidebar { top: 100px; }),
   same "clear the header plus a bit of breathing room" value already
   established for this page. */
#post-body h2 {
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-top: 48px;
    margin-bottom: 18px;
    scroll-margin-top: var(--space-section);
}
#post-body h3 {
    margin-top: 36px;
    margin-bottom: 14px;
}
/* First heading right after the intro shouldn't carry the full
   section gap — it reads as part of the same opening block. */
#post-body > p:first-child + h2,
#post-body > h2:first-child { margin-top: 0; }

#post-body ul, #post-body ol {
    margin: 0 0 20px;
    padding-left: 22px;
}
#post-body li {
    color: var(--text-body);
    margin-bottom: 8px;
}
#post-body li:last-child { margin-bottom: 0; }

/* No left border — that's the generic markdown-renderer default and
   reads as templated/AI-generated. Weight does the work of setting a
   quote apart from body text instead. */
#post-body blockquote {
    margin: 28px 0;
    padding-left: 20px;
    font-style: italic;
    color: var(--text-body);
}
/* Not uppercase/tracked like a meta-label — it now reads as a normal
   sentence ("Source: <link>"), not a short caption. */
#post-body blockquote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    color: var(--text-muted);
}

/* One hyperlink convention for the whole post, internal or external:
   blue + underline, so any link always reads as a link. External
   links already get this from shared.css's global a[target="_blank"]
   rule; this just applies the identical treatment to internal ones,
   which that rule doesn't reach since they carry no target attribute.
   Covers both #post-body and .post-intro — the intro sits outside
   #post-body (see the Intro component notes) but still needs the
   same link treatment, so it's listed explicitly here rather than
   assumed. */
#post-body a:not([target="_blank"]),
.post-intro a:not([target="_blank"]) {
    color: var(--accent-blue);
    text-decoration: underline;
    text-decoration-color: var(--link-underline);
    text-underline-offset: 2px;
}
#post-body a:not([target="_blank"]):hover,
.post-intro a:not([target="_blank"]):hover { text-decoration-color: var(--accent-blue); opacity: 0.8; }

/* ── Inline image / figure ──────────────────────────────────────── */
.post-image {
    margin-top: 40px;
}
.post-image-frame {
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-sm);
    border: var(--rule);
    overflow: hidden;
}
.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* ── Video (click-to-load YouTube) ───────────────────────────────── */
/* Thumbnail + play button until clicked; blog.js swaps in the player.
   Same frame treatment as inline images, at 16:9. */
.post-video { margin-top: 40px; }
.post-video-frame {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    border: var(--rule);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--fg);
}
.post-video-frame img,
.post-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}
/* The thumbnail is a link (opens YouTube without JS), so it would get
   the global external-link hover fade; the play button reacts instead. */
a.post-video-frame:hover { opacity: 1; }
a.post-video-frame:focus-visible { outline: 3px solid var(--accent-blue); outline-offset: 3px; }
.post-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 54px;
    margin: -27px 0 0 -38px;
    background: var(--accent-coral);
    border: var(--rule);
    border-radius: var(--radius-sm);
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.post-video-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -11px 0 0 -7px;
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #FFFFFF;
}
a.post-video-frame:hover .post-video-play { transform: scale(1.08); }
a.post-video-frame:active .post-video-play { transform: scale(0.96); }

/* Screenshots: show the whole image at its own shape instead of
   cropping it into the 3:2 frame. */
.post-image-natural .post-image-frame { aspect-ratio: auto; }
.post-image-natural img { height: auto; }
.post-image figcaption {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-muted);
}
/* Deliberately no color override on links inside figcaption — an
   external credit link must keep the global a[target="_blank"]
   blue/underline treatment. See CLAUDE.md "Known CSS/JS Gotchas":
   a per-component `color: inherit` on a link wins on specificity
   over that global rule and silently kills it. Already happened
   once elsewhere on this site; don't repeat it here. */

/* ── Media layouts ───────────────────────────────────────────────── */
/* Image/text split. `--reverse` swaps which side the image sits on
   (image right, text left) by reordering the image column only — the
   underlying markup order never changes, so a reader using a screen
   reader or reading-mode always gets the image before the text that
   follows it, same as the non-reversed version. If the text runs
   longer than the image, `align-items: start` keeps each column's own
   natural height instead of stretching the image to match (which
   would distort it) — the image just stays pinned to the top of its
   column and the text continues down past it in the text column, no
   wrapping tricks needed. Below 760px both stack to one column, image
   first either way, since there's no second column left to reverse. */
.post-media-split {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 32px;
}
.post-media-split .post-media-split-img {
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-sm);
    border: var(--rule);
    overflow: hidden;
}
.post-media-split .post-media-split-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-media-split .post-media-split-text p {
    color: var(--text-body);
    margin-bottom: 16px;
}
.post-media-split .post-media-split-text p:last-child { margin-bottom: 0; }
.post-media-split--reverse .post-media-split-img { order: 2; }
.post-media-split--reverse .post-media-split-text { order: 1; }

@media (max-width: 760px) {
    .post-media-split { grid-template-columns: 1fr; }
    .post-media-split--reverse .post-media-split-img,
    .post-media-split--reverse .post-media-split-text { order: initial; }
}

/* 2- and 3-image rows. Square (not the 3:2 single-image frame) so a
   row of them reads as a uniform strip rather than competing with the
   single inline image component above — same visual language as the
   square media tiles on the service pages. */
.post-image-row {
    margin-top: 40px;
    display: grid;
    gap: 16px;
}
.post-image-row-2 { grid-template-columns: 1fr 1fr; }
.post-image-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.post-image-row figure { margin: 0; }
.post-image-row .post-image-row-frame {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    border: var(--rule);
    overflow: hidden;
}
.post-image-row img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-image-row figcaption {
    margin-top: 8px;
    font-style: italic;
    color: var(--text-muted);
}
@media (max-width: 640px) {
    .post-image-row-3 { grid-template-columns: 1fr 1fr; }
    .post-image-row-3 figure:last-child { grid-column: 1 / -1; }
}

/* 6-image grid, 3 columns × 2 rows, square — for a post that wants to
   show a set of same-weight images (a gallery of examples, screenshots
   from a batch) with no single one implied as more important than the
   rest. Same frame treatment as the image rows above. */
.post-image-grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.post-image-grid figure { margin: 0; }
.post-image-grid .post-image-grid-frame {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    border: var(--rule);
    overflow: hidden;
}
.post-image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 640px) {
    .post-image-grid { grid-template-columns: 1fr 1fr; }
}

/* Carousel. Buttons, not auto-scroll — auto-scroll takes control away
   from the reader (they can't pause to actually look at one image) and
   needs its own pause-on-hover/pause-on-focus handling to be
   accessible at all. Scroll-snap does the actual snapping in pure CSS;
   blog.js only needs to scroll the track by one item's width per
   click. 3:2 aspect to match the single inline image component, since
   each slide IS essentially that component repeated. */
.post-carousel {
    margin-top: 40px;
    position: relative;
}
.post-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.post-carousel-track::-webkit-scrollbar { display: none; }
.post-carousel-track figure {
    margin: 0;
    flex: 0 0 100%;
    scroll-snap-align: start;
}
.post-carousel-frame {
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-sm);
    border: var(--rule);
    overflow: hidden;
}
.post-carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-carousel-track figcaption {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-muted);
}
.post-carousel-nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
.post-carousel-nav button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: var(--rule);
    background: var(--bg);
    color: var(--fg);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.post-carousel-nav button:hover { background: var(--subtle); }
.post-carousel-nav button:active { transform: scale(0.92); }

/* ── Data table ──────────────────────────────────────────────────── */
/* overflow-x:auto on the wrapper, never on the page — a wide table
   scrolls inside its own box instead of pushing the page width out
   and reintroducing the horizontal-scrollbar bug fixed elsewhere. */
.post-table-wrap {
    margin-top: 40px;
    overflow-x: auto;
    border: var(--rule);
    border-radius: var(--radius-sm);
}
.post-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}
/* Wraps rather than forcing horizontal scroll for a long cell — the
   overflow-x:auto on the wrapper stays as a safety net regardless
   (a single unbreakable long token, e.g. a URL, could still need it),
   but normal wrapping is the better default for typical content.
   vertical-align:top keeps rows looking right once cells in the same
   row can end up different heights. */
.post-table-wrap th, .post-table-wrap td {
    padding: 14px 18px;
    text-align: left;
    white-space: normal;
    vertical-align: top;
}
.post-table-wrap th {
    background: var(--fg);
    color: var(--bg);
}
.post-table-wrap tr:not(:last-child) td { border-bottom: 1.5px solid var(--subtle); }

/* On phones every post table stacks: each row becomes a small card with
   the column name above each cell (blog.js copies the header text into
   data-label), instead of 3-4 columns squeezed into ~340px. */
@media (max-width: 640px) {
    .post-table-wrap table, .post-table-wrap tbody,
    .post-table-wrap tr, .post-table-wrap td { display: block; width: 100%; }
    .post-table-wrap thead {
        position: absolute; width: 1px; height: 1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .post-table-wrap tr { padding: 16px 18px; }
    .post-table-wrap tr:not(:last-child) { border-bottom: 1.5px solid var(--subtle); }
    .post-table-wrap tr:not(:last-child) td { border-bottom: 0; }
    .post-table-wrap td { padding: 0; }
    .post-table-wrap td + td { margin-top: 10px; }
    .post-table-wrap td::before {
        content: attr(data-label);
        display: block;
        color: var(--fg);
    }
}

/* ── Code ────────────────────────────────────────────────────────── */
/* Inline <code> for file names and snippets, and pre.post-code for a
   block (e.g. an example file). Wraps instead of scrolling sideways so
   phones never get a horizontal scrollbar. Type: Code role in the Type
   system block (shared.css). */
#post-body code {
    background: var(--subtle);
    color: var(--fg);
    border-radius: var(--radius-sm);
    padding: 0.1em 0.35em;
    overflow-wrap: anywhere;
}
#post-body pre.post-code {
    margin: 0 0 20px;
    padding: 20px 24px;
    background: var(--subtle);
    border: var(--rule);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
#post-body pre.post-code code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
/* The items are the site-wide FAQ component (.faq-list > .faq-item,
   shared.css), same as the service pages; this only spaces the section
   inside a post. Native <details>, zero JS. */
.post-faq {
    margin-top: 56px;
}
/* A list or paragraph closing an expandable answer (FAQ, Sources) ends
   flush with the answer's own padding, not #post-body's 20px. */
#post-body .faq-answer > :last-child { margin-bottom: 0; }
.post-faq-title {
    margin-bottom: 20px;
}
/* ── Related posts ───────────────────────────────────────────────── */
/* Lives in .post-side-bottom now — a vertical stack (not a 3-column
   grid), sized for the 300px sidebar column. Its flex gap handles
   spacing against the author mention above it, so no margin-top. */
.post-related-title {
    margin-bottom: 16px;
}
.post-related-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
/* align-items back to stretch (the default) — a fixed aspect-ratio
   with centered alignment left a strip of the card's own background
   showing above and below the image whenever the text column (height
   set by however many lines the title wraps to) ran taller than the
   image's own ratio would. Stretch keeps the image flush with the
   card's top and bottom edges, no gap, every time. What actually
   fixes the "cropped square" look is a wider image column (140px, up
   from 84px) — wide enough that even stretched to a short 1-line-title
   card it still reads as landscape, not a near-square sliver. No
   category label any more (dropped per feedback) — that line's space
   goes to a bigger, more legible title instead. */
.related-post-card {
    display: flex;
    gap: 12px;
    text-decoration: none;
    background: var(--subtle);
    border: var(--rule);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.related-post-card:hover { border-color: var(--accent-blue); }
.related-post-card-img {
    width: 140px;
    flex-shrink: 0;
    overflow: hidden;
}
.related-post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.related-post-card-body { padding: 10px 12px 10px 0; min-width: 0; }
.related-post-card h3 {
    color: var(--fg);
    margin: 0 0 4px;
}
.related-post-card-date {
    color: var(--text-body);
}

/* Always shown, not just when there's overflow to point to — a
   standing link to the blog index, same hyperlink treatment as the
   table of contents above it. blog.js enforces the 3-card cap this
   exists alongside (see _capRelatedPosts) — a 4th or 5th hand-authored
   card gets removed at runtime rather than trusting every post to stop
   at 3 itself. */
.post-related-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    color: var(--accent-blue);
    text-decoration: underline;
    text-decoration-color: var(--link-underline);
    text-underline-offset: 2px;
}
.post-related-view-all:hover { text-decoration-color: var(--accent-blue); opacity: 0.8; }

/* ── Sidebar author mention (compact) ──────────────────────────────
   Not the full author card (see below) — that's too much for a
   300px column. Just enough to put a name/face next to the content,
   living at the top of .post-side-bottom, above related posts. */
/* ── Full author card (bottom of post, full width) ─────────────────
   The real E-E-A-T component: photo, name, job title, bio, links.
   Separate from the compact sidebar mention above — a bio paragraph
   and multiple links don't fit a 300px column, so this gets its own
   full-width spot after the two-column section ends. */
.post-author-card-wrap { margin-top: 64px; }
.post-author-card {
    background: var(--subtle);
    border: var(--rule);
    border-radius: var(--radius);
    padding: 36px 40px;
}
/* Explicit label so the component's purpose is unambiguous — to a
   reader skimming, and to search engines/crawlers parsing the page
   structure, not just implied by styling. Sits above the bordered box
   now, not inside it — inside, it stretched the box with an extra row
   of vertical space the box itself didn't need; as a heading for the
   box rather than a first row within it, it reads more like a label
   and less like part of the box's own content. */
.post-author-card-kicker {
    color: var(--accent-blue);
    margin: 0 0 12px;
    display: block;
}
.post-author-card-row {
    display: flex;
    gap: 28px;
    align-items: center;
}
.post-author-card img {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: var(--rule);
    flex-shrink: 0;
}
.post-author-card-body { flex: 1; min-width: 0; }
.post-author-card-name {
    margin-bottom: 2px;
}
.post-author-card-title {
    color: var(--text-muted);
    margin-bottom: 14px;
}
.post-author-card-bio {
    color: var(--text-body);
    margin-bottom: 16px;
}
.post-author-card-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.post-author-card-links a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-decoration-color: var(--link-underline);
    text-underline-offset: 2px;
}
.post-author-card-links a:hover { opacity: 0.8; }

/* ── Responsive ──────────────────────────────────────────────────── */
/* Below this width there isn't room for a comfortable 300px sidebar
   next to real body text, so it collapses to a single column, sidebar
   following the main content in plain document order (not sticky,
   not reordered). */
@media (max-width: 960px) {
    .post-split {
        grid-template-columns: minmax(0, 1fr); /* 1fr let wide content stretch the column past a 320px screen */
        gap: 40px;
    }
    /* One column: the sidebar would otherwise land after the whole
       article. Unwrap both columns and order their pieces so TL;DR and
       contents sit straight after the intro, and related posts stay at
       the end (Mitch, 21 Nov 2026). The HTML order is unchanged. */
    .post-split { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
    .post-main, .post-sidebar { display: contents; }
    .post-main > * { order: 2; min-width: 0; }
    .post-main > figure:first-child, .post-main > .post-intro { order: 0; }
    .post-tldr, .post-toc { order: 1; margin-top: 32px; }
    .post-sidebar > :last-child { order: 3; margin-top: 56px; }
    /* Whole box is the tap target: padding moves onto the toggle row. */
    .post-toc { padding: 0; }
    .post-toc-toggle { padding: 24px; }
    .post-toc[open] .post-toc-toggle { margin-bottom: 0; padding-bottom: 14px; }
    .post-toc ol { padding: 0 24px 24px 44px; }
}
@media (max-width: 640px) {
    .post-breadcrumb { padding-top: 72px; }
    .post-tldr { padding: 20px; }
    .post-toc-toggle { padding: 20px; }
    .post-toc ol { padding: 0 20px 20px 40px; }
    .post-author-card { padding: 28px; }
    .post-author-card-row { flex-direction: column; align-items: flex-start; }
    /* Mobile header is shorter (~62px vs ~81px desktop) — scaled down
       to match, same reasoning as the desktop value above. */
    #post-body h2 { scroll-margin-top: 80px; }
}
