/* Feature sub-page, round two (lib/site/templates/feature-sub-page.ts, opt-ins O1 to O10;
   docs/site-relaunch/round-two/specs/sub-writing.md part 0 and part J). Loaded after the parent
   feature's sheets, and only by a sub-page that sets at least one opt-in, so every other page renders
   as before. Every class here is `sp-`; the one shared selector is the flag look under
   [data-mark="flag"]. Tokens only (site.css :root); no new colors. */

/* ---------- O1: the opted-in sub hero's text column (sub-template fix 2). The template adds one `sp-hero-NN` class
   only on an opted-in page, so round-one sub heroes keep sections.css's column. 34rem holds a 46-character headline
   in two balanced lines at the sub size (2.4rem) at 1440; from 1024 down the column ends at NN% of the block, the
   widest step that stays clear of the picture's nearest face and does not pass the right edge of its record's open
   space (feature-sub-page.ts subHeroCls; most records land on 49, open space ending at 45 on 44, no record on 44,
   which is sections.css's own value). From 861 to 1024 a headline may take three lines; the block grows if it must
   (sections.css). The headline keeps sections.css's `text-wrap: balance`. Three classes because sections.css loads after
   this sheet. Phones (860 and under) ignore all of it: the column is full width there. */
.sx-hero.sx-hero--sub:is(.sp-hero-54, .sp-hero-52, .sp-hero-49, .sp-hero-44) { --sx-col: 34rem; }
.sx-hero.sx-hero--sub.sp-hero-54 { --sx-col-max: 54; }
.sx-hero.sx-hero--sub.sp-hero-52 { --sx-col-max: 52; }
.sx-hero.sx-hero--sub.sp-hero-49 { --sx-col-max: 49; }
.sx-hero.sx-hero--sub.sp-hero-44 { --sx-col-max: 44; }
/* the wider column would leave the sentence's last word alone on a line */
.sx-hero.sx-hero--sub:is(.sp-hero-54, .sp-hero-52, .sp-hero-49, .sp-hero-44) .sx-hero__sentence { text-wrap: pretty; }

/* ---------- O3: the loop in one line: a bridge between two sections, half a tight band's air ---------- */
.band.sp-loop { padding-block: clamp(18px, 2.5vw, 32px); }
/* the still strip shares the loop line's ground, so its own top air would double the gap under the line */
.sp-loop + .sp-strip { padding-top: clamp(20px, 3vw, 40px); }
.sp-loop .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; }
.sp-loop .lede { margin: 0; max-width: 46ch; }
.sp-loop__link { margin: 0; }

/* ---------- O8: depth blocks ---------- */
.sp-head { max-width: 760px; margin-bottom: clamp(24px, 3vw, 40px); }
.sp-head .label, .sp-label { display: block; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--amber-ink); }
/* the table and question blocks are sections.ts parts; their label takes the same caps, in the light amber on navy */
[data-ground="navy"] .sp-label, [data-ground="ink"] .sp-label { color: var(--amber-hi); }
.sp-head h2 { margin-bottom: .3em; }
.sp-head .lede { margin: 0; color: var(--muted); }

/* rows: the key on the left, its body on the right; stacked on a phone */
.sp-rows { margin: 0; display: grid; }
.sp-row { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: 8px clamp(20px, 4vw, 56px); padding: clamp(18px, 2.4vw, 28px) 0; border-top: 1px solid var(--rule); }
.sp-row:last-child { border-bottom: 1px solid var(--rule); }
.sp-row dt { font-family: var(--head); font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--fg); }
.sp-row dd { margin: 0; max-width: 68ch; }
.sp-row dd > p { margin: 0 0 .7em; color: var(--fg); line-height: 1.55; }
.sp-row dd > p:last-child { margin-bottom: 0; }
.sp-row dd h3 { margin-bottom: .35em; }
/* Build nine (Sarah 74YJqB3uGyKi and four more, Images Features #stages: "Increase See so it's the same font size as It
   looks before it paints."): a key with a title beside it takes the title's size (site.css h3). Rows with no title keep
   the small key. The class is shared, so Writing Features' titled rows take it too. */
