/* Program's private skin.
 *
 * Axes stay closed in ThemeManifest/TypeScript. This file owns only the values
 * and engine-hook rules for Program's look. Every selector is rooted on the
 * engine node that resolved this theme.
 *
 * THE PAGE IS A PRINTED PROGRAM. The updates line as a pill across the top, a
 * one-line overline, a bold grotesk title and an underlined byline; then the
 * whole flyer with the host's own words under it on the left, and on the
 * right the program — When | Where, the lineup, the RSVP — as cells between
 * full-width hairlines, closing on a black pill. The plates (the pill and the
 * button) are the `marker` role; the sheet runs from `wash` down into `bg`. */
[data-engine="v2"][data-theme="program"] {
  --eg-box-radius: 0px;
  --eg-field-radius: 999px;
  --eg-tracking-tight: -0.035em;
  /* The program's body size: the mock's 19px copy, a step down on a phone. */
  --program-body: 19px;
  --program-label: 11px;
}
@container program-sheet (max-width: 559.98px) {
  [data-engine="v2"][data-theme="program"] .eg-comp { --program-body: 17px; }
}

/* The page column is the shell's own size container; named here so the
   program grid below can ask it from INSIDE the dissolved content masonry,
   whose own container (`.eg-masonry-c`) has no box once it is `contents` and
   would answer every unnamed query false. */
[data-engine="v2"][data-theme="program"] [data-shell] > main { container-name: program-sheet; }

/* ── The sheet: `wash` at the top, fading into the ground by 500px ──────────
   A layer, not a `background-image` on the shell: the shell states its ground
   as an inline `background` shorthand, which resets any image a stylesheet
   sets (Schematic's dot grid, §2.16). On Cream and Green `wash` is the ground,
   so the gradient is flat. */
[data-engine="v2"][data-theme="program"] [data-shell] { isolation: isolate; }
[data-engine="v2"][data-theme="program"] [data-shell]::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 560px; z-index: 0; pointer-events: none;
  background: linear-gradient(var(--eg-wash, var(--bg)), var(--bg));
}

/* ── Every cell sits on the page's own two edges ────────────────────────────
   The layout items and the section cells carry the split page's column inset
   (`px-7`); Program's columns are the page itself, so the words start at the
   flyer's edge and the rules run the column's full width. */
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type] { padding-inline: 0; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type] > section > [data-block-boundary="frame"] {
  padding-inline: 12px; padding-block: 34px;
}

/* ── The program grid (side by side) ────────────────────────────────────────
   Split lays the page as rows — [title | flyer], then [details | RSVP], then
   the content lanes. The mock sets the flyer and the host's words down the
   left and the program down the right. The region boxes and the content
   masonry dissolve (`display: contents`) so every block is a cell of the
   composition's own grid; `order` and a column place each one, and dense
   packing puts it in its column's first free row, so a second block of a
   kind simply follows and nothing overlaps. The DOM — and so the reading
   order and the phone order — is untouched. */
[data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] {
  grid-template-columns: minmax(0, 1fr); row-gap: 0; grid-auto-flow: row dense;
}
[data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] > :is([data-region="hero"], [data-region="details"], [data-region="content"]),
[data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] > [data-region="content"] :is(.eg-masonry-c, .eg-masonry, .eg-masonry-col) {
  display: contents;
}
/* The head of the sheet, in the mock's order: updates, overline, title.
   The updates pill is not ordered here any more: it sits in the LEAD region
   (`leadTypes: ["UPDATES"]`, GC-4885), which the composition draws FIRST in
   the DOM, so a screen reader and the keyboard meet it first too. The region
   still needs an `order` of its own, below every block's, only because this
   dissolved grid places its cells by `order` — it keeps the visual grid in
   agreement with the DOM on a laptop AND on a phone, where the flyer is
   pulled up to -50. An updates block the host placed later in the list is
   not in the lead, and stays where the host put it. */
