/* ==========================================================================
   Fabrication (fabrication.html): page-only styles, linked after site.css. Owner: Fb (vision 9.5).
   Tokens of site.css only: no new colours, sizes or durations, and only its two layout breakpoints
   (48em tablet, 68.75em desktop). The shared components live in site.css (page head and kicker 5.19, N5 display
   line and lead, N8 ink band 5.27 with N14 framed video 5.8, rows 5.15, N20 process list 5.29, figures 5.8, N9 split
   5.8, N10 lockup 5.28); this file places them. This page's own components (vision 3.5, COMPONENTS.md 5):
   N18 the spec table, N19 the notice, and the four-up row of photos.
   ========================================================================== */

@layer components {

  /* --- 1. Top: the h1 (kicker inside) on cols 1-9, as site.css places it; the lead (--fs-lead, ink, 40rem) and the
         boundary line under it (--fs-small, --ink-2) on cols 5-12 (vision 4.3 item 1) --- */
  .fab-top__text { display: grid; gap: var(--s-4); }
  .fab-top__lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink); max-width: var(--measure); }
  .fab-top__boundary { font-size: var(--fs-small); line-height: 1.6; color: var(--ink-2); max-width: var(--measure); }
  /* the link out: the bold key phrase in ink, underlined as running text is, the ↗ kept with its last word */
  .fab-top__boundary a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-3); }
  .fab-top__boundary a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
  .fab-top__boundary .icon { margin-left: 0.3em; vertical-align: -0.05em; }   /* a margin, not a space: no underline under the gap */
  @media (min-width: 68.75em) {
    .page-head > .fab-top__text { grid-column: 5 / span 8; }
  }

  /* --- 2. The shop at work: N8 with N14 (site.css). The band follows the top at the block gap instead of a full section
         gap: the top and the video read as one opening, and the poster, the page's first-screen picture, shows in the
         first screen (1280 x 853 included). No section head in the band (COMPONENTS.md 3.15). --- */
  .band.fab-shop { margin-top: var(--block-gap); }

  /* --- 3. 01 Why it matters: the display line, then Version 1's rows (title cols 1-4, line cols 5-11, site.css 5.15) on a
         hairline of their own (the display line sits between them and the section's black rule), then the closing line
         on the column 5 axis (.axis-5) --- */
  .lede + .fab-rows { border-top: var(--hair) solid var(--line); }
  .fab-close {
    margin-top: var(--block-gap); max-width: var(--measure);
    font: var(--w-medium) var(--fs-lead) / 1.5 var(--font-sans); color: var(--ink); text-wrap: balance;
  }

  /* --- 4. 02 What the shop makes: the lead line (--fs-lead, 500, ink) and the lead (p.lede-lead) on the column 5 axis,
         N20 as one list in three columns on the same axis, the four photos across the column, one credit, the link --- */
  .fab-makes__line { font: var(--w-medium) var(--fs-lead) / 1.5 var(--font-sans); color: var(--ink); max-width: var(--measure); text-wrap: balance; }
  .fab-makes__list { margin-top: var(--block-gap); padding-top: var(--s-5); border-top: var(--hair) solid var(--line); }
  @media (min-width: 68.75em) {
    .fab-makes__line, .fab-makes__list { margin-left: calc((100% + var(--gutter)) / 3); }
  }

  /* the four-up: four photos in a row on desktop (three grid columns each), 2 x 2 below; one credit under them, on the
     right as every credit is; the frames are 4:5 (set on each frame by its snippet) */
  .fourup { margin-top: var(--s-8); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6) var(--gutter); }
  .fourup > .fig { align-content: start; }          /* every caption starts right under its frame, on one line across the row */
  .fourup__credit { grid-column: 1 / -1; justify-content: flex-end; text-align: right; margin-top: calc(-1 * var(--s-3)); }
  @media (max-width: 68.74em) {
    .fourup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 47.99em) {
    .fourup { margin-top: var(--s-7); gap: var(--s-5) var(--gutter); }
    .fourup__credit { margin-top: 0; }
  }
  /* the link to Projects: from 48em it sits at the left of the credit's line, centred on it (half the link's 44 px
     height plus half the credit's line); only right after the photos, so without them it simply follows the list */
  .fab-makes__link { margin-top: var(--s-5); }
  @media (min-width: 48em) {
    .fourup + .fab-makes__link { margin-top: calc(-0.5 * (2.75rem + var(--fs-mono) * 1.4)); width: fit-content; }
  }

  /* --- 5. 03 The facility: the display line and its lead (site.css), then N18 the spec table --- */
  /* N18: a real table, its caption visually hidden; rows on --line hairlines; the machine (--fs-body, 600) on cols 1-6,
     the detail (mono, --ink-2) from column 7: the first column is half the width and each side of the middle takes half
     a gutter, so the detail starts exactly on column 7. The header cells are mono labels on a black rule (Version 1's
     label device). Phones: each row stacks, the header row visually hidden. */
  .spec-table { width: 100%; margin-top: var(--block-gap); border-collapse: collapse; table-layout: fixed; }
  .spec-table th, .spec-table td { padding: var(--s-4) 0; text-align: left; vertical-align: baseline; }
  .spec-table th:first-child { width: 50%; padding-right: calc(var(--gutter) / 2); }
  .spec-table :is(th, td):last-child { padding-left: calc(var(--gutter) / 2); }
  .spec-table thead th {
    padding-block: 0 var(--s-3); border-bottom: var(--hair) solid var(--ink);
    font: 500 var(--fs-mono) / 1.4 var(--font-mono); letter-spacing: var(--ls-mono); text-transform: uppercase; color: var(--ink-3);
  }
  .spec-table tbody tr { border-bottom: var(--hair) solid var(--line); }
  .spec-table tbody th { font: var(--w-strong) var(--fs-body) / 1.4 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
  .spec-table tbody td {
    font: 500 var(--fs-mono) / 1.5 var(--font-mono); letter-spacing: var(--ls-mono); text-transform: uppercase;
    font-variant-numeric: tabular-nums; color: var(--ink-2);
  }
  @media (min-width: 68.75em) {
    .spec-table tbody :is(th, td) { padding-block: var(--s-5); }
  }
  @media (max-width: 47.99em) {
    .spec-table, .spec-table tbody, .spec-table tr, .spec-table th, .spec-table td { display: block; width: auto; }
    .spec-table thead {                      /* the header row stays for screen readers only (vision N18) */
      position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
      clip-path: inset(50%); white-space: nowrap; border: 0;
    }
    .spec-table tbody { border-top: var(--hair) solid var(--line); }
    .spec-table tbody tr { padding-block: var(--s-4); }
    .spec-table tbody :is(th, td), .spec-table th:first-child, .spec-table :is(th, td):last-child { width: auto; padding: 0; }
    .spec-table tbody td { margin-top: var(--s-1); }
  }

  /* --- 6. 04 Spark + Combination: N9 split (site.css): the lockup, the text and two links on cols 1-6, the photo (4:5)
         on cols 8-12; on desktop the text block sits level with the middle of the photo. Tablet: stacked, the photo at
         60 % of the column. Phones: stacked, the photo across. --- */
  .fab-spark__text { margin-top: var(--s-7); max-width: var(--measure); font-size: var(--fs-lead); line-height: 1.55; color: var(--ink); }
  .fab-spark__links { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: 0 var(--s-6); }
  .fab-spark__links .link { color: var(--ink); }
  @media (min-width: 68.75em) {
    .fab-spark > .split__text { align-self: center; }
  }
  @media (min-width: 48em) and (max-width: 68.74em) {
    .fab-spark > .split__fig { width: 60%; }
  }
  @media (max-width: 47.99em) {
    .fab-spark__text { margin-top: var(--s-6); }
    .fab-spark__links { flex-direction: column; margin-top: var(--s-3); }
  }

  /* --- 7. 05 Parts only: N19 the notice. A --surface panel (padding clamp(1.5rem, 4vw, 3rem)), the h3 at --fs-h3, the
         text (40rem) and the link out. On desktop the text starts exactly on the page's column 5, as the rows above do:
         the first track is column 5's offset less the panel's padding and one gutter. --- */
  .notice {
    --notice-pad: clamp(1.5rem, 4vw, 3rem);
    display: grid; gap: var(--s-4) var(--gutter); padding: var(--notice-pad); background: var(--surface);
  }
  .notice__title { font: var(--w-strong) var(--fs-h3) / 1.25 var(--font-sans); letter-spacing: var(--ls-h3); color: var(--ink); }
  .notice__body { max-width: var(--measure); color: var(--ink-2); }
  .notice__link { margin-top: var(--s-3); }
  .notice__link .link { color: var(--ink); }
  @media (min-width: 68.75em) {
    .notice { grid-template-columns: calc((100% + 2 * var(--notice-pad) + var(--gutter)) / 3 - var(--notice-pad) - var(--gutter)) minmax(0, 1fr); align-items: baseline; }
  }

  /* (a wrapped caption keeps its credit on the right: site.css 5.8 since Fb-02 landed) */

  /* --- Forced colours: the notice's grey panel would vanish into the page; give it a frame --- */
  @media (forced-colors: active) {
    .notice { border: var(--hair) solid CanvasText; }
  }

  /* --- Print: blocks that must not split across pages (site.css prints the band white and leaves the video and the
         buttons out) --- */
  @media print {
    .fourup .fig, .spec-table tr, .fab-spark, .notice { break-inside: avoid; }
    /* (the poster prints in place of the video: site.css section 9 since Fb-03 landed) */
  }
}
