/* ==========================================================================
   Single post (/blog/{slug}/). Built on the shared page kit (page.css: .pg-wrap,
   .pg-section, .pg-h2, .pg-close…). This file adds:
   .blog-post__*  header: crumbs, category chip, H1, meta row, edge-to-edge cover
   .blog-post__wide  the ~1160px container author-box/related use (was capped by
                      the site's 1440 .pg-wrap, leaving dead space — review item 1)
   .blog-post__grid  2-col from 1024: .blog-prose (720px) | .blog-toc (280px, sticky)
   .blog-toc-mobile   collapsed <details> right after the cover — never after the
                       article (review item 2); the sidebar below is desktop-only
   .blog-inline-cta   one contextual service prompt spliced ~25-35% into the article
                       (App\Support\Blog::spliceBeforeHeading, before the 3rd h2)
   .blog-prose    typographic rules for the rendered Markdown body + numbered h2
                   eyebrows (CSS counters) + a flatter "evidence" image treatment
   .blog-toc*     sticky sidebar TOC (14px, active-state) + service CTA card
   .blog-author*  wide author band: monogram, role, "4 businesses" stat, links
   .blog-cover*   honest editorial cover (duplicated — see blog.css's header note)
   .blog-grid/.blog-card  related posts (duplicated from blog.css — see its header note)
   Plan: design-runs/2026-09-28-site-v3/pages/00-plan.md §3
   Review: design-runs/2026-09-28-site-v3/review/blog-post/{chatgpt,triage}.md (2026-09-29)
   ========================================================================== */

.blog-post__hero { padding-block: clamp(28px, 4vw, 56px) clamp(32px, 4vw, 56px); background: var(--warm-50); border-bottom: 1px solid var(--color-border); }

.blog-post__cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: var(--tone-bg, var(--paper));
  color: var(--tone-ink, var(--ink-900));
  font-size: 0.875rem;
  font-weight: 700;
}

.blog-post__title {
  max-width: 44rem;
  margin: 18px 0 0;
  color: var(--ink-900);
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.blog-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--slate-600);
  font-size: 0.9375rem;
}

.blog-post__meta-name { color: var(--ink-900); font-weight: 700; }

/* Edge-to-edge, rectangular on purpose — contrast against the rounded cards
   elsewhere (review item 7). Hosts <x-blog.cover>, which fills it. Round 3: capped
   to exactly the reading-column width (720×405 = 16:9), not 900px — the wider
   figure left unused space beside it and a "half-wide" middle composition; now
   the article/sidebar relationship starts right underneath it on desktop. Phones
   keep near-full width (the cap only binds ≥720px viewports anyway). */
.blog-post__featured {
  width: min(100%, 720px);
  aspect-ratio: 16 / 9;
  margin: 32px 0 0;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* ---- The ~1160px container author-box/related use (review item 1) -------------- */

.blog-post__wide {
  max-width: 1160px;
  margin-inline: auto;
}

/* ---- Two-column body: 720px reading column | 280px sticky sidebar -------------- */

.blog-post__grid {
  display: grid;
  gap: 40px;
  padding-block: clamp(40px, 6vw, 72px);
}

@media (min-width: 1024px) {
  .blog-post__grid { grid-template-columns: minmax(0, 720px) 280px; align-items: start; gap: 48px; justify-content: space-between; }
}

/* ---- Mobile TOC: collapsed <details>, right after the cover (review item 2) --- */

.blog-toc-mobile { margin-top: 28px; }

.blog-toc-mobile__details {
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--warm-50);
}

.blog-toc-mobile__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  color: var(--ink-900);
  font-size: 0.9375rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.blog-toc-mobile__summary::-webkit-details-marker { display: none; }
.blog-toc-mobile__summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; border-radius: var(--r-lg); }

.blog-toc-mobile__chev { color: var(--slate-500); transition: transform var(--t-base) var(--ease-out); }
.blog-toc-mobile__details[open] .blog-toc-mobile__chev { transform: rotate(180deg); }

.blog-toc-mobile__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 4px 18px 16px;
  list-style: none;
}

.blog-toc-mobile__list a {
  display: block;
  padding: 6px 0;
  color: var(--slate-700);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}

.blog-toc-mobile__list a:hover,
.blog-toc-mobile__list a:focus-visible { color: var(--blue-700); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 1024px) {
  .blog-toc-mobile { display: none; }
}

/* ---- Mid-article contextual CTA (review item 5, round 3: "impossible to miss" —
   a real primary button + a secondary Book a Call, stronger heading, more padding,
   more separation from the surrounding paragraphs). Phones AND desktop. ---------- */