[data-engine="v2"][data-theme="program"] .eg-comp > [data-region="lead"] { order: -60; }
[data-engine="v2"][data-theme="program"] .eg-comp > [data-region="masthead"] { order: -30; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="HERO"] { order: -20; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="FLYER"] { order: -10; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="EVENT_DETAILS"] { order: -9; height: auto; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="LINEUP"] { order: -8; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="RSVP_FORM"] { order: -7; height: auto; }
[data-engine="v2"][data-theme="program"] .eg-comp :is([data-cue-block-type="HERO_INTRO"], [data-cue-block-type="DESCRIPTION"]) { order: -6; }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="CUSTOM_TEXT"] { order: -5; }

@container program-sheet (min-width: 760px) {
  [data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] {
    /* The flyer column is the split's own negotiated share (the host's flyer
       size inside the manifest's band), so the flyer-size control still
       works; the program takes the rest. */
    grid-template-columns: calc(var(--eg-hero-flyer-share, 0.47) * (100% - 32px)) minmax(0, 1fr);
    column-gap: 32px; align-items: start;
  }
  /* Without a flyer, Split negotiates a zero-width image slot. Program's
     left column still holds About and custom text, so retain two readable
     content columns instead of spending that absent image's zero share. */
  [data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"]:not(:has([data-cue-block-type="FLYER"])) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  [data-engine="v2"][data-theme="program"] .eg-comp > :is([data-region="lead"], [data-region="masthead"], [data-region="footer"]),
  [data-engine="v2"][data-theme="program"] .eg-comp :is([data-cue-block-type="UPDATES"], [data-cue-block-type="HERO"]) { grid-column: 1 / -1; }
  /* The flyer holds the left column level with the first three cells of the
     program, so About starts under it while the RSVP runs on beside. */
  [data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="FLYER"] { grid-column: 1; grid-row: span 3; margin-top: 8px; }
  [data-engine="v2"][data-theme="program"] .eg-comp :is([data-cue-block-type="EVENT_DETAILS"], [data-cue-block-type="LINEUP"]) { grid-column: 2; }
  /* The RSVP spans many rows so the extra height a tall form asks for is
     spread thin across them, rather than opening a gap under the flyer. */
  [data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] [data-cue-block-type="RSVP_FORM"] { grid-column: 2; grid-row: span 8; }
  [data-engine="v2"][data-theme="program"] .eg-comp > [data-region="footer"] { margin-top: 48px; }
  [data-engine="v2"][data-theme="program"] .eg-comp :is([data-cue-block-type="HERO_INTRO"], [data-cue-block-type="DESCRIPTION"], [data-cue-block-type="CUSTOM_TEXT"]) { grid-column: 1; }
  /* Every other block runs the sheet's width under both columns. */
  [data-engine="v2"][data-theme="program"] .eg-comp [data-region="content"] [data-cue-block-type]:not(:is([data-cue-block-type="UPDATES"], [data-cue-block-type="LINEUP"], [data-cue-block-type="HERO_INTRO"], [data-cue-block-type="DESCRIPTION"], [data-cue-block-type="CUSTOM_TEXT"])) { grid-column: 1 / -1; }
  /* The host's words under the flyer are copy, not program cells: no rule,
     and set flush with the flyer's edge. */
  [data-engine="v2"][data-theme="program"] .eg-comp :is([data-cue-block-type="HERO_INTRO"], [data-cue-block-type="DESCRIPTION"], [data-cue-block-type="CUSTOM_TEXT"]) > section > [data-block-boundary="frame"] {
    border-top: 0; padding: 0 0 36px;
  }
  [data-engine="v2"][data-theme="program"] .eg-comp :is([data-cue-block-type="HERO_INTRO"], [data-cue-block-type="DESCRIPTION"]) > section > [data-block-boundary="frame"] { padding-top: 18px; }
}

/* ── The phone: one column, the lead and then the flyer ─────────────────── */
@container program-sheet (max-width: 759.98px) {
  [data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="FLYER"] { order: -50; }
  /* The overline follows the flyer on a phone, so the flyer carries the air
     under it. The pill used to sit between them and supply it; with the pill
     in the lead (GC-4885) the overline was set 4px under the picture. */
  [data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="FLYER"] [data-furniture="flyer"] { margin-bottom: 20px; }
  /* One gutter on a phone: the cells' words sit on the page edge with the
     flyer, the pill and the title, the rules still running edge to edge. */
  [data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type] > section > [data-block-boundary="frame"],
  [data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="RSVP_FORM"] > [data-action-zone] { padding-inline: 0; }
  /* Air above a pill that follows the flyer in the flow; a pill in the lead
     heads the page and needs none. */
  [data-engine="v2"][data-theme="program"] .eg-comp > [data-region="content"] [data-cue-block-type="UPDATES"] { margin-top: 20px; }
}

/* ── The updates pill ──────────────────────────────────────────────────────
   The capsule is the shared `banner` look (`updatesLook.tsx`): one line, the
   card it opens over the page, the `notice` / `noticeInk` / `noticeGlow` roles.
   Program sets only their size, a step under the body as in the mock, and the
   air under the capsule. (The card is a popover in the top layer, but still a
   DOM descendant of the theme root, so this selector reaches it.) */
[data-engine="v2"][data-theme="program"] [data-element="updates-banner"] { --eg-updates-font-size: 13px; }
[data-engine="v2"][data-theme="program"] [data-element="updates-card"] { --eg-updates-font-size: 16px; max-width: min(560px, calc(100vw - 40px)); }
[data-engine="v2"][data-theme="program"] .eg-comp [data-cue-block-type="UPDATES"] { margin-bottom: 18px; }
/* The banner starts on the sheet's own edge with the overline and the title,
   not at the chrome's column inset; a `feed` look keeps its cell's inset. */
[data-engine="v2"][data-theme="program"] .eg-comp [data-block="UPDATES"] > :has(> [data-element="updates-banner"]) { padding-inline: 0; }
/* ── The overline and the title ───────────────────────────────────────── */
[data-engine="v2"][data-theme="program"] [data-region="masthead"] [data-block-id] > div {
  padding: 0 0 10px; text-transform: none; letter-spacing: 0; font-weight: 400;
  font-size: 15px; color: var(--text);
}
[data-engine="v2"][data-theme="program"] [data-region="masthead"] [data-block-id] > div > span:empty { display: none; }
[data-engine="v2"][data-theme="program"] [data-cue-block-type="HERO"] [data-element="status-eyebrow-spacer"] { display: none; }
[data-engine="v2"][data-theme="program"] [data-cue-block-type="HERO"] { container-type: normal; }
/* The recipe states its size and weight inline on the h1; the words inside are
   set here, at the mock's size against the sheet. */
/* A word + its punctuation too wide at 40px steps the title down, floor 32px (founder 2026-11-17, GC-2436, titleUnitFit.ts). */
[data-engine="v2"][data-theme="program"] h1[data-furniture="hero"] { line-height: 1; letter-spacing: -0.035em; --eg-title-fit-floor: 32px; }
[data-engine="v2"][data-theme="program"] h1[data-furniture="hero"] > span {
  font-weight: 700; font-size: var(--eg-title-fit-size, clamp(40px, 6.2cqi, 62px));
}
/* The byline: "by <host>", underlined, in the body face. */
[data-engine="v2"][data-theme="program"] [data-cue-block-type="HERO"] > h1 + div {
  font-family: var(--eg-body-font, var(--sans)); font-style: normal; font-size: 16px;
  color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  padding-bottom: 28px;
}

/* ── The flyer: its own edge, its own shape ────────────────────────────── */
/* Shown whole, at the uploaded shape (GC-5701): a forced square crop cut the
   top and bottom off every flyer saved without a size. A theme frames the
   flyer; it never re-shapes it (`flyerFaithful.test.ts`). */
[data-engine="v2"][data-theme="program"] [data-furniture="flyer"] {
  border-radius: 0; margin-bottom: 0;
}

/* ── Labels: small bold capitals in the ink ─────────────────────────────── */
[data-engine="v2"][data-theme="program"] .eg-program-label,
[data-engine="v2"][data-theme="program"] [data-element="when-where"] > div > :first-child,
[data-engine="v2"][data-theme="program"] .eg-rsvp-label {
  font-family: var(--eg-label-font, var(--sans)); font-weight: 700; font-size: var(--program-label);
  line-height: 1.2; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
}
[data-engine="v2"][data-theme="program"] .eg-program-label { margin-bottom: 8px; }

/* ── Copy: the body at the mock's size ─────────────────────────────────── */
[data-engine="v2"][data-theme="program"] .eg-comp section[data-block] {
  --text-body: var(--program-body); --eg-fs-body: var(--program-body);
}
[data-engine="v2"][data-theme="program"] .eg-comp section[data-block] .rb-html { line-height: 1.32; }

/* ── When | Where: two up at every width, between the program's rules ─── */
[data-engine="v2"][data-theme="program"] [data-element="when-where"][data-ww="hairlineCells"] {
  flex-direction: row; gap: 24px; border-top: 0; margin-bottom: 0;
}
[data-engine="v2"][data-theme="program"] [data-element="when-where"][data-ww="hairlineCells"] > div {
  flex: 1 1 0; min-width: 0; padding: 0; border-left: 0;
}
[data-engine="v2"][data-theme="program"] [data-element="when-where"][data-ww="hairlineCells"] > div > :first-child { margin-bottom: 8px; }
[data-engine="v2"][data-theme="program"] [data-element="when-where"][data-ww="hairlineCells"] > div > :not(:first-child) {
  color: var(--text); line-height: 1.35;
}
/* The venue's name is the bold line; its address prints in the body weight. */
[data-engine="v2"][data-theme="program"] [data-element="when-where"] .eg-decrypt { font-weight: 400; color: var(--text); }
/* "Open in Maps →": small underlined capitals. */
[data-engine="v2"][data-theme="program"] [data-element="when-where"] a {
  display: inline-block; margin-top: 10px;
  font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text);
  text-decoration: underline; text-underline-offset: 2px;
}

