/* ==========================================================================
   FTS: typography.css
   Purpose: Type scale, headings, body copy, and BB rich text defaults.
   ========================================================================== */


  :root {
    --fts-text-base: 1rem;      /* 16px */
    --fts-text-sm: 0.875rem;    /* 14px */
    --fts-text-lg: 1.125rem;    /* 18px */

    /* Headings (Desktop) */
    --fts-h1: 3.5rem;           /* 56px */
    --fts-h2: 2.5rem;           /* 40px */
    --fts-h3: 2rem;             /* 32px */
    --fts-h4: 1.5rem;           /* 24px */
    --fts-h5: 1.25rem;          /* 20px */
    --fts-h6: 1rem;             /* 16px */

    --fts-leading-body: 1.6;
    --fts-leading-heading: 1.15;

    --fts-reading: 75ch;
  }

  body {
    font-size: var(--fts-text-base);
    line-height: var(--fts-leading-body);
  }

  p {
    font-size: var(--fts-text-base);
    line-height: var(--fts-leading-body);
  }

  /* Headings */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    line-height: var(--fts-leading-heading);
    color: var(--denim);
  }

  h1 { font-size: var(--fts-h1); font-weight: var(--weight-light); }
  h2 { font-size: var(--fts-h2); font-weight: var(--weight-regular); }
  h3 { font-size: var(--fts-h3); font-weight: var(--weight-bold); }
  h4 { font-size: var(--fts-h4); font-weight: var(--weight-semibold); }
  h5 { font-size: var(--fts-h5); font-weight: var(--weight-medium); }
  h6 { font-size: var(--fts-h6); font-weight: var(--weight-semibold); }

  /* Lists in Rich Text */
  .fl-rich-text :where(ul, ol) { padding-left: 1.25em; }
  .fl-rich-text :where(li) { line-height: var(--fts-leading-body); }

  /* Blockquote */
  .fl-rich-text blockquote {
    margin-left: 0;
    margin-right: 0;
    border-color: var(--cream);
  }

  /* Rich text default margins to be controlled by rhythm system below */
  .fl-rich-text :where(p, ul, ol, blockquote, pre, table, hr) { margin: 0; }
  .fl-rich-text :where(h1, h2, h3, h4, h5, h6) { margin: 0; }

  /* Helpers */
  .fts-text-sm { font-size: var(--fts-text-sm); }
  .fts-text-lg { font-size: var(--fts-text-lg); }

  /* Responsive heading scale (match BB breakpoints) */
  @media (max-width: 991.98px) {
    :root {
      --fts-h1: 2.75rem;
      --fts-h2: 2.25rem;
      --fts-h3: 1.875rem;
      --fts-h4: 1.375rem;
      --fts-h5: 1.125rem;
      --fts-h6: 1rem;
    }
  }

  @media (max-width: 767.98px) {
    :root {
      --fts-h1: 2.25rem;
      --fts-h2: 1.75rem;
      --fts-h3: 1.5rem;
      --fts-h4: 1.25rem;
      --fts-h5: 1.125rem;
      --fts-h6: 1rem;
    }
  }

  /* Rich text rhythm */
  .fl-rich-text {
    --fts-flow: 1rem;
    --fts-flow-tight: 0.5rem;
    --fts-flow-loose: 1.5rem;
  }

  .fl-rich-text :where(p, ul, ol, blockquote, pre, table, hr)
    + :where(p, ul, ol, blockquote, pre, table, hr) {
    margin-top: var(--fts-flow);
  }

  .fl-rich-text :where(h1, h2, h3, h4, h5, h6)
    + :where(p, ul, ol) {
    margin-top: var(--fts-flow-tight);
  }

  .fl-rich-text :where(p, ul, ol, blockquote, pre, table, hr)
    + :where(h1, h2, h3, h4, h5, h6) {
    margin-top: var(--fts-flow-loose);
  }

  /* Inline safety */
  .fl-rich-text :where(p, span, strong, em, b, i, u, small, code, mark) {
    background: transparent !important;
  }

  .fl-rich-text :where(strong, em, b, i, u, small, code) {
    line-height: inherit;
  }

  .fl-rich-text * { background-clip: padding-box; }