/* styles/sections/section-head.css
 * Section heads (an h2 and its deck) and figure caption rows, as the AI Transformation frames
 * (vKITz, aDCQL, m3k12K) draw them. Heading: h2 role on M, h1 role on D and W. Line heights are
 * the frames' whole-pixel pitches. Strokes are inset shadows, drawn inside the box as Pencil
 * draws them, so a ruled block keeps its frame height. */
@layer sections {
  .section-head {
    --head-measure: none;
    --deck-measure: none;
    --deck-size: 17px;
    --deck-lh: 26px;
    --deck-color: var(--ink-deck);
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
  }

  .section-head__heading {
    max-width: var(--head-measure);
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--t-h2-size);
    font-weight: 600;
    line-height: 34px;
    letter-spacing: var(--t-h2-ls);
  }

  .section-head__deck {
    max-width: var(--deck-measure);
    margin: 0;
    font-size: var(--deck-size);
    line-height: var(--deck-lh);
    color: var(--deck-color);
  }

  .surface--inverse-textured .section-head {
    --deck-color: var(--white-90);
  }

  /* → and ● are not in Spline Sans Mono. Each is its Pencil outline (glyph-*.svg, em box with the
     baseline at 0.831em) drawn as a currentcolor mask in a cell of the frame's advance: → 1em at
     13px (13px), ● 0.909em at 15px (13.64px). The cell sits on the baseline like the glyph. */
  .glyph {
    display: inline-block;
    height: 1em;
    vertical-align: -0.169em;
    background: currentcolor;
    mask: var(--glyph) 0 0 / 100% 100% no-repeat;
  }

  .glyph--arrow {
    --glyph: url("/assets/figures/ai-transformation/glyph-arrow.svg");
    width: 1em;
  }

  .glyph--dot {
    --glyph: url("/assets/figures/ai-transformation/glyph-dot.svg");
    width: calc(1em * 13.64 / 15);
  }

  @media (forced-colors: active) {
    .glyph {
      background: CanvasText;
      forced-color-adjust: none;
    }
  }

  @media (width >= 900px) {
    .section-head {
      --deck-measure: 640px;
      --deck-size: 18px;
      --deck-lh: 27px;
    }

    .section-head__heading {
      font-size: var(--t-h1-size);
      line-height: 59px;
      letter-spacing: var(--t-h1-ls);
    }
  }

  @media (width >= 1680px) {
    .section-head__heading {
      line-height: 67px;
    }
  }
}

/* Caption rows (Artifact / figure-caption szKBk, nG0Ro) under a 1px rule with 14px above the
   text. On M the label line is 19px tall. */
@layer artifacts {
  .figure-caption.caption-row {
    --caption-rule: var(--line);
    padding-top: var(--space-14);
    box-shadow: inset 0 1px 0 var(--caption-rule);
    line-height: 19px;
  }

  .figure-caption.caption-row .figure-caption__label {
    line-height: 19px;
  }

  .figure-caption.caption-row--inverse {
    --caption-rule: var(--white-20);
    color: var(--white-70);
  }

  .figure-caption.caption-row--inverse .figure-caption__label {
    color: var(--white);
  }

  /* The 390 benchmark caption keeps the label beside its line (y0Fnx9) */
  .figure-caption.caption-row--keep {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
  }

  /* Side caption (Recipe figure-caption beside a plate): 14px text under an ink rule, stacked */
  .figure-caption.caption-row--side {
    --caption-rule: var(--ink);
    align-self: flex-start;
    width: min(100%, 302px);
    margin-top: var(--space-4);
    font-size: 14px;
    line-height: 20px;
  }

  .figure-caption.caption-row--side .figure-caption__label {
    line-height: 13px;
  }

  /* From D the shared caption already sets label and line side by side (artifacts.css); the
     method line keeps the frames' 20px pitch, and the side caption stays stacked. */
  @media (width >= 900px) {
    .figure-caption.caption-row {
      line-height: 20px;
    }

    .figure-caption.caption-row .figure-caption__label {
      line-height: 23px;
    }

    .figure-caption.caption-row--keep {
      gap: var(--space-8);
    }

    .figure-caption.caption-row--side {
      display: grid;
      flex: none;
      gap: var(--space-8);
      line-height: 21px;
    }
  }
}