/* ── The lineup: names left, their times in a column at the cell's midline ─
   `timeRail` sizes its name track to the longest name; a minimum width from
   the cell (each block is an inline-size container) sets the time column at
   the midline, the way the mock pairs Lineup with Schedule. The times print in
   the ink, not the muted grey — re-pointed on the element, the token the look
   reads inline. */
[data-engine="v2"][data-theme="program"] [data-block="LINEUP"] .grid { row-gap: 4px; column-gap: 0; }
[data-engine="v2"][data-theme="program"] [data-block="LINEUP"] .grid > .contents > :first-child {
  min-width: calc(50cqi - 12px); padding-right: 16px; font-weight: 700;
}
[data-engine="v2"][data-theme="program"] [data-block="LINEUP"] .grid > .contents > :last-child { --muted: var(--text); }

/* ── RSVP: a program cell, a pill field, the black pill ─────────────────── */
/* THE RSVP IS A PROGRAM CELL, NOT A BAND (founder, 2026-10-07: "too much space
   at the top"). The stepped band starts its text at `--eg-band-top` from its own
   edge plus the receipt flag's reserved room; under this cell's rule that stacked
   on the zone's pad to a 90px gap. The band's top line is zeroed, the flag's room
   is kept (the receipt still hangs its flag without moving the cell), and the pad
   lands the label where every other cell's sits: 35px under the rule. */
