/*
 * Site-level hooks for the design system. Loads after bundle.css. No new visual
 * values: only the asset hooks the design system asks its consumer to set.
 */

:root {
  /* bundle.css ships this pointing at the design-system artifact's own blob store
     ("/_blob/…"), which doesn't exist on this site. Its comment says to point it at
     the deployed copy of the canonical gamosa.svg, which is this file. */
  --be-gamosa-url: url("/design-system/assets/gamosa.svg");
}

/* ---- TEMPORARY, until the design system defines these (Sandeep, 2026-10-19) ----
   Remove each rule once bundle.css covers it; logged in 00-Workflow/build-notes.md. */

/* Image supplied in a 4:3 media slot (IndustryHero, ProofBlock, the Real Estate WhatsApp row).
   bundle.css only styles the placeholder state. Same approach as its own .about-hero
   .hero-media: the image fills the box and the placeholder diagonals are dropped. No new
   colours or sizes. */
.hero-media:has(> img)::before, .hero-media:has(> img)::after,
.proof-media:has(> img)::before, .proof-media:has(> img)::after,
.re-row .re-media:has(> img)::before, .re-row .re-media:has(> img)::after { content: none; }
/* (.re-row is needed: bundle.css draws this slot's cross with `.re-row .re-media::before`, which
   outranked a plain `.re-media:has(> img)` and left the cross over the WhatsApp demo image.) */
.hero-media > img, .proof-media > img, .re-media > img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
/* Batch C (Work page and case studies), same approach: the idea's 1:1 concept image, the process
   and system frames, the Work rows, the office artwork and the laptop / phone screens. bundle.css
   styles only their placeholder state. Device screens show the top of each page, as a browser does. */
.idea-media:has(> img)::before, .idea-media:has(> img)::after,
.work-media:has(> img)::before, .work-media:has(> img)::after { content: none; }
.idea-media > img, .pslide-media > img, .work-media > img, .office-media > img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.laptop-screen > img, .phone-screen > img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: top;
}

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-19) ----
   Image outline, using only the design system's existing lines; no new colours or sizes.
   Light sections: the process frames' own outline (bundle.css .pslide-media: 1px solid var(--rule)),
   on the Work tiles (so light images such as Katha's don't merge into the white section) and on the
   case studies' standalone images (case hero, idea image). Dark sections ("In the real world"): the
   dark-surface line, var(--rule-on-dark), on the stationery, video-ad and reel thumbnails and the
   office artwork. Not on the laptop / phone mockups or WhatsApp screenshots (device frames), or on
   anything already outlined (process and system frames, the n8n zoom). */
.work-media,
.case-hero .hero-media,
.case-idea .idea-media { border: 1px solid var(--rule); }
.case-world .wmedia,
.case-world .office-media { border: 1px solid var(--rule-on-dark); }

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, approved 2026-10-21) ----
   Extend the work / case-study image outline to the rest of the site. Same border values.
   Excluded: the About page hero illustration (.about-hero .hero-media) — no outline by design;
   device frames (.wa-phone img, .phone-screen img, .laptop-screen img); decorative SVGs (alt="");
   and client logos (testimonial and case-study client logos). */
.industry-hero:not(.about-hero) .hero-media,
.proof-media,
.member-photo,
.project-slide { border: 1px solid var(--rule); }
.proof .dmedia { border: 1px solid var(--rule); }
.work-demos .dmedia { border: 1px solid var(--rule-on-dark); }

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, approved 2026-10-19) ----
   Dr Ayan WhatsApp phones, a little smaller: the track uses the process frames' own columns
   (bundle.css .process-track: 4 across on desktop, 2.5 on tablet) instead of .wa-track's 3 and 2.3.
   Phones stay 68vw on phones, as in bundle.css (re-declared so the desktop rule doesn't override it).
   The screenshot keeps width: 100%; height: auto, so the phone keeps its shape and nothing is cropped. */
.wa-track { grid-auto-columns: calc((100% - 3 * var(--pgap)) / 4); }
@media (max-width: 1000px) and (min-width: 761px) { .wa-track { grid-auto-columns: calc((100% - 2 * var(--pgap)) / 2.5); } }
@media (max-width: 760px) { .wa-track { grid-auto-columns: 68vw; } }

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Fit-assessment hero: the four currents as the industry pages' journey timeline (ol.journey,
   li.stage, .node), so initJourney() animates it. Words only, no paragraphs. The DS timeline is
   built for a full-width section (54px headings, 56px top margin); in the hero it needs no top
   margin and its headings keep the DS style (bold, title case, tight tracking) at a smaller size (20-30px instead of 34-54px). The node is lighter
   at every width: the compact icon size (18px) in a node of icon + space-md (34px). At 900px and below
   the vertical version is also compact: a space-md gap between stages and the heading centred on its node. Existing tokens and values only. */
