/* ─────────────────────────────────────────────────────────────────────────
   Section: Resources — For Whom. Figma 2225:1648 / 2225:1657 (desktop,
   1440 canvas) and 2353:4052 (mobile, 360 canvas).

   SCROLL-DRIVEN HORIZONTAL TRACK (>= 48rem) — the same architecture as the
   Solutions cards, deliberately: one behaviour for both card tracks on the
   site. Four nested boxes, each with one job:

     __stack     the scroll runway. Its EXTRA height over one viewport is
                 exactly the horizontal distance the track must travel, so
                 one pixel of scrolling moves the track one pixel. It also
                 carries the view-timeline the animation reads.
     __pin       the single sticky element. One pin — not five sticky cards
                 — so the deck can never drift apart or unpin at different
                 moments.
     __viewport  the clipping window.
     __track     the row that translates.

   `contain` is the right range: with a sticky child the pin is held from
   the stack's top reaching the viewport top until its bottom reaches the
   viewport bottom, which is exactly what `contain` spans. `entry` covers
   only the element's own height and would finish before the section had
   arrived.

   translateX(calc(100vw - 100%)) — the track is width:max-content so its
   100% already includes its own gutters; subtracting from the viewport
   lands its right gutter on the viewport edge. min(0px, …) guards the case
   where the viewport is wider than the track, which would otherwise shunt
   the cards right off their own left edge.

   EXTRA-LARGE SCREENS: the track keeps the plain page gutter measured from
   the viewport and centres itself with margin-inline:auto once it is
   narrower than the viewport. The centred-canvas gutter used by the static
   sections on this page is deliberately NOT used here — see the note on
   the track rule for why it breaks a scroller.

   EVERY INTERNAL DIMENSION IS DERIVED FROM THE CARD WIDTH, not from vw.
   The card is capped by height as well as width, so on a short viewport it
   is narrower than its vw would suggest; a vw-based font would keep full
   size inside a shrunken card and wrap onto more lines than the design.

   NORMALISATION: Figma's five desktop cards are hand-placed and
   inconsistent (widths 476/478/453/450/450, heights 796/796/750/750/750,
   insets 36/47/37/34/30, card 1's heading 60/57 vs 57/55). They render
   here as one consistent 450x750 card. The mobile frame is already
   uniform and confirms that is the intent.
   ───────────────────────────────────────────────────────────────────── */

