/* ============================================================
   Gateway page (gateway.html) - "Join the Movement" (2026-09-25, Maggie's
   mockup in GEM branding). Loaded by gateway.html only; every rule here is
   gw-* so nothing in styles.css is edited or reused except the tokens, the
   .btn / .btn--primary classes and the page's existing short gold divider
   (.gateway-hero__divider). The older .gateway-* rules in styles.css now
   match nothing on this page and are left in place.

   Structure: main.gw carries the photograph for the WHOLE content area
   (2026-09-25 v2: gateway-bg-v2, the seated woman above the mist) -> .gw-hero
   (heading, divider, subheading on the bare picture) -> .gw-cards (three
   white cards rising into the picture's cream fade: image, title, line, full-width
   primary button) -> the retained comment blocks.

   Measured pairs: heading and subheading --purple-deep on the REAL
   photograph pixels behind them (see the task report); on the white cards
   title --purple-deep 14.49:1, line --text-warm 8.59:1, button white on
   --purple-bright 6.46:1 (hover --purple 12.33:1).
   ============================================================ */

/* ---- the picture, under everything from the header to the footer. No wash,
   no dark overlay.
   From 1024px: cover, anchored top-right (100% 0), so the sunrise and the
   seated woman on the right stay in view whatever the crop; the area is one
   continuous image, so nothing behind the cards can show an edge.
   From 1024px the copy is LEFT-aligned in the container: the woman sits at
   68-84% of the picture's width, which under a right-anchored cover crop is
   the middle of a 1024px screen - a centred heading block would run across
   her at every desktop width - while the left half of the picture is open
   sky and mountains.
   Below 1024px the stacked cards make the area far taller than the picture,
   and cover would blow it up: the 1280px export is anchored top-LEFT at a
   fixed height instead - clamp(830px, 200vw, 900px) - so the centred copy
   sits on sky and the mountain line (the woman is outside that crop), and
   (to-A 033, 16 Nov 2026) at every width the picture fades into cream inside
   the hero, just above the cards (.gw-hero::before, anchored to the cards' top
   edge, so it follows the layout at any font size), and from the cards' top
   edge down to the footer the ground is plain cream (.gw-cards). Was: below
   1024px a flat dusty pink sampled from the picture's mist (#D0A8A8, from 520px,
   flat by 820px) behind the cards and below; from 1024px the picture itself
   behind the cards, to the footer. */
.gw {
  --gw-overlap: 5.5rem;              /* how far the cards rise into the hero */
  --gw-fade: 7.5rem;                 /* the picture's fade into the mist, its foot at the cards' top edge, the last 1.5rem plain mist (16 Nov 2026, Vicky checks by eye; to-A 033 had 7rem into cream) */
  --gw-mist: rgb(241, 230, 228);       /* 16 Nov 2026: a very pale peach-lavender, the picture's horizon at the cards' top edge (lavender left, peach right; mean about rgb(196, 158, 160)) at 20% over --cream */
  background-color: var(--cream);    /* to-A 033: was the mist pink #D0A8A8 */
  background-image: url("../img/gateway/gateway-bg-v2-1280.webp");   /* to-A 033: the mist gradient layer removed */
  background-size: auto clamp(830px, 200vw, 900px);
  background-position: 0 0;
  background-repeat: no-repeat;
}
@media (min-width: 64rem) {
  .gw {
    background-color: var(--cream);
    background-image: url("../img/gateway/gateway-bg-v2-1536.webp");
    background-size: cover;
    background-position: 100% 0;
  }
}
.gw-hero {
  position: relative;
  text-align: center;
  padding-top: clamp(3.25rem, 7vw, 5.5rem);
  padding-bottom: calc(var(--gw-overlap) + clamp(3rem, 6vw, 5rem));
}
/* to-A 033: the picture fades into cream above the cards - a band of --gw-fade whose
   foot is the cards' top edge (the hero's bottom minus the overlap), eased so no
   step shows. Painted under the copy (the copy's box comes later and is positioned). */