.blog-inline-cta {
  display: flex;
  gap: 16px;
  margin: 36px 0;
  padding: 20px 22px;
  border: 1px solid var(--tone-line, var(--color-border));
  border-left: 4px solid var(--tone-edge, var(--blue-600));
  background: var(--tone-bg, var(--warm-50));
  border-radius: var(--r-md);
}

.blog-inline-cta__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--tone-mark, var(--blue-600));
}

.blog-inline-cta__kicker { margin: 4px 0 0; color: var(--ink-900); font-size: 1.0625rem; font-weight: 700; }
.blog-inline-cta__text { margin: 4px 0 0; color: var(--slate-700); font-size: 0.9375rem; line-height: 1.5; }

.blog-inline-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ".blog-inline-cta " prefix (not just the bare class) is load-bearing: this sits
   inside .blog-prose, and .blog-prose a {text-decoration:underline} (0,1,1) would
   otherwise beat a bare .blog-inline-cta__btn (0,1,0) and underline the button text. */
.blog-inline-cta .blog-inline-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 18px;
  border-radius: var(--r-md);
  background: var(--tone-mark, var(--blue-600));
  color: var(--paper);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
}

.blog-inline-cta .blog-inline-cta__btn:hover { filter: brightness(0.92); color: var(--paper); }

.blog-inline-cta .blog-inline-cta__btn--ghost {
  background: transparent;
  border: 1.5px solid var(--tone-edge, var(--slate-300));
  color: var(--tone-ink, var(--ink-900));
}

.blog-inline-cta .blog-inline-cta__btn--ghost:hover { filter: none; border-color: var(--tone-mark, var(--ink-900)); }

/* The second, much smaller CTA (~55-65% in) — a plain text line, not another card. */
.blog-inline-cta-mini {
  margin: 28px 0;
  padding-left: 14px;
  border-left: 2px solid var(--tone-edge, var(--blue-600));
  color: var(--slate-700);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.blog-inline-cta-mini a { color: var(--tone-ink, var(--blue-700)); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Prose: the rendered Markdown body ------------------------------------------ */

.blog-prose {
  max-width: 45rem; /* ~720px, matches the reading column */
  color: var(--slate-800, var(--ink-900));
  font-size: 1.0625rem;
  line-height: 1.72;
  counter-reset: section;
}

.blog-prose > :first-child { margin-top: 0; }

.blog-prose p { margin: 0 0 18px; text-wrap: pretty; }

/* Numbered section eyebrows via CSS counters — no content rewriting (review item 4). */
.blog-prose h2 {
  counter-increment: section;
  margin: 44px 0 16px;
  padding-top: 4px;
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-size: clamp(1.4375rem, 1.2rem + 0.9vw, 1.875rem);
  font-weight: 600;
  line-height: 1.2;
  scroll-margin-top: calc(var(--bar-h) + 20px);
}

.blog-prose h2::before {
  content: counter(section, decimal-leading-zero) " /";
  display: block;
  margin-bottom: 8px;
  color: var(--blue-600);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.blog-prose h3 {
  margin: 30px 0 12px;
  color: var(--ink-900);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.35;
  scroll-margin-top: calc(var(--bar-h) + 20px);
}

/* FAQ h3s become card rows (round 3, item 3 — App\Support\Blog::wrapFaqRows wraps
   each h3 + its answer paragraph(s), no content changes). */
.blog-prose__faq-row {
  padding: 16px 18px;
  margin: 0 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  background: var(--warm-50);
}

.blog-prose__faq-row h3 { margin: 0 0 8px; }
.blog-prose__faq-row p:last-child { margin-bottom: 0; }

/* Every top-level list becomes a compact tinted "checklist card" (round 3, item 3:
   lower-article visual pacing) — a tone wash, a check/number badge per item, no new
   content. Lists nested inside a list item stay plain to avoid a card-in-card look. */
.blog-prose > ul,
.blog-prose > ol {
  counter-reset: item;
  margin: 0 0 22px;
  padding: 18px 20px 18px 18px;
  list-style: none;
  display: grid;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  background: var(--warm-50);
}

.blog-prose li { line-height: 1.62; }
.blog-prose li > ul, .blog-prose li > ol { margin: 8px 0 0; padding-left: 1.4em; }

.blog-prose > ul > li,
.blog-prose > ol > li {
  position: relative;
  padding-left: 30px;
}

.blog-prose > ul > li::before,
.blog-prose > ol > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--paper);
  font-size: 0.6875rem;
  font-weight: 700;
}

.blog-prose > ul > li::before { content: "✓"; }
.blog-prose > ol > li { counter-increment: item; }
.blog-prose > ol > li::before { content: counter(item); }

.blog-prose strong { color: var(--ink-900); font-weight: 700; }

.blog-prose a {
  color: var(--blue-700);
  text-decoration: underline;
  text-decoration-color: var(--slate-300);
  text-underline-offset: 3px;
}

.blog-prose a:hover { color: var(--blue-800); text-decoration-color: currentColor; }

.blog-prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--slate-100);
  color: var(--ink-900);
  font-size: 0.9em;
}