.section-resources-for-whom {
  background: var(--color-white, #fff);

  --space-fw-card-w: 84.444vw; /* 304 of 360 */
  --space-fw-card-gap: 5vw; /* 18 */
  --space-fw-card-pad: 5.5556vw; /* 20 */
}

/* ── Mobile: native scroll-snap carousel ──────────────────────────────── */

.section-resources-for-whom__stack {
  padding-block: 16.667vw; /* 60 */
}

/* The clipping window is also a CONTAINER, so the keyframe can measure the
   real content width with cqw. 100vw includes the scrollbar gutter; the
   track's own width does not. Ending the travel at `100vw - 100%` therefore
   stopped the deck a scrollbar-width short of its mark, so the last card
   never quite reached the gutter. cqw is the container's content box —
   scrollbar excluded — so the last card lands exactly where it should. */
.section-resources-for-whom__viewport {
  container-type: inline-size;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-resources-for-whom__viewport::-webkit-scrollbar {
  display: none;
}

.section-resources-for-whom__track {
  display: flex;
  align-items: stretch;
  gap: var(--space-fw-card-gap);
  width: max-content;
  padding-inline: var(--space-fw-card-pad);
  margin: 0;
  list-style: none;
}

/* Heading at the top, body at the bottom — Figma's mobile cards state this
   explicitly with justify-between, and the desktop offsets agree. */
.section-resources-for-whom__card {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--space-fw-card-w);
  /* min-height, not aspect-ratio: the track stretches every card to the
     tallest, and a hard ratio would clip copy that wraps to more lines than
     Figma's on a narrow phone. This keeps Figma's height as the floor. */
  min-height: calc(var(--space-fw-card-w) * 1.351974);
  padding-inline: calc(var(--space-fw-card-w) * 0.105263); /* 32 of 304 */
  padding-block: calc(var(--space-fw-card-w) * 0.184211); /* 56 of 304 */
  overflow: hidden;
  /* NO border. The Solutions cards carry `border border-[#001f3e]`, but the
     Resources cards do not — Figma 2225:1653 / 2225:1663 are
     `backdrop-blur + bg + rounded-[50px] + shadow` with no border property.
     The 1px navy border here was carried over from the Solutions pattern.
     Removing it also removes the 2px it was stealing from the card's
     padding box, which is what left the mask 1-2px off its Figma offsets. */
  border-radius: var(--radius-card);
  scroll-snap-align: center;
  /* No backdrop-filter: every card fill is opaque, so a 50px backdrop blur
     has nothing to blur and only costs a compositing layer per card. */
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
}

.section-resources-for-whom__title {
  font-family: var(--font-primary, "Inter", sans-serif);
  font-weight: 600;
  font-size: calc(var(--space-fw-card-w) * 0.092105); /* 28 of 304 */
  line-height: calc(var(--space-fw-card-w) * 0.119737); /* 36.4 */
  letter-spacing: -0.024em;
  color: var(--color-white, #fff);
}

.section-resources-for-whom__body {
  font-family: var(--font-primary, "Inter", sans-serif);
  font-weight: 600;
  font-size: calc(var(--space-fw-card-w) * 0.059211); /* 18 of 304 */
  line-height: calc(var(--space-fw-card-w) * 0.076974); /* 23.4 */
  letter-spacing: -0.024em;
  color: var(--color-white, #fff);
}

/* Per-card gradients — mobile angles. */
.section-resources-for-whom__card--royal-green,
.section-resources-for-whom__card--royal-green-flip {
  background-image: linear-gradient(220.218deg, rgb(24 58 115) 4.802%, rgb(56 94 48) 98.513%);
}

.section-resources-for-whom__card--royal-solid {
  background-color: #183a73;
}

/* OPAQUE, and no white stop. Figma's fill is a 60%-alpha gradient whose
   third stop is white at 110% — sitting on a masked photo inside a dark
   composition. Transcribed literally onto this page's WHITE section the
   translucency blends into the background and the white stop blooms, so
   the card reads as glossy and washed out. Figma's own render of these two
   cards is a solid, saturated green-to-lime; that is what is reproduced.
   An earlier pass added the masked photo underneath to restore the body —
   it did not, because the wash comes from the alpha and the white stop,
   not from a missing texture. */
.section-resources-for-whom__card--viridian,
.section-resources-for-whom__card--viridian-flip {
  background-image: linear-gradient(124.938deg, #00804d 0%, #dbe64c 100%);
}

.section-resources-for-whom__mask {
  position: absolute;
  display: block;
  /* Figma 2353:4070: a bare ellipse 210.403x209 — NOT the desktop's masked
     panel. Its viewBox matches the artwork, so the ratio needs no correction.

     POSITION IS FROM THE RENDER, NOT THE METADATA. 2353:4070 reports
     (172, 98.49), which puts the ellipse in the MIDDLE of the card; the Figma
     render of Frame 283 shows the fill at y 0%..23.2% — hard against the top
     edge, nothing in the bottom half. Since the ellipse is 209 tall and its
     visible fill ends at ~23%, its top sits ABOVE the card at about -27%.
     The desktop mask's metadata was wrong in the same way (see the desktop
     rule): for this group, trust the render. */
  left: 56.579%; /* 172 of 304 */
  top: -26.89%; /* ellipse overhangs the card top; fill lands at 0..23% */
  width: 69.211%; /* 210.403 of 304 */
  aspect-ratio: 210.403 / 209;
  max-width: none;
  pointer-events: none;
}

/* Visibility here, not via Tailwind: this sheet loads after main.css and the
   base class ties with `.hidden` on specificity, so both would render. */
.section-resources-for-whom__mask--desktop {
  display: none;
}

/* ── Dots ─────────────────────────────────────────────────────────────── */

.section-resources-for-whom__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.7778vw; /* 10 */
  margin: 6.6667vw 0 0; /* 24 */
  padding: 0 5.5556vw 0 0;
  list-style: none;
}

.section-resources-for-whom__dot {
  display: block;
  width: 3.6111vw; /* 13 */
  height: 3.6111vw;
  padding: 0;
  border: none;
  border-radius: 3.6111vw;
  background: #d9d9d9;
  cursor: pointer;
  transition:
    width 0.25s,
    background-color 0.25s;
}

.section-resources-for-whom__dot:focus-visible {
  outline: 3px solid var(--color-yellow, #dbe64c);
  outline-offset: 3px;
}

.section-resources-for-whom__dot[aria-current="true"] {
  width: 11.111vw; /* 40 */
  background: var(--color-yellow, #dbe64c);
}

/* ── Tablet and up: the pinned horizontal track ───────────────────────── */

@media (width >= 48rem) {
  .section-resources-for-whom {
    --space-fw-card-gap: min(3.3125rem, 3.6806vw); /* 53 */
    --space-fw-pad-block: min(6.25rem, 6.9444vw, 13svh); /* 100 */
    --space-fw-card-pad: min(9.375rem, 10.4167vw); /* 150 — both gutters, from the viewport */

    /* The third term is the height budget — whatever is left of the
       viewport after the section's vertical padding — converted to a width
       through the card's own 450/750 ratio. Without it a 750-tall card
       overflows the 100svh pin on any laptop and gets clipped. */
    --space-fw-card-w: min(
      28.125rem,
      31.25vw,
      calc((100svh - 2 * var(--space-fw-pad-block)) * 0.6)
    ); /* 450 */

    --space-fw-track-w: calc(
      2 * var(--space-fw-card-pad) + 5 * var(--space-fw-card-w) + 4 * var(--space-fw-card-gap)
    );
    --space-fw-travel: max(0px, calc(var(--space-fw-track-w) - 100vw));
  }

  /* DESKTOP FALLBACK. Without scroll-driven animation (Firefox today) or under
     prefers-reduced-motion, this stays the horizontally scrollable carousel the
     mobile layout uses, just at desktop card sizes. Everything that pins or
     clips now lives inside the guards further down.

     It used to clip here UNCONDITIONALLY while only the track's movement was
     guarded — so in those browsers the viewport was overflow:hidden around a
     track that never moved, leaving 2 of the 5 cards unreachable and hiding
     the dots that would have navigated to them. The comment below claimed the
     guards "only ADD the pinning, never hide anything"; that was not true. */
  .section-resources-for-whom__stack {
    padding-block: var(--space-fw-pad-block);
  }

  .section-resources-for-whom__track {
    /* NO centred-canvas term on a SCROLLING track — that belongs only to
       static compositions. Added here it lands on BOTH gutters, so the
       track's own width grows by roughly the viewport width on a very wide
       screen; --travel is derived from that width, so the runway inflates
       and the page gains a screen-height of empty space before the cards,
       even at widths where all of them already fit without scrolling.
       The gutter stays the plain page gutter, and the track centres itself
       via margin-inline:auto once it is narrower than the viewport — at
       which point --travel is 0, the runway collapses to one viewport, and
       the keyframe's min(0px, …) holds the translation at zero. */
    gap: var(--space-fw-card-gap);
    padding-inline: var(--space-fw-card-pad);
    margin-inline: auto;
  }

  .section-resources-for-whom__card {
    width: var(--space-fw-card-w);
    aspect-ratio: 450 / 750;
    /* Clear the mobile floor — see the note in the Solutions cards. */
    min-height: 0;
    padding-inline: calc(var(--space-fw-card-w) * 0.08); /* 36 of 450 */
    padding-block: calc(var(--space-fw-card-w) * 0.164444) calc(var(--space-fw-card-w) * 0.133333); /* 74 / 60 */
    scroll-snap-align: none;
  }

  .section-resources-for-whom__title {
    font-size: calc(var(--space-fw-card-w) * 0.126667); /* 57 of 450 */
    line-height: calc(var(--space-fw-card-w) * 0.122222); /* 55 */
  }

  .section-resources-for-whom__body {
    font-size: calc(var(--space-fw-card-w) * 0.088889); /* 40 of 450 */
    line-height: calc(var(--space-fw-card-w) * 0.095556); /* 43 */
  }

  /* Desktop angles. Cards 4 and 5 are cards 1 and 2 mirrored in Figma
     (scaleY(-1) and rotate(180deg)); expressed as angles rather than a
     transform, which would mirror the copy too. Mirroring about the
     horizontal axis maps an angle to 180 − θ; rotating 180 adds 180. */
  .section-resources-for-whom__card--royal-green {
    background-image: linear-gradient(226.286deg, rgb(24 58 115) 4.802%, rgb(56 94 48) 98.513%);
  }

  .section-resources-for-whom__card--royal-green-flip {
    background-image: linear-gradient(313.81deg, rgb(24 58 115) 4.802%, rgb(56 94 48) 98.513%);
  }

  .section-resources-for-whom__card--viridian {
    background-image: linear-gradient(119.24deg, #00804d 0%, #dbe64c 100%);
  }

  /* Figma's render shows this card identical to the Community Managers
     one, despite the file carrying a mirrored angle for it. */
  .section-resources-for-whom__card--viridian-flip {
    background-image: linear-gradient(119.24deg, #00804d 0%, #dbe64c 100%);
  }

  /* Figma 2225:1667 places this at (74, 331) in the 453x750 card — the
     MIDDLE of the card, not pinned to its bottom. `bottom: 0` put it ~89px
     too low and 29.11% put it ~57px too far right, which is what pushed the
     arc down to the bottom of the card.
       left  74/453 = 16.336%   top 331/750 = 44.133%   width 379/453 = 83.664%
     aspect-ratio is the export's VIEWBOX (383x339), not the artwork (379x331):
     the file is preserveAspectRatio="none", so pinning the artwork ratio
     squashes the panel and pulls the masked ellipse off its arc. */
  /* Arc sits TOP-RIGHT on this card. Verified from the Figma render of
     Group 109 (2225:1648): the green arc occupies 0-38% down the card and
     the right ~75% of its width, with ZERO pixels in the bottom half.

     Do NOT take the offsets from 2225:1667's metadata — it reports (74, 331),
     which is the middle of the card and renders the arc at the BOTTOM. That
     group's coordinates are internally inconsistent (sibling cards report
     y=3757, the frame's own bottom edge), so the render is the authority here.

     The artwork's fill lives in the LOWER half of its 379x331 panel, so
     landing it at the card's top needs the panel at top:0 AND a vertical
     flip — which is why the mobile rule already carries scaleY(-1). Flipped
     and top-aligned, the fill covers y 0..286 and x 110..450 of a 450x750
     card, matching the measured 0-38% / right side. */
  /* Corner alignment. The export's viewBox is 383x339 but the ARTWORK inside
     it is 379x331 — 4px of padding on the right, 8px on the bottom (Figma's
     own markup compensates with inset 0 -1.06% -2.42% 0). Two consequences:

       - sized so the artwork is 379 wide, the element must be 383 wide:
         379/453 * 383/379 = 84.56% of the card
       - scaleY(-1) moves that 8px of BOTTOM padding to the TOP, pushing the
         artwork ~8px down off the card's corner. top: -1.06% cancels it.

     Net: the artwork's top-right corner lands exactly on the card's, so its
     50px radius nests into the card's 50px radius instead of floating a few
     pixels inside it. */
  .section-resources-for-whom__mask--mobile {
    display: none;
  }

  .section-resources-for-whom__mask--desktop {
    display: block;
  }

  .section-resources-for-whom__mask {
    left: 16.33%; /* artwork's left edge, so its right edge is flush at 450 */
    top: -1.06%; /* cancels the viewBox padding the flip moves to the top */
    bottom: auto;
    width: 84.56%; /* 383 viewBox units, so the 379 artwork lands at 379 */
    aspect-ratio: 383 / 339;
    transform: scaleY(-1);
  }

  /* Browsers without scroll-driven animation and readers who asked for
     less motion keep the plain scrollable track — these guards only ADD
     the pinning, never hide anything. */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .section-resources-for-whom__stack {
        height: calc(100svh + var(--space-fw-travel));
        padding-block: 0;
        view-timeline-name: --fw-cards;
        view-timeline-axis: block;
      }

      .section-resources-for-whom__pin {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100svh;
        padding-block: var(--space-fw-pad-block);
        overflow: hidden;
      }

      /* Clipping belongs WITH the animation that makes the clipped area
         navigable — never on its own. */
      .section-resources-for-whom__viewport {
        overflow: hidden;
        scroll-snap-type: none;
      }

      /* Dots are the fallback's navigation, so they only go away once the
         pinned track can move. */
      .section-resources-for-whom__dots {
        display: none;
      }

      .section-resources-for-whom__track {
        animation: section-resources-for-whom-slide linear both;
        animation-timeline: --fw-cards;
        animation-range: contain 0% contain 100%;
      }
    }
  }
}

@keyframes section-resources-for-whom-slide {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(min(0px, calc(100cqw - 100%)));
  }
}