[data-engine="v2"][data-theme="program"] [data-cue-block-type="RSVP_FORM"] > [data-action-zone] {
  border-top: 1px solid var(--rule); padding: 12px 12px 0;
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"][data-rsvp-look="stepped"]:not([data-carousel-presentation]) {
  --eg-band-top: 0px;
}
/* The button follows the terms the way the mock's does. The band holds two lines
   of empty error room above its footer so a card never moves; on a page that
   scrolls, an error may push the button down a line, so the room goes. */
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-step {
  --eg-message-reserve: 0px;
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"][data-rsvp-look="stepped"]:not([data-carousel-presentation]) {
  --eg-footer-gap: 24px;
}
/* Every step's button follows its own content. The deck keeps each step at the
   tallest one's height so a card never resizes, and pins the footer to its
   bottom — on the code step that hung Verify ~150px below the field. Here the
   deck's spare height falls below the button, the way a page's would. */
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"][data-rsvp-look="stepped"]:not([data-carousel-presentation]) .eg-step-footer {
  margin-top: 0;
}
/* The cell closes with air before the next rule (the phone column runs on). */
[data-engine="v2"][data-theme="program"] [data-cue-block-type="RSVP_FORM"] > [data-action-zone] { padding-bottom: 32px; }
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] {
  --rsvp-background: transparent;
  --eg-section-label: var(--text);
  --eg-eyebrow-size: var(--program-label); --eg-eyebrow-weight: 700; --eg-eyebrow-tracking: 0.06em;
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] {
  --eg-fs-prompt: var(--program-body); --eg-prompt-weight: 400; --eg-helper-size: 15px; --eg-eyebrow-gap: 8px;
}
/* The send-code pill sits bottom-right like every other look's primary
   (founder, 2026-11-10); the 10-06 mock's left-edge pill read as misplaced. */
