/*
 * Pattern group "proof" (docs/design/pattern-library.md): the facts strip
 * (site/snippets/patterns/facts.php) and the pull quote (pullquote.php).
 * Linked once per page by the first of these snippets, never in the head
 * and never on a page that does not use them.
 *
 * Classes are the snippets' default block names (pt-*). When a snippet
 * mirrors the case study page (cs-facts, cs-pull) the rules in
 * casestudy.css apply instead, so this file never changes those pages.
 *
 * No movement of its own: the section reveals through the shared
 * observer, and figures marked for counting use the shared count-up
 * (motion.js, key "reveal"; [data-countup] reserves its width in
 * motion.css, so nothing shifts).
 */

@layer templates {
  /* ---------- Facts strip ---------- */

  .pt-facts {
    overflow: hidden;
    border: var(--border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    box-shadow: var(--shadow-hard);
    color: var(--color-ink);
  }

  /* Hairlines between the facts: the list's ink shows through 1px gaps, and
     the last row's items grow, so no empty cell is ever drawn */
  .pt-facts__main {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin: 0;
    background: var(--color-ink);
  }

  .pt-facts__item {
    flex: 1 1 12rem;
    padding: var(--space-3) var(--space-4);
    background: var(--color-white);
  }

  .pt-facts__label {
    color: var(--color-muted);
    font-size: var(--step--1);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .pt-facts__value {
    margin: var(--space-1) 0 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading-sm);
    line-height: 1.35;
  }

  /* A figure that counts up reads as a figure: display size, one weight up from Thin */
  .pt-facts__value:has([data-countup]) {
    font-size: var(--step-4);
    font-weight: var(--weight-heading);
    line-height: 1.1;
  }

  .pt-facts__more {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-top: var(--border);
    background: var(--accent-pale);
  }

  .pt-facts__chip {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5em;
    max-width: 100%;
    padding: 0.45em 1em;
    border: var(--border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .pt-facts__chip dt {
    font-weight: var(--weight-strong);
  }

  .pt-facts__chip dd {
    margin: 0;
  }

  /* ---------- Pull quote ---------- */

  .pt-pull__figure {
    max-width: 52rem;
    margin: 0 auto;
    text-align: center;
  }

  .pt-pull__quote {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 1.15rem + 2.8vw, 3.25rem);
    font-style: italic;
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .pt-pull__quote::before {
    content: "\201C";
    display: block;
    height: 0.6em;
    font-size: 2.5em;
    line-height: 1;
  }

  /* On ink the mark takes the page accent (mint on ink 12.6:1; it is decorative) */
  .section--ink .pt-pull__quote::before {
    color: var(--accent-on-ink, var(--accent));
  }

  .pt-pull__cite {
    display: block;
    margin-block-start: var(--space-3);
  }

  @media (min-width: 48rem) {
    .pt-pull__quote {
      font-weight: var(--weight-display);
    }
  }
}
