/* Brand 2.0 blog article.
   brand.css already carries the editorial vocabulary the customer stories use:
   .splash, .hero-grid, .kicker, .dek, .attrib, .statstrip, .story-body, .lede,
   .turn, .pullquote, .final, .faq, .related, .close. A blog post needs four
   things those pages never needed: in-article headings, inline source links,
   lists, and a takeaways block. Those are the only rules here.

   Scoped to this stylesheet rather than added to brand.css so a blog change
   cannot touch the 25 pages that load brand.css. Loaded after brand.css. */

@layer brand.components {

  /* 1. In-article headings -------------------------------------------------
     A section h2 in brand.css is clamp(28px, 3.5vw, 42px), sized to open a
     band on a landing page. Inside a measure-width article that reads as a
     shout, so these step down and lean on space above rather than size. */
  .story-body h2 {
    margin: 52px 0 18px;
    font-size: clamp(23px, 2.5vw, 29px);
    letter-spacing: -.028em;
    line-height: 1.18;
    font-weight: 700;
    color: var(--ink);
    /* No ch cap. A heading narrower than the copy under it reads as a second
       column; balance alone gives an even rag across the full measure. */
    text-wrap: balance;
  }

  .story-body h3 {
    margin: 36px 0 12px;
    font-size: clamp(18px, 1.8vw, 20px);
    letter-spacing: -.015em;
    line-height: 1.3;
    font-weight: 650;
    color: var(--ink);
  }

  /* 2. Source links --------------------------------------------------------
     Every third-party number in the body carries its source. The link is the
     evidence, so it is marked with --signal and a hairline rather than left to
     look like body copy. */
  .story-body p > a,
  .story-body li > a {
    color: var(--signal);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--signal) 34%, transparent);
    transition: border-color .18s var(--ease);
  }
  .story-body p > a:hover,
  .story-body li > a:hover { border-bottom-color: var(--signal); }

  /* 3. Lists ---------------------------------------------------------------
     Matched to .story-body p so a list does not change the reading size. */
  .story-body ul,
  .story-body ol {
    margin: 0 0 24px;
    padding-left: 22px;
    max-width: var(--measure);
  }
  .story-body li {
    margin: 0 0 10px;
    font-size: 18.5px;
    line-height: 1.68;
    font-weight: 450;
    color: var(--ink);
    text-wrap: pretty;
  }
  .story-body li::marker { color: var(--signal); }

  /* 4. Takeaways -----------------------------------------------------------
     The answer block, read first and quoted most. Brand 2.0 has no rounded
     cards and no shadows, so this is a paper field behind a signal rule. */
  .takeaways {
    margin: 0 0 40px;
    padding: 24px 26px;
    background: var(--paper);
    border-left: 3px solid var(--signal);
    border-radius: var(--radius);
  }
  .takeaways .kicker { margin: 0 0 12px; }
  .takeaways ul { margin: 0; padding-left: 20px; }
  .takeaways li { font-size: 17px; line-height: 1.6; }
  .takeaways li:last-child { margin-bottom: 0; }

  /* 4b. Contents -----------------------------------------------------------
     No post in the corpus had one. On anything past ~1,500 words it lets a
     reader skim and gives an AI engine an explicit section map. Hairlines
     only, numbers in signal, no box. */
  .toc { margin: 0 0 44px; padding: 18px 0 2px; border-top: 1px solid var(--line); }
  .toc .kicker { margin: 0 0 12px; }
  .toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
  .toc li {
    margin: 0 0 9px;
    padding-left: 30px;
    position: relative;
    font-size: 16px; line-height: 1.45; font-weight: 500;
    counter-increment: toc;
  }
  .toc li::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute; left: 0; top: 1px;
    font-size: 12px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--signal);
  }
  .toc a { color: var(--ink2); text-decoration: none; }
  .toc a:hover { color: var(--signal); }

  /* An anchored heading must clear the sticky nav when jumped to. */
  .story-body h2[id] { scroll-margin-top: 96px; }

  /* 5. Source line ---------------------------------------------------------
     Sits under a statstrip or a figure and credits the research. */
  .srcnote {
    margin: -28px 0 44px;
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 500;
    color: var(--ink2);
  }
  .srcnote a { color: var(--ink2); text-decoration: underline; text-underline-offset: 2px; }
  .srcnote a:hover { color: var(--signal); }

  /* The hero statstrip sits directly above the source line, so the stat's own
     bottom margin is removed rather than fought with a negative value. */
  .splash .statstrip + .srcnote { margin-top: 18px; margin-bottom: 0; }

  /* 6. Figures and charts --------------------------------------------------
     246 posts and not one chart, on a blog made of percentages. Charts are
     inline SVG rather than a library: no build step, works with JS off, and
     the values stay as <text> so a crawler reads the numbers rather than an
     image. Brand 2.0 rules apply - hairline axes, no gridlines, no shadows,
     and --signal reserved for the one series the section is about. */
  .fig { margin: 40px 0 44px; }
  .fig svg { display: block; width: 100%; height: auto; }

  /* Series colours. The muted series is the "before"; signal is the series
     being argued about, and there is only ever one of those per chart. */
  .fig .s-past { fill: color-mix(in srgb, var(--ink) 16%, transparent); }
  .fig .s-now  { fill: var(--signal); }

  /* Axis baseline is the only rule on the chart. */
  .fig .axis { stroke: var(--line); stroke-width: 1; }

  .fig .v-lab {
    font-family: var(--font-sans);
    font-size: 15px; font-weight: 700;
    letter-spacing: -.01em;
    fill: var(--ink);
  }
  .fig .c-lab {
    font-family: var(--font-sans);
    font-size: 14px; font-weight: 600;
    fill: var(--ink);
  }
  .fig .k-lab {
    font-family: var(--font-sans);
    font-size: 13px; font-weight: 600;
    fill: var(--ink2);
  }

  .fig-key { display: flex; gap: 18px; margin: 0 0 14px; }
  .fig-key span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink2); }
  .fig-key i { width: 11px; height: 11px; border-radius: var(--radius); flex: none; }
  .fig-key i.past { background: color-mix(in srgb, var(--ink) 16%, transparent); }
  .fig-key i.now  { background: var(--signal); }

  .fig-caption {
    margin: 14px 0 0;
    font-size: 15px; line-height: 1.5; font-weight: 550;
    color: var(--ink);
  }
  .fig-source {
    margin: 5px 0 0;
    font-size: 13px; line-height: 1.5; font-weight: 500;
    color: var(--ink2);
  }
  .fig-source a { color: var(--ink2); text-decoration: underline; text-underline-offset: 2px; }
  .fig-source a:hover { color: var(--signal); }

  /* A single number that carries a section on its own. */
  .bignum { margin: 40px 0 44px; padding-left: 26px; border-left: 3px solid var(--signal); }
  .bignum strong {
    display: block;
    font-size: clamp(42px, 6vw, 64px);
    font-weight: 700; letter-spacing: -.04em; line-height: 1;
    color: var(--ink);
  }
  .bignum span { display: block; margin-top: 10px; font-size: 16px; line-height: 1.5; font-weight: 500; color: var(--ink2); max-width: 46ch; }

  @media (max-width: 760px) {
    .fig .v-lab { font-size: 17px; }
    .fig .c-lab, .fig .k-lab { font-size: 16px; }
  }

  /* 7. Byline --------------------------------------------------------------
     .attrib in brand.css is a text credit. A post has a person behind it, so
     the headshot comes too. Same 2px corner as everything else. */
  .byline { display: flex; align-items: center; gap: 11px; margin: 0 0 40px; }
  .byline img {
    width: 40px; height: 40px; flex: none;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--paper);
  }
  .byline .who { font-size: 14px; font-weight: 650; color: var(--ink); line-height: 1.35; }
  .byline .who span { display: block; font-weight: 500; color: var(--ink2); }
  /* Author card, at the foot of a post. The reader has just finished the
     argument, so this is where they decide whether the person is worth
     following. Hairline rule, no box. */
  .author-card {
    display: flex; gap: 18px; align-items: flex-start;
    margin: 56px 0 0; padding: 26px 0 0;
    border-top: 1px solid var(--line);
  }
  .author-card img {
    width: 56px; height: 56px; flex: none;
    border-radius: var(--radius);
    object-fit: cover; background: var(--paper);
  }
  .author-card .ac-body { min-width: 0; }
  .author-card .ac-name { margin: 0 0 6px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
  .author-card .ac-name a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
  .author-card .ac-name a:hover { color: var(--signal); border-bottom-color: var(--signal); }
  .author-card p.ac-bio { margin: 0; font-size: 15.5px; line-height: 1.6; font-weight: 450; color: var(--ink2); }

  @media (max-width: 560px) {
    .author-card { flex-direction: column; gap: 14px; }
  }

  /* Author page portrait. Bigger than a byline chip, same 2px corner. */
  .author-shot {
    display: block;
    width: 88px; height: 88px;
    margin: 0 0 22px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--paper);
  }

  /* The name links to the author page. It is a name first and a link second,
     so it takes the hairline only on hover. */
  .byline .who a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
  .byline .who a:hover { border-bottom-color: var(--signal); color: var(--signal); }

  @media (max-width: 760px) {
    .story-body h2 { margin-top: 42px; }
  }

  @media print {
    .story-body h2 { margin-top: 24pt; font-size: 15pt; }
    .takeaways { border-left-color: #000; background: none; }
  }
}
