/* Home hero carousel (Figma HeroPanels 452:6698, 1440 x 922). A constant tagline, then slides that change only their headline,
   subhead and button, over full-bleed background images with a focal point and the HeroGradient scrim. Sizes come from tokens
   (tokens.css: --hero-*, --measure-hero-*); no raw lengths here (npm run lint:tokens). Below 1024 the layout is the responsive
   spec's Q4 recommendation (a), pending Lance's confirmation: same overlay layout anchored bottom-left, horizontal indicators. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  overflow: hidden;
  /* Fills the window minus the next section's top padding and a sliver of its content (80 at every width: the black rule and
     the top of its heading show, so it is clear there is more to scroll to), never shorter than --hero-h-min (430 on phones, 660 at 1440,
     780 at 1920) nor taller than --hero-h-max; --hero-h-fit in tokens.css. The Figma 922 is the height at a 1440 x 1072 window. */
  min-height: var(--hero-h-fit);
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}

/* Backgrounds: one layer per slide, cross-faded. */
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms ease, visibility 0s linear 600ms;
}
.hero__bg.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.hero__img { position: absolute; inset: 0; }
/* HeroGradient: the text scrim; strength is the slide's opacity (--scrim-strength, from ACF). */
.hero__scrim { position: absolute; inset: 0; background: var(--gradient-hero-scrim); opacity: var(--scrim-strength); }

/* Text column: the tagline is fixed; the slides share one grid cell so the area is as tall as the tallest slide. */
.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-gap-md); /* phones: 24 under the tagline (desktop 32, below) so a small phone's hero can stay short */
  width: 100%;
  /* Phones: the copy starts right under the header bar and clears the pager row (24 up + 44 high + 4), so the hero can be as short as
     --hero-h-min (430) on a small phone and still leave the same 80px sliver as a big one. Taller heroes just show more photo above. */
  padding: var(--header-main-h-compact) var(--gutter) calc(var(--space-inset-lg) + var(--tap-min) + var(--space-gap-5xs));
}
.hero__tagline { margin: 0; }
.hero__slides { display: grid; }
.hero__copy {
  display: grid;
  grid-area: 1 / 1;
  align-self: center;
  justify-items: start;
  gap: var(--space-gap-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms ease, visibility 0s linear 600ms;
}
.hero__copy.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.hero__headline,
.hero__lead { margin: 0; }

/* Pager: one real button per slide (a 44 px hit area around a thin bar). */
.hero__pager {
  position: absolute;
  z-index: 2;
  bottom: var(--space-inset-lg);
  left: var(--gutter);
  display: flex;
  align-items: center;
}
.hero__dot {
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-inverse);
  cursor: pointer;
}
.hero__bar {
  display: block;
  width: var(--hero-bar-h);
  height: var(--hero-bar-w);
  background: var(--color-action-inverse);
  opacity: 0.5;
  transition: opacity 200ms ease;
}
.hero__dot:hover .hero__bar { opacity: 0.8; }
.hero__dot[aria-current="true"] .hero__bar { opacity: 1; }

@media (min-width: 1024px) {
  /* The text block is centred between the Figma container top (135) and bottom (33), so it sits at y 295 to 729 in the 922 hero. */
  .hero__inner { justify-content: center; gap: var(--space-gap-lg); padding: var(--hero-pad-top) var(--gutter) var(--hero-pad-bottom); }
  /* Widths in em of their own type size (spec L3a), chosen per slide in ACF (Text width: Narrow, Standard, Wide): the lines break at the
     same words at every width. */
  .hero__headline { max-width: var(--measure-hero-headline); }
  .hero__lead { max-width: var(--measure-hero-lead); }
  .hero__copy--narrow .hero__headline { max-width: var(--measure-hero-headline-narrow); }
  .hero__copy--narrow .hero__lead { max-width: var(--measure-hero-lead-narrow); }
  .hero__copy--wide .hero__headline { max-width: var(--measure-hero-headline-wide); }
  .hero__copy--wide .hero__lead { max-width: var(--measure-hero-lead-wide); }

  /* Vertical pager at the right margin: bars 4 x 34 every 42, 50 above the bottom, bar centre 32 outside the content edge. */
  .hero__pager {
    right: calc(var(--gutter) - var(--hero-pager-outset));
    bottom: calc(var(--hero-pager-bottom) - (var(--tap-min) - var(--hero-bar-h)) / 2);
    left: auto;
    flex-direction: column;
  }
  .hero__dot { margin-block: calc(-1 * var(--border-1-pixel)); }
  .hero__bar { width: var(--hero-bar-w); height: var(--hero-bar-h); }
}

/* No svh support: the earlier fixed heights. */
@supports not (height: 100svh) {
  .hero { min-height: calc(var(--space-section-lg) * 6); }
  @media (min-width: 1024px) { .hero { min-height: var(--hero-h); } }
}
