/* pages/casting.css: Casting (/what-jinn-can-do/video/casting), build six part two CAST.
   Linked last in the page's own list by lib/site/pages/casting.ts, so it reaches this page and no other.
   Every rule is under a cs- class the page prints: the profile band (the cast sheet, then six groups of
   label and value). The groups are adjacent cells, so they sit in one true grid with hairlines between them
   (law 4: rounded standalone, true grid in stacks). FIX-4: each group is one full-width row (its name in a
   left rail, its facts in columns), so a long group grows its own row and leaves no blank cell beside it. FIX-10: the facts are spec rows on one two-column grid. No brown: ink, paper, card, rule and the amber accent,
   all from the site's tokens. */

.cs-profile { display: grid; gap: clamp(20px, 2.4vw, 32px); }

/* the cast sheet: three reference photos side by side, the brand label above, the caption under */
.cs-sheet { margin: 0; display: grid; gap: 10px; }
.cs-sheet > .label { margin: 0; }
.cs-sheet img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--radius); }
.cs-sheet figcaption { color: var(--muted); }
.cs-profile__how { margin: 0; max-width: 68ch; color: var(--muted); }

/* the six groups: one card, one row per group in the owner's order, hairlines between rows. Inside a row the
   group's name sits in a left rail and its facts fill one two-column grid of spec rows (FIX-10): a fact is half the
   grid or the full width, set by the page module (casting.ts cellsOf), and inside each cell the label keeps one fixed
   column with the value beside it, so every label in the card starts on the same line. A list value prints its own
   items one under the other. */
.cs-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5px;
  background: var(--rule);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.cs-group {
  background: var(--card);
  padding: clamp(18px, 2vw, 26px) clamp(16px, 2.2vw, 30px);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
  column-gap: clamp(16px, 2.4vw, 36px);
  align-items: start;
}
.cs-group__name { margin: 0; font-family: var(--head); font-weight: 700; font-size: 1.18rem; line-height: 1.25; color: var(--fg); }
.cs-group__name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--amber); vertical-align: 2px; }

.cs-facts { --cs-label: 10.5rem; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 2.6vw, 40px); align-items: start; }
.cs-fact {
  display: grid;
  grid-template-columns: var(--cs-label) minmax(0, 1fr);
  column-gap: 16px;
  align-items: baseline;
  min-width: 0;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}
.cs-fact--first { border-top: 0; padding-top: 2px; }
.cs-fact--full { grid-column: 1 / -1; }
.cs-fact dt { font-family: var(--ui); font-weight: 600; font-size: .8rem; letter-spacing: .02em; line-height: 1.35; color: var(--muted); }
.cs-fact dd { margin: 0; font-size: .98rem; line-height: 1.5; color: var(--fg); overflow-wrap: break-word; max-width: 66ch; }
/* a list value: one item per line, a small amber mark before each (drawn in CSS; the words are the value's own) */
.cs-fact--list dd { display: grid; gap: 4px; }
.cs-item { display: block; position: relative; padding-left: 14px; }
.cs-item::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
/* FIX-12: a comma list reads as one flowing line, the value as written (items inline, no marks, commas kept) */
.cs-fact--run .cs-item { display: inline; position: static; padding-left: 0; }
.cs-fact--run .cs-item::before { content: none; }

/* under 1200 the group's name sits over its facts, so the facts keep the card's whole width */
@media (max-width: 1200px) {
  .cs-group { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
}
/* phones: the label sits over its value; half facts stay two to a row, full ones take the row */
@media (max-width: 640px) {
  .cs-facts { column-gap: 16px; }
  .cs-fact { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; row-gap: 2px; padding: 10px 0; }
  .cs-fact--first { padding-top: 0; }
  .cs-sheet img { aspect-ratio: auto; }
}

/* FIX-10, the three stations (#watch): the full-body and headshot reference files carry stretched, blurred side
   bands (station-1 keeps its photo between about 28% and 73% of its width, station-3 between 14% and 86%). The
   frames turn upright at the photos' true shape, 2:3, centred, so every frame shows photo only and all three match.
   Scoped to this page's watch band (this sheet loads on Casting alone). */
#watch .sp-strip__pic { aspect-ratio: 2 / 3; }
#watch .sp-strip__pic img { object-position: 50% 50%; }
/* phones and tablets, where the stations stack: three upright frames at full width ran about 1600px, so each
   station turns sideways, its frame in the left two fifths and its words beside it */
@media (max-width: 860px) {
  #watch .sp-strip__station { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 16px; align-content: start; }
  #watch .sp-strip__station > * { grid-column: 2; }
  #watch .sp-strip__station > .sp-strip__pic { grid-column: 1; grid-row: 1 / span 4; margin: 0; align-self: start; }
}

/* FIX-10, Drift (#created): from 1024 up the band is the head beside the paragraphs, and Drift, who the template
   prints under the paragraphs, stood in the right column with the left one empty under the head. Here the head
   floats in the left 5 of 12, the paragraphs keep the right 7 (a margin the width of the head's column and the gap),
   and Drift floats left under the head (clear), so he stands in the column that was empty. The figure comes after the
   paragraphs in the page, so a float can rise no higher than the second paragraph's top: under a head as tall as
   this one he lands right under it. The portrait file carries its own air above the figure, so the margin stays small. */
@media (min-width: 1024px) {
  #created > .wrap { --cs-gap: clamp(32px, 4vw, 56px); display: flow-root; }
  #created .sp-head { float: left; width: calc((100% - var(--cs-gap)) * 5 / 12); }
  #created .sp-prose:has(> .vs-frame) { display: contents; }
  #created .sp-prose > p { margin-left: calc((100% - var(--cs-gap)) * 5 / 12 + var(--cs-gap)); max-width: 68ch; }
  #created .sp-prose > .vs-frame { float: left; clear: left; margin: 8px 0 0; }
}

/* Build eight P5 (the editor's CDCDeDy3uuzp, lower the two paragraphs a little to cut the empty space below them):
   from 1024 up both paragraphs sit 40px lower in their column (measured: at 1440 the gap under them to Drift's foot
   goes from 224px to 184px). Moved by offset, not margin, so Drift's float and the band's height stay as built. */
@media (min-width: 1024px) { #created .sp-prose > p { position: relative; top: 40px; } }