.flow-hero .journey { --node: calc(var(--icon-size-compact) + var(--space-md)); margin-top: 0; }
.flow-hero .node svg { width: var(--icon-size-compact); height: var(--icon-size-compact); }
.flow-hero .stage h3 { margin: 0; font-size: clamp(20px, 2.2vw, 30px); line-height: 1; }
@media (max-width: 900px) {
  .flow-hero .journey { --j-gap: var(--space-md); }
  .flow-hero .stage { display: flex; align-items: center; padding-left: calc(var(--node) + var(--space-md)); }
}

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Fit-assessment result readings without the "[ Leak ]" tag: the DS row reserves a fourth 80px track
   for the tag, which left empty space to the right of the score. Drop that track so the score sits at
   the right edge (the DS's own 110px / 1fr / 65px). On phones the row is name + score over the bar
   (the DS arrangement minus the tag column), with more room: space-md padding and gaps. DS values only. */
.result-grid .reading-row { grid-template-columns: 110px 1fr 65px; }
@media (max-width: 760px) {
  .result-grid .reading-row { grid-template-columns: 1fr auto; grid-template-areas: "name score" "bar bar"; gap: var(--space-sm) var(--space-md); padding: var(--space-md) 0; }
}

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Assessment received hero: the DS card gives the hero the full section padding below its content,
   and the result block adds its own padding and a closing rule, which left an empty band above the
   Gamosa strip (with or without a score). Heroes elsewhere end with 36 to 56px (the flow hero's
   bottom padding) and then the strip, so do the same here and drop the closing rule. DS values only. */
.receipt-hero { padding-bottom: clamp(36px, 5vw, 56px); }
.receipt-result { padding-bottom: 0; border-bottom: 0; }

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Open industry menu (base-select browsers): the DS panel has 6px padding top and bottom, which shows
   as an empty strip above the first row and below the last. Rows are already 44px with rule dividers,
   so the panel takes no padding of its own. */
@supports (appearance: base-select) {
  .form-select::picker(select) { padding: 0; }
}

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Fit-assessment form score ticket: keep the desktop ticket (header, Spark, score, summary) on phones
   and tablets too. The DS shrinks it to one line (label, score, level) at 1120px and below and hides
   the Spark and the summary; this restores the DS's own desktop rules there. DS values only. */
@media (max-width: 1120px) {
  .fit-rail .scorecard-ticket { flex-direction: column; align-items: stretch; gap: 12px; padding: 22px 24px; }
  .fit-rail .ticket-header { display: flex; }
  .fit-rail .ticket-body { display: flex; }
  .fit-rail .ticket-body > div:not(.spark-meter) { display: block; }
  .fit-rail .ticket-header > span:first-child { order: 0; margin-right: 0; }
  .fit-rail .ticket-score { order: 0; white-space: normal; }
  .fit-rail .ticket-score b { font-size: clamp(32px, 3.8vw, 44px); }
  .fit-rail .ticket-level { order: 0; }
  .fit-rail .spark-meter { display: block; }
  .fit-rail .ticket-summary { display: block; }
}

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Assessment received, phones: the small Spark (34px wide, 55px tall) stands taller than the 40px score
   beside it. Scale it to the icon size token (26px wide, about 42px tall) so it matches the digits. */
@media (max-width: 760px) {
  .receipt-score .spark-meter { width: var(--icon-size); }
}

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Contact, sent state: the form gives way to the confirmation, so the "Anything else?" heading,
   its line and the rule beneath go too, and the confirmation drops its own coral top rule. */
.contact-form-wrap:has(.contact-success:not([hidden])) .form-head { display: none; }
.contact-success { border-top: 0; }

/* ---- LOCAL EXCEPTION, until the design system adds a legal-page reading pattern (Sandeep, 2026-10-20) ----
   Privacy and Website Terms reuse NextSteps rows (.next-steps, .next-step, .next-step-num) and the Contact
   page's .contact-direct rows. Only what they lack is added here: the label's gap above the first row (as on Contact),
   the number | h3 | text columns, body-md text (the NextSteps p is 18-24px) running the full width of its column,
   h4 sub-heads at headline-sm, and round primary list markers (3.55:1 on white, above the 3:1 graphics floor;
   a shape in a list, never colour alone).
   In-text links keep ink with a 1px coral line always drawn (guideline 08). */
.legal-dates { margin: 20px 0 0; }
.legal-body .section-meta { margin-bottom: clamp(32px, 4vw, 56px); }
.legal-step { grid-template-columns: 56px minmax(180px, .55fr) minmax(0, 1.45fr); align-items: start; }
.legal-step h3 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.legal-text { font-size: 17px; line-height: 1.4; }
.legal-text > * { margin: 0; }
.legal-text > * + * { margin-top: 16px; }
.legal-text > h4 { margin-top: 28px; font-size: clamp(20px, 1.9vw, 26px); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.legal-text > h4 + * { margin-top: 12px; }
.legal-step .legal-text p { font-size: inherit; line-height: inherit; letter-spacing: normal; }
.legal-text ul { padding: 0; list-style: none; }
.legal-text li { position: relative; padding-left: 22px; }
.legal-text li + li { margin-top: 10px; }
.legal-text li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--primary); }
.legal-text a:not(.contact-option) { text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: .2em; }
@media (max-width: 760px) { .legal-step { grid-template-columns: 56px minmax(0, 1fr); row-gap: 16px; } .legal-step h3, .legal-step .legal-text { grid-column: 2; } }