.sp-row:has(> dd > h3) > dt { font-size: 1.35rem; line-height: 1.2; }
.sp-row--piece dt { color: var(--muted); font-family: var(--ui); font-weight: 600; font-size: .82rem; }
.sp-row--piece dd { max-width: 720px; }
@media (max-width: 760px) { .sp-row { grid-template-columns: minmax(0, 1fr); } }

/* cards: two or three across, one column on a phone */
.sp-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2vw, 22px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-cards[data-count="2"], .sp-cards[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-card { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--amber); border-radius: var(--radius); padding: 20px 22px 22px; }
.sp-card h3 { font-size: 1.15rem; }
.sp-card p { margin: 0; line-height: 1.55; color: var(--fg); }
.sp-card .sp-card__link { margin-top: 12px; }
/* Build nine (Sarah bxwP5U0iidaZ, nL6l3oGQt82J, H-S0uwIehLh0 on Images Why #shift): a card's figure opens its sentence, larger,
   in the section title's face (site.css h2: the display face at weight 400), in the card's ink */
.sp-card__fig { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 3.4vw, 2.9rem); line-height: 1; letter-spacing: -.012em; margin-right: .08em; color: var(--fg); }
.sp-card--fig p { line-height: 1.55; }
@media (max-width: 860px) { .sp-cards, .sp-cards[data-count] { grid-template-columns: minmax(0, 1fr); } }

/* prose: one reading column; from 1024 up the head sits left and the paragraphs right (5 to 7), top aligned,
   as a row's key sits beside its body, so the block fills the width instead of leaving the right half empty */
.sp-prose { max-width: 68ch; }
.sp-prose p { margin: 0 0 1em; font-size: 1.08rem; line-height: 1.6; color: var(--fg); }
.sp-prose p:last-child { margin-bottom: 0; }
@media (min-width: 1024px) {
  .sp-depth--prose .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(32px, 4vw, 56px); align-items: start; }
  .sp-depth--prose .sp-head { margin-bottom: 0; }
  /* Build nine (Sarah d_T6SshC16iK, the docs page's #plan; ruling 1, so every prose band): the paragraphs start level
     with the title, not the small label above it. The drop is the label's own box: .74rem at the body's 1.55 leading,
     plus its 10px bottom margin (the .sp-head .label rule above). */
  .sp-depth--prose .sp-prose { padding-top: calc(.74rem * 1.55 + 10px); }
}

/* a finished piece in a depth block */
.sp-depth--figure .sp-piece { max-width: 720px; }
.sp-piece figure { margin: 0; }
.sp-piece img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ---------- O5: the work track as a still strip; the sign band with no draft ---------- */
/* build three U12: the stations are the kit's build steps (kit.css draws the list; this sets the strip's three columns).
   One column under 861; never a sideways rail. */
.sp-strip .kit-build__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); align-items: start; }
.sp-strip__station { display: grid; gap: 6px; }
.sp-strip__pic { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-sm); background: var(--studio-2); margin-bottom: 8px; }
.sp-strip__pic img, .sp-strip__pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-strip__station h3 { margin: 0; font-size: 1.15rem; }
.sp-strip__who { margin: 0; font-family: var(--ui); font-weight: 600; font-size: .92rem; color: var(--fg); }
.sp-strip__station .small { margin: 0; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .sp-strip__pic video { display: none; } }
@media (max-width: 860px) { .sp-strip .kit-build__list { grid-template-columns: minmax(0, 1fr); } }

.sp-sign__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .sp-sign__grid { grid-template-columns: minmax(0, 1fr); } }
/* 861 to 1023: a collage's pictures hold the right column at their own width (702px), wider than the grid at 861, so
   the page scrolled sideways (Images features). Here the columns may shrink to their shares; from 1024 they fit. */
