/* ═══════════════════════════════════════════════════════════════════
   blog-post.css — /blog/:slug
   Redesigned 2026-08-06. Replaces the legacy extract (kept as
   blog-post.legacy.bak for reference).

   NO :root, NO RESET, NO body{} IN THIS FILE — see the header comment in
   blog-index.css for why that rule exists.

   THE MEASURE IS THE DESIGN. Everything else here is in service of one
   number: 68 characters per line at 1.125rem. That is the band where
   long-form prose stops being work to read. The TOC rail, the max-widths
   and the grid all exist to protect it — on a 27" monitor the article does
   not stretch to 1200px just because the space is there.

   Dark hero, light article. Browsing wants the brand; reading wants
   contrast and a paper-like surface.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reading progress ──────────────────────────────────────────── */
.post-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 200;
    background: transparent;
    pointer-events: none;
}
#post-progress-bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--amber);
    /* No transition on width. The bar is driven from a scroll handler inside
       requestAnimationFrame, so it is already frame-aligned; a CSS transition
       on top of that makes it lag behind the scroll position visibly. */
}

/* ── Hero ──────────────────────────────────────────────────────── */
#post-hero {
    background: var(--dark);
    color: var(--light);
    padding: 8rem var(--gutter) 3.5rem;
    border-bottom: 1px solid var(--border-dark);
}
#post-hero .wrap { max-width: 860px; }

.post-crumbs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.75rem;
}
.post-crumbs a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.2s;
}
.post-crumbs a:hover { color: var(--amber); }

#post-hero h1 {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.032em;
    margin-bottom: 1.25rem;
}

/* The standfirst is the excerpt, promoted. It is the one piece of copy that
   tells a reader whether to commit six minutes, so it gets real size. */
.post-standfirst {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.62);
    max-width: 60ch;
    margin-bottom: 2rem;
}

.post-byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
}
.post-byline-who { color: rgba(255, 255, 255, 0.7); }
.post-byline a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.25);
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.post-byline a:hover { color: var(--amber); }

/* .blog-dot is defined in blog-index.css, which this page does not load. */
.blog-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
    vertical-align: middle;
    flex: none;
}

/* ── The reading surface ───────────────────────────────────────── */
#post-shell {
    background: #ffffff;
    color: #16181d;
    padding: 4.5rem var(--gutter) 5rem;
}

/*
  Two columns, and the CONTENT column is fixed while the rail is not.
  Written as `minmax(0, 68ch)` rather than a percentage so the measure holds
  at any viewport; a percentage column would widen the line length on a large
  monitor, which is the exact failure this layout exists to prevent.

  justify-content:center keeps the pair optically centred rather than
  left-anchored inside .wrap.
*/
.post-grid {
    display: grid;
    grid-template-columns: minmax(0, 68ch);
    justify-content: center;
    gap: 3.5rem;
    max-width: var(--max-w);
}
@media (min-width: 1080px) {
    .post-grid {
        grid-template-columns: 210px minmax(0, 68ch);
        gap: 4.5rem;
    }
}

/* ── Table of contents ─────────────────────────────────────────── */
.post-toc {
    display: none;
}
@media (min-width: 1080px) {
    .post-toc {
        display: block;
        position: sticky;
        /* Clears the fixed nav pill with room to breathe. */
        top: 7rem;
        align-self: start;
        max-height: calc(100vh - 9rem);
        overflow-y: auto;
        font-size: 0.85rem;
        line-height: 1.5;
    }
}
.post-toc[hidden] { display: none !important; }

.post-toc-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9aa1ad;
    margin-bottom: 1rem;
}
.post-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid #e6e8ec;
}
.post-toc li { margin: 0; }
.post-toc a {
    display: block;
    padding: 0.4rem 0 0.4rem 1rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.18s, border-color 0.18s;
}
.post-toc a:hover { color: #16181d; }
.post-toc a.is-current {
    color: var(--amber);
    border-left-color: var(--amber);
    font-weight: 600;
}
.post-toc .toc-sub a {
    padding-left: 1.9rem;
    font-size: 0.8rem;
    color: #8b93a1;
}

/* ── Article typography ────────────────────────────────────────── */
.post-body {
    font-size: 1.125rem;
    line-height: 1.78;
    color: #23262d;
    /* Old-style figures read better inside running prose; tabular numerals
       are for tables and the meta rows, not sentences. */
    font-variant-numeric: proportional-nums;
}

.post-featured-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    margin-bottom: 3rem;
}

.post-body > * + * { margin-top: 1.5rem; }

.post-body h2 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.6vw, 1.95rem);
    line-height: 1.22;
    letter-spacing: -0.022em;
    color: #0f1115;
    margin-top: 3.25rem;
    /* scroll-margin, not padding: the TOC anchors jump to these, and without
       it the fixed nav pill lands on top of the heading you just clicked. */
    scroll-margin-top: 6rem;
}
.post-body h3 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: #0f1115;
    margin-top: 2.5rem;
    scroll-margin-top: 6rem;
}
.post-body h2 + p,
.post-body h3 + p { margin-top: 0.85rem; }

.post-body p { margin-top: 1.45rem; }

.post-body a {
    color: #0f1115;
    text-decoration: underline;
    text-decoration-color: var(--amber);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.18s;
}
.post-body a:hover { color: var(--amber); }

.post-body ul,
.post-body ol { padding-left: 1.35rem; }
.post-body li { margin-top: 0.55rem; }
.post-body li::marker { color: var(--amber); }