/* ---- LOCAL EXCEPTION, until the design system adds it (Sandeep, 2026-10-20) ----
   Footer legal links (Privacy, Website Terms): the current page keeps the coral line drawn, as the other footer
   links do (guideline 08). The design system's rule covers .footer-column links but not .legal links. */
.legal a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left center; }

/* ---- LOCAL EXCEPTION, until the design system adds a 404 pattern (Sandeep, 2026-10-20) ----
   404 hero: one centred column (headline, the supplied monitor illustration, the two buttons) with the Contact
   hero's closing space. The headline is in ink and one line on desktop (--len is the whole line, so the page-hero size rule fits it
   to the width), broken before "isn't here." on phones (--len then the longer line); right padding keeps the full stop
   from being clipped by the headline's overflow:hidden. The coral payoff is set to ink. The art is coral line art (3.34:1 on paper, above the 3:1
   graphics floor); the support line sits inside its screen in ink (18.64:1), sized to the illustration so it fits. */
.hero.industry-hero.not-found-hero { padding-bottom: clamp(48px, 6vw, 96px); }
.hero.industry-hero.not-found-hero .hero-main { display: flex; flex-direction: column; align-items: center; gap: clamp(32px, 4vw, 56px); text-align: center; }
.not-found-hero .hero-title { --len: 21; white-space: nowrap; }
.hero.industry-hero.not-found-hero .hero-title em { display: inline; color: var(--ink); }
.not-found-hero .headline-sentence { padding-right: .1em; margin-right: -.1em; }
@media (max-width: 760px) { .not-found-hero .hero-title { --len: 11; } .hero.industry-hero.not-found-hero .hero-title em { display: block; } }
.not-found-hero .hero-actions { align-self: stretch; justify-content: center; }
.not-found-art { position: relative; container-type: inline-size; width: min(100%, 380px); }
.not-found-art img { width: 100%; height: auto; }
.not-found-note { position: absolute; top: 36%; left: 10%; right: 10%; margin: 0; font-size: clamp(14px, 4.2cqw, 20px); line-height: 1.3; letter-spacing: -.02em; text-align: left; color: var(--ink); }