/* Hand-note/serif treatment (round 3, item 3): a paper wash + a real quote mark,
   not just an italic left-rule. */
.blog-prose blockquote {
  position: relative;
  margin: 26px 0;
  padding: 18px 22px 18px 44px;
  border-left: 3px solid var(--blue-600);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--warm-50);
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-style: italic;
  line-height: 1.5;
}

.blog-prose blockquote::before {
  content: "“";
  position: absolute;
  left: 12px;
  top: 6px;
  color: var(--blue-600);
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-style: normal;
  line-height: 1;
  opacity: 0.6;
}

.blog-prose table {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.blog-prose th,
.blog-prose td {
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  text-align: left;
}

.blog-prose th { background: var(--warm-50); color: var(--ink-900); font-weight: 700; }

/* A flatter "evidence" treatment (thin border, small caption) — not a big rounded
   shadow card (review item 4). Inline images stay as published; only the frame
   changed. */
.blog-post__figure {
  margin: 28px 0;
}

.blog-prose h2 + .blog-post__figure,
.blog-prose h2 + p + .blog-post__figure {
  margin-top: 28px;
}

.blog-post__figure picture,
.blog-post__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--slate-300);
}

.blog-post__figure figcaption {
  margin-top: 8px;
  color: var(--slate-600); /* --slate-500 measured 4.35:1 here, AA needs 4.5:1 */
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .blog-prose { font-size: 1.125rem; }
}

@media (min-width: 768px) {
  .blog-prose h2 { margin-top: 64px; }
  .blog-prose p { margin-bottom: 22px; } /* 20-24px desktop (round 3) — phones keep 18px */
}

/* ---- Sidebar: TOC + service CTA (desktop only — review item 2) ----------------- */

.blog-toc { display: none; }

@media (min-width: 1024px) {
  .blog-toc {
    display: grid;
    gap: 24px;
    position: sticky;
    top: calc(var(--bar-h) + 32px);
  }
}

.blog-toc__nav {
  padding: 22px 20px; /* more generous (round 3) */
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--warm-50);
}

.blog-toc__title {
  margin: 0 0 12px;
  color: var(--slate-600);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.blog-toc__nav ol {
  counter-reset: tocsection;
  display: grid;
  gap: 9px; /* was 1px — items read as one dense block (round 3) */
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--slate-200);
}

.blog-toc__nav li { counter-increment: tocsection; }

.blog-toc__nav a {
  display: flex;
  gap: 6px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid transparent;
  margin-left: -2px;
  color: var(--slate-700);
  font-size: 0.875rem; /* ≥14px */
  line-height: 1.35;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}

/* "01 /" prefix matching the article's own h2 eyebrows (round 3, item 4). */
.blog-toc__nav a::before {
  content: counter(tocsection, decimal-leading-zero) " /";
  flex-shrink: 0;
  color: var(--slate-400);
  font-weight: 700;
}

.blog-toc__nav a:hover,
.blog-toc__nav a:focus-visible { color: var(--blue-700); }

/* Active-state (App\Support progressive JS: public/js/blog-post.js, IntersectionObserver).
   Stronger than a hairline: a wider tone bar + bold weight + a tinted number (round 3). */
.blog-toc__nav a.is-active {
  border-left-width: 3px;
  border-left-color: var(--blue-600);
  margin-left: -3px;
  padding-left: 13px;
  color: var(--blue-700);
  font-weight: 700;
}

.blog-toc__nav a.is-active::before { color: var(--blue-600); }

.blog-toc__cta {
  padding: 20px;
  border: 1px solid var(--tone-line, var(--color-border));
  border-radius: var(--r-lg);
  background: var(--tone-bg, var(--warm-50));
}

.blog-toc__cta-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--tone-mark, var(--blue-600));
}

.blog-toc__cta-title { margin: 12px 0 0; color: var(--ink-900); font-size: 1rem; font-weight: 700; }
.blog-toc__cta-text { margin: 6px 0 0; color: var(--slate-700); font-size: 0.875rem; line-height: 1.5; }

