/* lint-allow: block-budget(57) — layout, the panel look, the picture, states and the slide in one accordion; Mitchell, 2026-11-13: "Yes, go ahead and finish it"; capped at 59 after S6 (2026-11-16: mask → opacity, same count); 57 after the panel background moved to the bg-raised utility (2026-11-23) */
/* .quality — the Quality accordion (spec §5.6): five native <details name="quality">, so the
   browser keeps one open and there is no JavaScript; panel 01 starts open. A column of panels;
   from 76em a row, the open panel at a fixed width and the closed ones sharing the rest (none
   open: five equal). Two open at once happens only where `name` is unknown (old Safari): not
   built for (Mitchell, 2026-11-11: no old-device fallbacks). */

/* primitive tried: stack (counted, not shot): 1 knob here, but the row must then undo its margins
   (direction, knob 0, gap: 3 lines) and the knob inherits into the panel stacks (lesson 21); a grid
   gap is 2 lines here and the row needs only `display: flex` (the gap carries over). */
.quality > div {
  display: grid;
  gap: var(--space-2xs);
}

/* primitive tried: cluster, with-sidebar. The cluster fails: a long title ("ISO 9001:2015
   Registered") drops under the number at 390 (trap 5). The sidebar meets it: the number keeps its
   own width, the title wraps beside it. display: flex also drops the browser's marker. The fluid
   pair gives REF's sides at both ends (24 at 390, 34 at 1440) with no size query. */
.quality summary {
  --max-sidebar-width: auto;
  --sidebar-gap: var(--space-s);
  align-items: center;
  padding: var(--space-s) var(--space-md-lg);
}

/* The panel: an opaque navy lifted 5% toward white (REF; the background (bg-raised), border and
   corners are utilities in the HTML, the hairline = border-white at 10%). */
.quality details {
  interpolate-size: allow-keywords; /* lets the body slide to its own height (Chrome; Safari opens at once) */
  transition: flex var(--duration-slow), border-color var(--transition-fade), box-shadow var(--transition-fade);
}

/* The slide: the browser's wrapper round everything after the head, from 0 to its height. */
/* lint-allow: restated — at rest a closed body is hidden anyway; only the slide reads the 0: quality_accordion_test "a panel slides open" fails without it (mutated 2026-11-13) */
.quality details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size var(--duration-med), content-visibility var(--duration-med) allow-discrete;
}
.quality details[open]::details-content {
  block-size: auto;
}

/* The panel body: a stack (each gap set on its item below), the panel's sides from the same fluid pair, held
   to the fade's solid part (75%; 92% on phones, ruled). The picture's box is the panel, not the
   body, so it still fills the whole panel. */
.quality details > .stack {
  max-inline-size: min(var(--quality-text, 75%), var(--measure));
  padding: var(--space-s-md) var(--space-md-lg) var(--space-md-lg); /* top: head → paragraph about the lists' gap (Mitchell, live 2026-11-13: "more space between the numbers and the beginning of the paragraph") */
}

/* The picture fills the panel ([ position-absolute inset-0 ] in the HTML; the panel is
   [ position-relative isolate ]) and sits under everything else in it, so no text part needs a
   position of its own. aspect-ratio: the insets size it, not the frame's 16:9 (trap 2). Last in
   source, so the stack gives the first text no phantom gap. */
.quality .frame {
  z-index: -1;
  aspect-ratio: auto;
  margin: 0; /* the stack's gap would push the picture down */
}

/* The picture at one strength across the whole panel, no fade (Mitchell, live 2026-11-16: "Just
   reduce the opacity of the image", then "a little bit more prominent … make those paragraphs
   white"; 30% tried live, then 20%: "I think twenty percent is fine"). Alpha scale step 20: with
   the text white the worst pixel is 6.32:1 even at 30%, 4.48 at 40% (fails) (quality_contrast.rb,
   1440 + 390, every panel). Its crop: the right, where the subject is (REF). */
.quality .frame > img {
  object-position: right;
  opacity: var(--alpha-20);
}

/* The step number in the display face (Light and line height 1: utilities in the HTML). `>`: the
   arrow is a span inside it. */
.quality summary > span {
  font-family: var(--font-display);
  font-size: var(--step-3);
}
/* The typed arrow: about half the number (inline-block, top, teal: utilities in the HTML). The
   only span inside a span here (Learn more and the points hold none). */
.quality span span {
  font-size: 0.54em;
  rotate: var(--quality-turn, none);
  transition: rotate var(--transition-base);
}
/* Closed: number and arrow dimmed, the arrow turned to point down-left (REF). The turn is a knob
   the panel sets (a direct rule would need 4 selector parts), so a hover can turn it back. */
.quality details:not([open]) {
  --quality-turn: 180deg;
}
.quality details:not([open]) span {
  color: var(--color-white-dark-1);
}