.post-body blockquote {
    border-left: 3px solid var(--amber);
    padding: 0.35rem 0 0.35rem 1.5rem;
    margin-top: 2rem;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #3d424c;
    font-style: italic;
}
.post-body blockquote p { margin-top: 0.6rem; }
.post-body blockquote p:first-child { margin-top: 0; }

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: #f2f4f7;
    border: 1px solid #e6e8ec;
    border-radius: 4px;
    padding: 0.12em 0.38em;
}
.post-body pre {
    background: #0f1115;
    color: #e8eaee;
    border-radius: 10px;
    padding: 1.25rem 1.35rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 2rem;
}
.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    margin-top: 2rem;
}

.post-body hr {
    border: none;
    border-top: 1px solid #e6e8ec;
    margin-top: 3rem;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-top: 2rem;
    font-variant-numeric: tabular-nums;
}
.post-body th,
.post-body td {
    border-bottom: 1px solid #e6e8ec;
    padding: 0.7rem 0.6rem;
    text-align: left;
}
.post-body th {
    font-weight: 700;
    color: #0f1115;
    border-bottom-color: #c9ced8;
}

/* ── Tags ──────────────────────────────────────────────────────── */
.post-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e6e8ec;
}
.post-tags li { margin: 0; }
.post-tags a {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border: 1px solid #e0e3e9;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #5b6270;
    text-decoration: none;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.post-tags a:hover {
    color: var(--amber);
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.05);
}

/* ── Author ────────────────────────────────────────────────────── */
.post-author {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    margin-top: 2.5rem;
    padding: 1.75rem;
    background: #f7f8fa;
    border: 1px solid #e9ecf1;
    border-radius: 14px;
}
.post-author-avatar {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--dark);
    color: var(--amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.post-author-name {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    color: #0f1115;
    margin-bottom: 0.3rem;
}
.post-author-name a {
    color: inherit;
    text-decoration: none;
}
.post-author-name a:hover { color: var(--amber); }
.post-author-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #5b6270;
}

/* ── Related ───────────────────────────────────────────────────── */
#post-related {
    background: var(--dark-2);
    color: var(--light);
    padding: 5rem var(--gutter);
    border-top: 1px solid var(--border-dark);
}
#post-related h2 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.025em;
    margin-bottom: 2.5rem;
}
.rel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 900px) { .rel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .rel-grid { grid-template-columns: 1fr; } }

.rel-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.rel-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 1200 / 630;
    height: auto;
    object-fit: cover;
    /* The card already has a radius and overflow:hidden; a second radius here
       leaves a hairline of card background in each top corner. */
    border-radius: 0;
}
.rel-card-body { padding: 1.5rem; }
.rel-card:hover {
    border-color: rgba(217, 119, 6, 0.4);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}
.rel-card-cat {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 0.75rem;
}
.rel-card h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -0.015em;
    margin-bottom: 0.6rem;
}
.rel-card p {
    font-size: 0.87rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1rem;
}
.rel-card-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ── CTA ───────────────────────────────────────────────────────── */
#post-cta {
    background: var(--dark);
    color: var(--light);
    padding: 6rem var(--gutter);
    text-align: center;
    border-top: 1px solid var(--border-dark);
}
#post-cta h2 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    letter-spacing: -0.028em;
    margin-bottom: 1rem;
}
#post-cta p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.02rem;
    max-width: 46ch;
    margin: 0 auto 2.25rem;
}
.btn-amber {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--amber);
    color: #fff;
    padding: 0.9rem 1.85rem;
    border-radius: 2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-amber:hover {
    background: var(--amber-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.3);
}

@media (max-width: 820px) {
    #post-hero { padding-top: 6.5rem; }
    #post-shell { padding-top: 3rem; }
    .post-body { font-size: 1.06rem; }
}

/* ── Print ─────────────────────────────────────────────────────── */
/* These posts are how-to guides; people print and PDF them. Two lines to
   stop the rail, the progress bar and the CTA wasting paper. */
@media print {
    .post-progress,
    .post-toc,
    #post-related,
    #post-cta { display: none !important; }
    #post-hero { background: #fff; color: #000; padding: 0 0 1.5rem; }
    #post-hero h1, .post-standfirst, .post-byline, .post-crumbs { color: #000; }
    #post-shell { padding: 0; }
    .post-grid { display: block; }
}

/* See the note in blog-index.css: `.eyebrow` is in home.css but the amber
   modifier only existed in the legacy extracts this file replaced. */
.eyebrow-amber { color: var(--amber); }

/* ─────────────────────────────────────────────────────────────────
   UNDOING home.css's MOBILE SLEDGEHAMMER

   home.css loads on every page and, inside @media (max-width: 768px), sets
   `section { padding: 2.75rem !important }` and
   `h2 { font-size: clamp(1.9rem, 6.5vw, 2.5rem) !important }`.

   Both were written for the home page and both reach every <section> and
   <h2> on the site. Here they flatten the related and CTA blocks and blow up
   every heading inside the article body — an h2 mid-article rendering at the
   same size as a page title destroys the reading hierarchy completely.

   #post-hero escapes it only because it is a <header>, not a <section>.
   That is luck, not design, so it is written down here rather than relied on
   silently.

   !important can only be beaten by !important; these selectors are more
   specific than the blanket ones, so they win.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #post-related,
    #post-cta {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
    .post-body h2 { font-size: clamp(1.35rem, 5.2vw, 1.6rem) !important; }
    #post-related h2 { font-size: 1.5rem !important; }
    #post-cta h2 { font-size: 1.7rem !important; }
}