.blog-toc__cta-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 12px;
  color: var(--tone-ink, var(--ink-900));
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
}

.blog-toc__cta-link:hover { text-decoration: underline; }

.blog-toc__cta-link--wa { color: #116149; } /* darkened from WhatsApp's #128C7E: 3.74:1 on the amber tone failed AA (needs 4.5:1) */
.blog-toc__cta-link--wa svg { width: 18px; height: 18px; }

/* ---- Author box: a wide band, not a small card (review item 6) ----------------- */

.blog-author {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px 20px;
  padding: 28px 0;
  margin-bottom: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.blog-author__label { margin: 0; color: var(--slate-600); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.blog-author__name { margin: 2px 0 0; color: var(--ink-900); font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
.blog-author__role { margin: 2px 0 0; color: var(--slate-600); font-size: 0.9375rem; font-weight: 600; }
.blog-author__bio { margin: 10px 0 0; color: var(--slate-700); font-size: 0.9375rem; line-height: 1.55; max-width: 46rem; }

.blog-author__stat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--ink-900);
  font-size: 0.9375rem;
  font-weight: 600;
}

.blog-author__stat svg { flex-shrink: 0; color: var(--blue-600); }

.blog-author__links { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.blog-author__links a { color: var(--blue-700); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 640px) {
  .blog-author { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
}

/* ---- Related posts: two big cards, edge-to-edge (review items 1 + 7) ----------- */

.blog-related { background: var(--paper); border-top: 1px solid var(--color-border); }

.blog-related__eyebrow { margin: 0; }
.blog-related__title { margin: 12px 0 0; margin-bottom: clamp(24px, 3vw, 40px); }

.blog-related .blog-grid { grid-template-columns: minmax(0, 1fr); }

@media (min-width: 640px) {
  .blog-related .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-related .blog-card { border-radius: 0; } /* rectangular here for contrast against the rounded cards elsewhere */
}

/* ---- Shared post card + editorial cover (duplicated — see blog.css's header note) - */

.blog-grid {
  display: grid;
  gap: clamp(24px, 2.4vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  background: var(--paper);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}

.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-panel); }

.blog-card__media { position: relative; aspect-ratio: 2 / 1; overflow: hidden; background: var(--slate-100); } /* -10-15% shorter than 16:9 (round 3): ~160-180px on phones, more room for title/excerpt */

.blog-card__body { display: flex; flex-direction: column; gap: 10px; padding: clamp(24px, 2.6vw, 32px); flex: 1; }
.blog-card__title { margin: 0; font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem); font-weight: 700; line-height: 1.28; }
.blog-card__link { color: var(--ink-900); text-decoration: none; }
.blog-card__link::after { content: ""; position: absolute; inset: 0; }
.blog-card__link:hover { color: var(--blue-700); }
.blog-card__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }

.blog-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--slate-700);
  font-size: 0.9375rem;
  line-height: 1.55;
  flex: 1;
}

.blog-card__meta { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--slate-500); font-size: 0.8125rem; font-weight: 500; }

.blog-cover {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--tone-bg, var(--warm-50));
  display: flex;
  align-items: flex-end;
}

/* Article-specific line art (round 3: replaces the generic dot-grid — the same
   texture behind every cover read as "one component with different labels").
   Fills the cover, so it reads as illustration, not a decorative corner accent. */
.blog-cover__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 9%;
  color: var(--tone-ink, var(--slate-400));
  opacity: 0.34;
}

/* 15-20% smaller than before (was 40%), so the line art carries the composition. */
.blog-cover__icon {
  position: absolute !important;
  top: 9%;
  right: 7%;
  width: 32% !important;
  height: auto !important;
  color: var(--tone-ink, var(--blue-600));
  opacity: 0.22;
}

.blog-cover__text {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  padding: clamp(16px, 3vw, 26px);
  width: 100%;
}

.blog-cover__cat {
  color: var(--tone-ink, var(--ink-900));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-cover__words {
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.05rem + 1.1vw, 1.75rem);
  line-height: 1.15;
}

/* The post hero's own cover is bigger — a larger word treatment to match. */
.blog-post__featured .blog-cover__text { padding: clamp(20px, 3vw, 32px); }
.blog-post__featured .blog-cover__words { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); }

/* Gate: body copy ≥16px on phones (final sweep 2026-09-29). */
@media (max-width: 639.98px) {
  .blog-card__excerpt, .blog-inline-cta__text, .blog-author__bio { font-size: 1rem; }
}