[data-engine="v2"][data-theme="program"] [data-phone-field] > [role="group"],
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] [data-guest-field-control] > input,
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] input:not([type="hidden"], [type="checkbox"], [type="radio"], [data-phone-number-input]) {
  border-radius: 999px; border: 1px solid var(--text); background: transparent; padding-inline: 18px;
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots {
  border: 1px solid var(--text); border-radius: 999px; padding: 0 14px; gap: 0;
}
/* ONE PILL, SIX DIGITS — the slots are positions inside it, never boxes of their
   own (founder, 2026-11-10: "a circle and a pill shaped. looks weird"). The
   shared slot rules ring every slot and the ACTIVE one in the accent; at this
   theme's 999px radius that ring drew a 48px circle inside the pill. The slots
   lose their edge in every state; the pill carries focus and the error. */
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slot,
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots:focus-within .eg-otp-slot[data-active],
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots[data-invalid] .eg-otp-slot,
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots:hover .eg-otp-slot {
  background: transparent; border-color: transparent; border-radius: 0; box-shadow: none;
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots:focus-within {
  box-shadow: inset 0 0 0 1px var(--text);
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots[data-invalid] { border-color: var(--eg-error-ink); }
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots[data-invalid]:focus-within { box-shadow: inset 0 0 0 1px var(--eg-error-ink); }
/* The next digit's place: a short rule under the empty slot the guest types into,
   in the ink — the cue the removed ring carried, without a shape of its own. */
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] .eg-otp-slots:focus-within .eg-otp-slot[data-active]:not([data-filled])::after {
  content: ""; grid-area: 1 / 1; align-self: end; width: 0.6em; height: 2px; margin-bottom: 25%;
  background: var(--text);
}
/* The FILLED plates are the marker, its ink on it — scoped to the plates, never
   the theme root: an outlined secondary prints `--eg-cta-color` as TEXT. */
[data-engine="v2"][data-theme="program"] [data-rsvp-primary-action],
[data-engine="v2"][data-theme="program"] section[data-block="BUTTON"] {
  --eg-cta-color: var(--eg-marker); --eg-cta-ink: var(--eg-markerInk);
}
[data-engine="v2"][data-theme="program"] [data-rsvp-primary-action] {
  width: auto; padding-inline: 22px; border-radius: 999px;
  font-weight: 700; letter-spacing: 0; text-transform: uppercase;
}
[data-engine="v2"][data-theme="program"] [data-element="rsvp-stage"] [data-rsvp-action-button] { border-radius: 999px; }
[data-engine="v2"][data-theme="program"] [data-action-zone][data-furniture="rsvp"] { border-top-width: 1px; }

/* ── Footer: small caps on the closing rule ─────────────────────────────── */
[data-engine="v2"][data-theme="program"] [data-furniture="footer"]:not([data-after-host]) > div:first-child {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
}

/* f12: authored column positions supersede type defaults, on the guest page too. */
@container program-sheet (min-width: 760px) {
  [data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] [data-cue-block-type][data-column-lane="0"] { grid-column: 1; order: var(--eg-column-order); }
  [data-engine="v2"][data-theme="program"] .eg-comp[data-composition="split"] [data-cue-block-type][data-column-lane="1"] { grid-column: 2; order: var(--eg-column-order); }
}