@media (min-width: 861px) and (max-width: 1023px) { .sp-sign__grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
/* the sign note: the page's own line under the signed draft, then js/product.js's status line (#sign-note, empty
   until the work track runs, and hidden while empty so a page with scripts off shows one line) */
.sp-sign-note { margin: 10px 0 0; }
.sp-sign-status { margin: 4px 0 0; }
.sp-sign-status:empty { display: none; }
/* Build eight SB (Sarah r3yAim_zOu8R, MkJfU4k9zEkh, AX8VQQV1KKbA, S5NamYNAqGz6): the note and the status line take the size
   of the lede beside them (site.css .lede), on a selector .small cannot beat; the law line under them keeps the small size */
.sign :is(.sp-sign-note, .sp-sign-status) { font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.45; }
/* Writing Why (sign.noteAt 'right', rrxlU7Gvj7Yz): the block under the lede, one paragraph's gap below it */
.sign .lede + .sp-sign-note { margin-top: 0; }
/* "Send it back" sits just left of Approve in the signature row (IGHqLkig2Gce and four more). The two share one group at
   the right of the row, so on a phone they wrap to a new line together instead of splitting. Once signed, Approve gives
   way to the stamp and Send it back stays at the right, where it clears the approval. */
.sign .draft .sig .sp-sig-doors { display: inline-flex; gap: 10px; margin-left: auto; }
.sign .draft .sig #sign-sendback { min-height: 44px; }
.sign .draft .sig #sign-sendback + .approve { margin-left: 0; }
/* Build nine (Sarah MkB2BwiVnux7, cMWE6o_h86Af, Images How; feature-sub-page.ts `sign.headAt`): the title and lede are the
   band's head, across the row; the draft and the piece's column start level under it */
.sign .grid > .sp-sign__head { grid-column: 1 / -1; max-width: 760px; }
.sp-sign__head .label { margin: 0 0 10px; }
.sp-sign--head .grid > div > .out:first-child { margin-top: 0; }
.sp-sign__head h2 { margin-bottom: .3em; }
.sp-sign__head .lede { margin: 0; }

/* ---------- O4: the flag look. The caught line stays in full ink with a thin amber underline and its
   note in full under it, never struck. js/work.js still adds `struck`; only its look changes here. ---------- */
[data-mark="flag"] .draft .line.struck {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
}
/* an inline-block is not underlined by its parent, so the note reads plain on its own line */
[data-mark="flag"] .draft .line.struck .note { display: inline-block; width: 100%; margin: 6px 0 0; color: var(--amber-ink); font-weight: 600; text-decoration: none; }

/* ---------- O9: the slim trust band ---------- */
.sp-trust { padding-block: clamp(40px, 6vw, 80px); }
.sp-trust .pockets-stage .uwee { width: min(240px, 100%); }
.sp-trust .said { margin-bottom: 14px; }
.sp-trust__link { margin: 0; }
.sp-trust .tcta { color: var(--on-dark); }

/* Build eight PX (the editor's rows 58, 93, 98, 136): a scene drawing in a depth block, lib/site/parts/scene-figure.ts.
   Before a prose block's paragraphs, or after a cards block's list. */
.sp-scene { margin: 0; max-width: 46rem; }
.sp-scene img { width: 100%; height: auto; border-radius: var(--radius-sm); }
.sp-prose .sp-scene { margin-bottom: clamp(20px, 2.4vw, 28px); }
.sp-depth--cards .sp-scene { margin-top: clamp(24px, 3vw, 40px); }

/* Build nine (Sarah nf_SkjpQNoYm on Strategy Compare #faq: the same space above the end link as between two questions;
   ruling 1, so every questions band that ends on the template's end link, feature-sub-page.ts withEndLink): the link sits
   the summary's own padding (sections.css .sx-qa__q) below the last question's rule, less the 2px its taller line box
   adds on a wide screen, so the gap from the last question's words to the link's equals the gap between two questions (41px at 1440). */
.sx-qa .sp-end-link { margin-top: clamp(14px, calc(1.6vw - 2px), 18px); }