/* Phones: the text runs to 92% (Mitchell, 2026-10-29; ruled); the picture, behind every line there,
   tinted blue: only its light and dark kept, in one blue (Mitchell, phone 2026-11-18: "a bit too
   transparent, making it harder to read"; 10% "hard to see the image"; "tinted a darker blue").
   A filter, not a blend: the luminosity blend over the panel's navy read grey (2026-11-23), and a
   teal-base blend read "too green"; Mitchell chose this one from shots. */
@media (max-width: 45em) {
  .quality {
    --quality-text: 92%;
  }
  .quality .frame > img {
    filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(2.5);
  }
}

/* The row (ruled, 76em; REF the same). primitive tried: switcher (counted, not shot): it would give
   the row without a query, but the open panel's fixed width is wrong in the column (503 wide in a
   342 panel), so it needs this query anyway, and the panel heads change here too. One open panel at
   a fixed width, the closed ones share the rest from 0 (none open: five equal); each panel a
   column, so a closed head fills it: the sidebar wraps (the title cannot keep half the width) and
   space-between puts the number on top and the title at the foot. */
@media (min-width: 76em) {
  .quality > div {
    display: flex;
    block-size: var(--quality-panel-h); /* fixed, not a floor: mid-slide a narrow panel's text wraps taller and would jump the page */
  }
  .quality details {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .quality details[open] {
    flex: 0 0 var(--quality-panel-open);
  }
  .quality details:not([open]) summary {
    flex: 1;
    align-content: space-between;
  }
  .quality summary > span {
    font-size: var(--step-5);
  }
  /* The title under the number, larger (Mitchell, 2026-11-13: "the titles are underneath the numbers
     … so that the titles could be larger"; REF 30.2 at 1440 = --step-2): the title claims the whole
     width, so the sidebar wraps it under the number in every panel. */
  .quality summary {
    --min-main-width: 100%;
  }
  .quality details[open] h3 {
    font-size: var(--step-2);
  }
  /* A closed title at body size: "Documentation" fits a closed panel at 1440 (REF 17). Whole
     words: near 76em a long word runs a few pixels into the padding (as REF) rather than break
     mid-word ("Documenta / tion", the global break-word). */
  .quality details:not([open]) h3 {
    font-size: var(--step-0);
    overflow-wrap: normal;
  }
}

/* A closed title: plain body type, so a narrow closed panel in the row takes any title (REF). */
.quality details:not([open]) h3 {
  /* lint-allow: heading-role — the closed title is the designed variant: plain body type; quality spec, REF 3003 shot (closed titles plain) */
  font-family: var(--font-primary);
  font-weight: var(--fw-normal);
}

/* More room above both lists than the body's other gaps (Mitchell, 2026-11-13, live: "more space
   … between the bottom of the paragraph and the starting of these points"), and the same above Learn
   more ("the same gap", live, the same day). */
.quality :is(ul, .more) {
  --stack-space-before: var(--space-lg-xl);
}

/* The points: [ with-icon ] on each li holds the icon beside the words, which wrap under
   themselves. One fluid pair sizes the icons (REF 24 at 390, about 30 at 1440); --space is the
   with-icon gap that inherits (REF --space-s to --space-md). Teal: a utility on each icon (the sprite
   paints currentColor). */
.quality .points {
  --icon-size: var(--space-md-lg);
  --space: var(--space-s);
  --stack-space: var(--space-xs-s);
}
/* A hairline between points, the stack gap again under it (REF 12 at 390, 17 at 1440 both). */
.quality .points > :not(:first-child) {
  padding-block-start: var(--stack-space);
  border-block-start: var(--border-1) solid var(--hairline-color);
}

/* The link keeps its own width in the column: its focus ring and click area hug the words. */
.quality .more {
  align-self: start;
}

/* Panel 04's documents: a typed ✓ as each item's marker (Gould Arrows has it), inside the text box,
   teal (REF). In forced colours a text marker takes the system colour by itself. */
.quality .docs {
  --stack-space: var(--space-xs);
  list-style: "✓  " inside;
}
/* lint-allow: restated — the restated run does not see ::marker colours; switched off, 266 px change in the 7 marks (390, panel 04 open, 2026-11-13) */
.quality .docs ::marker {
  color: var(--color-blue-base);
}

/* Under a mouse: the site's one glow (glow.css, in the HTML) above its neighbours;
   the box lights, not the words ("pop by the box", Mitchell 2026-11-13). A closed
   arrow turns back up-right (D20, to show). */
@media (hover: hover) and (pointer: fine) {
  .quality details:hover {
    --quality-turn: 0deg;
    z-index: 1; /* the glow (glow.css) over its neighbours */
  }
}

/* Keyboard focus on a panel head: the site's ring, drawn inside the head (the panel clips, so the
   ring's usual 5px outside would be cut off). */
.quality summary:focus-visible {
  outline-offset: calc(-1 * var(--border-4));
}

/* Forced colours: the open panel's edge in the system's highlight, so it reads as the open one
   (accessibility stays, decision 19). */
@media (forced-colors: active) {
  .quality details[open] {
    border-color: Highlight;
  }
}