.gw-hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--gw-overlap);
  height: var(--gw-fade);
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(241, 230, 228, 0) calc((100% - 1.5rem) * 0),
    rgba(241, 230, 228, 0.028) calc((100% - 1.5rem) * 0.1),
    rgba(241, 230, 228, 0.104) calc((100% - 1.5rem) * 0.2),
    rgba(241, 230, 228, 0.216) calc((100% - 1.5rem) * 0.3),
    rgba(241, 230, 228, 0.352) calc((100% - 1.5rem) * 0.4),
    rgba(241, 230, 228, 0.5) calc((100% - 1.5rem) * 0.5),
    rgba(241, 230, 228, 0.648) calc((100% - 1.5rem) * 0.6),
    rgba(241, 230, 228, 0.784) calc((100% - 1.5rem) * 0.7),
    rgba(241, 230, 228, 0.896) calc((100% - 1.5rem) * 0.8),
    rgba(241, 230, 228, 0.972) calc((100% - 1.5rem) * 0.9),
    rgba(241, 230, 228, 1) calc((100% - 1.5rem) * 1),
    var(--gw-mist) 100%);            /* 16 Nov 2026: eased (smoothstep) in 11 stops into the mist, plain for its last 1.5rem, so no bar shows across the seated woman or the mountains; was 6 stops into cream */
}
@media (min-width: 64rem) {
  .gw { --gw-fade: 7.25rem; }        /* 16 Nov 2026: from about the seated woman's shoulder line at 1440 (was 4.5rem, to-A 033) */
  .gw-hero { min-height: 27.5rem; text-align: left; }   /* to-A 033: 440px (was 30rem, 480px) of sky above the card row, so the three buttons show whole at 1440 x 900; copy on the left, clear of the woman */
  .gw-hero__title { margin-left: 0; }
  .gw-hero__sub { margin-left: 0; }
  .gw-hero .gateway-hero__divider { margin-left: 0; }
}
.gw-hero__inner { position: relative; }
/* the copy sits directly on the picture - no plate (removed 2026-09-25) */
.gw-hero__copy {
  display: inline-block;
  max-width: 100%;
}
.gw-hero__title {
  margin: 0 auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2rem, 4.8vw, 3.25rem);
  line-height: 1.12;
  color: var(--purple-deep);
  text-wrap: balance;
}
.gw-hero__sub {
  margin: 1.1rem auto 0;
  max-width: 34ch;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  color: var(--purple-deep);
}

/* ---- the three cards: white, the site radius and soft shadow, image on top
   (a fixed 3:2 box, so nothing shifts as the picture arrives), centred body,
   the button at the foot of every card so the three line up. */
.gw-cards {
  position: relative;
  margin-top: calc(-1 * var(--gw-overlap));
  padding-bottom: clamp(3rem, 6vw, 5rem);
  /* 16 Nov 2026: the mist at the cards' top edge, easing to --cream by the cards' bottom edge (the section's foot less its padding), plain cream from there to the footer (to-A 033: plain cream) */
  background: linear-gradient(180deg, var(--gw-mist) 0%, rgb(246, 239, 236) calc((100% - clamp(3rem, 6vw, 5rem)) * 0.45), var(--cream) calc(100% - clamp(3rem, 6vw, 5rem)), var(--cream) 100%);
}
.gw-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 480px;                  /* one centred column below 1024px */
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 64rem) {
  .gw-grid { max-width: none; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 2.5vw, 2rem); }
}
.gw-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid rgba(58, 42, 102, 0.2);              /* 16 Nov 2026: the edge the single expert card got in 066 */
  box-shadow: 0 4px 16px rgba(46, 33, 80, 0.1);          /* 16 Nov 2026: as 066 (was 0 2px 10px at .08) */
  transition: box-shadow 0.2s ease;
}
.gw-card:hover,
.gw-card:focus-within { box-shadow: 0 10px 28px rgba(46, 33, 80, 0.16); }
.gw-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;               /* to-A 033: the photographs' own shape (1200 x 800), whole; was 4 / 3 */
  object-fit: cover;
  object-position: center;
}
.gw-card__img--left  { object-position: 30% center; }   /* Patients: the subject sits left of centre */
.gw-card__img--right { object-position: 70% center; }   /* Professionals: right of centre */
.gw-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.5rem, 2.5vw, 1.75rem);
}
.gw-card__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.35rem, 2vw, 1.6rem);
  line-height: 1.2;
  color: var(--purple-deep);         /* 14.49:1 on white */
  text-wrap: balance;
}
.gw-card__line {
  margin: 0.55rem 0 1.4rem;
  max-width: none;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--text-warm);           /* 8.59:1 on white */
}
.gw-card .gw-card__btn {
  margin-top: auto;                  /* the foot of every card, whatever the line's length */
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0625rem;
}
.gw-card .gw-card__btn > span { margin-left: 0.45rem; }
.gw-card .gw-card__btn > [data-story-lang] { margin-left: 0; }   /* to-B 020: the label's English / Chinese halves; the gap stays on the arrow only */
.gw-card .gw-card__btn > [data-story-lang] { text-wrap: balance; }   /* 107 (A, from-B 077 finding 3, Vicky's yes 22 Nov): a label on two lines breaks evenly (on /bg/ "GEM" no longer stands alone), as the card titles above */
.gw-card .gw-card__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .gw-card { transition: none; }
}
