/* ============================================================================
   brand-article.css: what a blog post on the article template needs beyond
   page-blog-article.css.
   ----------------------------------------------------------------------------
   A post on the template (promenade #438) loads, in this order:
     brand-chrome.css, brand.css, page-blog-article.css, brand-article.css

   brand.css carries the editorial vocabulary (.splash, .story-body, .lede,
   .faq, .related, .close) and page-blog-article.css adds what a post needs
   (in-article headings, lists, .takeaways, .toc, .fig, .byline, .author-card).
   This file adds four things:

     1. The page frame for posts moved by scripts/ship_content/
        to_article_template.py, which keeps the hero, body and FAQ inside
        <main><article> so extractors that read <article> still find them.
     2. "In short" as a hairline and a label rather than a boxed side bar.
     3. The legacy blocks a post keeps word for word when only its template
        moves: answer boxes, steps, stat cells, glossaries, callouts, tables.
        They lose their 1.0 inline styles in the move and are styled here
        as the .claim pattern: a hairline rule, a 26px territory dash before a
        small label, then the text. No tinted boxes and no side bars.
     4. The conversion set: the early ask under the byline, the floating
        button and the linger prompt.

   Layered as brand.page, so it sits above the template's components and
   responsive rules without !important.

   A post sets its topic territory in <head>:
     <style>body { --tt: var(--t-sec); --tt-w: var(--t-sec-w); }</style>
   ========================================================================= */

@layer brand.page {

  /* 1. Frame -------------------------------------------------------------- */
  :root { --tt: var(--signal); --tt-w: var(--signal-wash); }

  .story-body .story-col { max-width: var(--measure); margin: 0 auto; }
  .story-body.story-tail { padding-top: 0; padding-bottom: 72px; }
  .story-body.story-tail .author-card { margin-top: 0; }

  /* The breadcrumb sits where the template puts its kicker: small and quiet. */
  .splash .article-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
    margin: 0 0 18px;
    font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--ink2);
  }
  .splash .article-breadcrumb a { color: var(--signal); font-weight: 650; text-decoration: none; }
  .splash .article-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }

  /* The template headline is sized for a sentence of about eight words. */
  .hero-copy h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.02; max-width: 24ch; }

  /* An answer that sits under the headline reads as the dek. */
  .hero-copy .w3-citation-snippet { margin: 0 0 22px; }
  .hero-copy .w3-citation-snippet p:first-child {
    margin: 0 0 6px;
    font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; font-weight: 500;
    max-width: 46ch; color: var(--ink); text-wrap: pretty;
  }
  .hero-copy .w3-citation-snippet p + p { margin: 0; font-size: 14.5px; color: var(--ink2); }
  .hero-copy .w3-citation-snippet a { color: var(--signal); text-underline-offset: 3px; }

  .byline time { font: inherit; color: inherit; }

  .hero-copy .btn,
  .story-body .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--ctl-h); padding: 0 var(--ctl-pad-x);
    border: 0; border-radius: var(--radius);
    background: var(--ink); color: #fff;
    font: inherit; font-size: var(--ctl-fs); font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: background var(--dur) var(--ease);
  }
  .hero-copy .btn:hover,
  .story-body .btn:hover { background: var(--signal); }

  /* 2. In short ----------------------------------------------------------- */
  .takeaways {
    background: none; border: 0; border-radius: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
  }

  /* 3. Legacy blocks, kept word for word ----------------------------------- */
  .story-body h4 { margin: 28px 0 10px; font-size: 17px; font-weight: 650; line-height: 1.4; color: var(--ink); }

  .answer-box,
  .story-body .article-tldr,
  .story-body .article-key-takeaways,
  .story-body .article-callout,
  .story-body .article-checklist,
  .story-body .glossary-box,
  .story-body .article-industry-note,
  .story-body .competitive-framing,
  .story-body div.stat-highlight {
    margin: 36px 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
  }
  .hero-copy .answer-box { margin: 0 0 28px; max-width: 62ch; }
  .answer-box p { margin: 0 0 6px; font-size: 17px; line-height: 1.6; color: var(--ink); }
  .answer-box p:last-child { margin: 0; font-size: 14px; color: var(--ink2); }
  .answer-box p.label { margin: 0 0 10px; }

  /* Labels: small, uppercase, after a territory dash. */
  .answer-box .label,
  .story-body .label,
  .story-body .eyebrow,
  .story-body .section-eyebrow,
  .story-body .article-tldr > h3 {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 12px;
    font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    line-height: 1.4; color: var(--ink2);
  }
  .answer-box .label::before,
  .story-body .label::before,
  .story-body .eyebrow::before,
  .story-body .section-eyebrow::before,
  .story-body .article-tldr > h3::before {
    content: ""; flex: none; width: 26px; height: 2px; background: var(--tt);
  }

  .story-body .article-tldr li,
  .story-body .article-key-takeaways li,
  .story-body .article-checklist li { font-size: 16.5px; line-height: 1.62; }
  .story-body .article-checklist h3 { margin: 0 0 12px; font-size: 18px; }
  .story-body .article-callout p { font-size: 19px; line-height: 1.5; font-weight: 500; }
  .story-body div.stat-highlight { font-size: 16.5px; line-height: 1.6; font-weight: 500; color: var(--ink); }
  .story-body .stat-highlight:not(div) { font-weight: 650; color: var(--ink); }
  .story-body .competitive-framing p { font-size: 16.5px; }

  /* A bar of figures: a rule above and below, the figures in a row. */
  .story-body .article-value-bar {
    display: flex; flex-wrap: wrap; gap: 8px 28px;
    margin: 32px 0; padding: 14px 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  .story-body .article-value-bar span { font-size: 15px; font-weight: 650; color: var(--ink); }
  .story-body .article-value-bar .line { flex-basis: 100%; font-weight: 500; color: var(--ink2); }

  /* Glossary */
  .story-body .glossary-box dl { margin: 0; }
  .story-body .glossary-box dt { margin: 14px 0 2px; font-size: 16px; font-weight: 650; color: var(--ink); }
  .story-body .glossary-box dd { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); }

  /* Numbered steps: the number in a small ink square, then title and text. */
  .story-body .article-steps { list-style: none; padding: 0; margin: 28px 0 32px; max-width: none; }
  .story-body .article-step {
    display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 16px;
    margin: 0; padding: 18px 0; border-top: 1px solid var(--line);
  }
  .story-body .article-step-num {
    display: inline-grid; place-items: center; width: 28px; height: 28px; margin-top: 2px;
    border-radius: var(--radius); background: var(--ink); color: #fff;
    font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  }
  .story-body .article-step-title { margin: 0 0 4px; font-size: 18px; font-weight: 650; line-height: 1.35; color: var(--ink); }
  .story-body .article-step-desc { margin: 0; font-size: 17px; }

  /* Stat cells: the figure large, its label under it. */
  .story-body .article-stat { margin: 0; padding: 18px 0 4px; border-top: 1px solid var(--line); }
  .story-body .article-stat-number {
    display: block; font-size: clamp(30px, 3.6vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; color: var(--ink);
  }
  .story-body .article-stat-label { margin: 6px 0 14px; font-size: 16.5px; line-height: 1.55; }

  /* Tables: hairline rows and an ink rule under the header, as .cmp does.
     A .cmp table keeps brand.css's own rules; these are for legacy tables. */
  .story-body .cmp-scroll { margin: 28px 0 32px; }
  /* Four columns: a short name column, then three of equal width. */
  .cmp.cmp-4 tbody th { width: 16%; }
  .cmp.cmp-4 td { width: 28%; }
  .story-body table:not(.cmp) {
    width: 100%; margin: 28px 0 36px; border-collapse: collapse;
    font-size: 14.5px; line-height: 1.45; color: var(--ink2);
  }
  .story-body table:not(.cmp) caption { caption-side: top; text-align: left; padding-bottom: 12px; font-size: 14px; color: var(--ink2); }
  .story-body table:not(.cmp) th,
  .story-body table:not(.cmp) td { padding: 14px 16px 14px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
  .story-body table:not(.cmp) thead th,
  .story-body table:not(.cmp):not(:has(thead)) tr:first-child > th {
    font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--ink2); border-bottom: 2px solid var(--ink); vertical-align: bottom;
  }
  .story-body table:not(.cmp) tbody th,
  .story-body table:not(.cmp) td:first-child { color: var(--ink); font-weight: 600; }
  .story-body .comparison-table td { text-align: left; }

  /* Tribble in a comparison table: the mark beside our name. Only Tribble
     gets a mark, and the name stays as text. */
  .vs-mark { display: inline-flex; align-items: center; gap: 8px; }
  .vs-mark img { height: 18px; width: auto; display: block; }

  .story-body .article-hub-link { font-size: 16px; color: var(--ink2); }

  /* A customer number always carries the customer's logo, small and inline. */
  .inline-logo { display: inline-block; height: 16px; width: auto; margin: 0 6px 0 0; vertical-align: -2px; }
  .story-body ul.stat-lines { list-style: none; padding: 0; margin: 24px 0 28px; max-width: none; }
  .story-body ul.stat-lines li {
    display: flex; align-items: center; gap: 12px;
    margin: 0; padding: 13px 0; border-top: 1px solid var(--line);
    font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--ink);
  }
  .story-body ul.stat-lines li:last-child { border-bottom: 1px solid var(--line); }
  .story-body ul.stat-lines .inline-logo { flex: none; height: 18px; margin: 0; }

  /* 4. FAQ, author, close, related ------------------------------------------ */
  .faq .a p { margin: 0 0 12px; font-size: inherit; line-height: inherit; color: inherit; }
  .faq .a p:last-child { margin-bottom: 0; }
  .faq .a ul, .faq .a ol { margin: 0 0 12px; padding-left: 20px; }
  .faq .a a { color: var(--signal); text-underline-offset: 3px; }
  /* A question injected as its own block keeps its heading; it reads as one more row. */
  .faq-wrap > .faq-item { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
  .faq-wrap > .faq-item h3 { margin: 0 0 10px; font-size: 17px; font-weight: 650; letter-spacing: 0; color: var(--ink); }
  .faq-wrap > .faq-item p { margin: 0; font-size: 15.5px; line-height: 1.62; color: var(--ink2); max-width: 66ch; }

  .author-card .ac-role { margin: -2px 0 8px; font-size: 14px; font-weight: 500; color: var(--ink2); }

  .close h3 {
    margin: 0 0 14px; max-width: 18ch;
    font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; color: #fff;
  }
  .close .js-book-demo {
    display: inline-flex; align-items: center; min-height: var(--ctl-h); padding: 0 var(--ctl-pad-x);
    border: 0; border-radius: var(--radius); background: #fff; color: var(--ink);
    font: inherit; font-size: var(--ctl-fs); font-weight: 560; cursor: pointer;
  }
  .close .js-book-demo:hover { transform: translateY(-1px); }
  .close p.article-cta-proof { margin: 22px 0 0; font-size: 14px; color: rgba(255, 255, 255, .86); }
  .close p.article-cta-proof a { color: #fff; }

  .related .rel-wrap > h2,
  .related .rel-wrap > h3 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; margin: 0 0 24px; font-weight: 700; }
  .related.rescue { padding-bottom: 96px; }
  .related.rescue .rel-wrap { max-width: var(--measure); border-top: 1px solid var(--line); padding-top: 28px; }
  .related.rescue h2 { font-size: 20px; letter-spacing: -.015em; margin: 0 0 12px; }
  .related.rescue ul { margin: 0; padding-left: 20px; }
  .related.rescue li { margin: 0 0 8px; font-size: 16px; line-height: 1.55; }
  .related.rescue a { color: var(--signal); text-underline-offset: 3px; }

  /* 5. Conversion ------------------------------------------------------------
     One early ask under the byline, a floating button, and a prompt for
     readers who stay. Everything opens the demo modal. */
  .article-early-cta {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 14px 24px;
    margin: 24px 0 0; padding: 18px 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    max-width: 74ch;
  }
  .article-early-cta p { margin: 0; flex: 1 1 360px; font-size: 16px; line-height: 1.55; color: var(--ink); }
  .article-early-cta strong { font-weight: 650; }
  .article-early-cta .btn { flex: none; }

  .floating-cta {
    position: fixed; right: 24px; bottom: 24px; z-index: 900;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: var(--ctl-h); padding: 0 var(--ctl-pad-x);
    background: var(--ink); color: #fff; border-radius: var(--radius);
    font-family: var(--font-sans); font-size: 16px; font-weight: 600; text-decoration: none;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease);
  }
  .floating-cta.visible { opacity: 1; transform: none; pointer-events: auto; }
  .floating-cta:hover { background: var(--signal); color: #fff; }
  body.linger-open .floating-cta { opacity: 0; pointer-events: none; }

  /* The linger prompt is the dark field, like the closing section: it stands
     off the page by its field, not by a shadow or a border. */
  .linger-cta {
    position: fixed; right: 24px; bottom: 24px; z-index: 950;
    width: min(380px, calc(100vw - 32px));
    padding: 22px 22px 18px;
    background: var(--ink); color: #fff; border-radius: var(--radius);
    font-family: var(--font-sans);
    opacity: 0; transform: translateY(12px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .linger-cta.visible { opacity: 1; transform: none; }
  .linger-cta-title { margin: 0 0 6px; font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
  .linger-cta-body { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .86); }
  .linger-cta-actions { display: flex; align-items: center; gap: 16px; }
  .linger-cta-book {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
    border: 0; border-radius: var(--radius); background: #fff; color: var(--ink);
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .linger-cta-book:hover { background: var(--paper); }
  .linger-cta-no {
    border: 0; background: none; padding: 8px 0;
    color: rgba(255, 255, 255, .78); font: inherit; font-size: 14px; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
  }
  .linger-cta-no:hover { color: #fff; }

  /* 6. Small screens --------------------------------------------------------- */
  @media (max-width: 720px) {
    .story-body table:not(.cmp) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .floating-cta { left: 16px; right: 16px; bottom: 16px; justify-content: center; }
    .linger-cta { left: 16px; right: 16px; bottom: 16px; width: auto; }
    .article-early-cta .btn { width: 100%; }
  }
  @media (prefers-reduced-motion: reduce) {
    .floating-cta, .linger-cta { transition: none; }
  }
  @media print {
    .floating-cta, .linger-cta, .article-early-cta { display: none; }
  }
}
