/*
 * Homepage sections.
 * Loaded only on the front page. Composed from tokens.css.
 */

/* ---------------------------------------------------------------
 * Hero
 * --------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(100svh, 56rem);
  padding-block: calc(var(--header-h) + var(--space-9)) var(--space-9);
  color: var(--color-text-invert);
  text-align: center;
}

.hero__video,
.hero .backdrop__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * Width is what sets the line breaks here, and the design breaks this headline
 * once: "...GREATEST SPORTING / MOMENTS BECOME YOURS". 20ch was far too narrow
 * and shattered it into five lines.
 *
 * text-wrap is pretty, not balance. Balance would even the two lines out into
 * a different break from the one that was drawn; pretty only guards against a
 * single word being left alone on the last line.
 */
.hero__title {
  max-width: 68rem;
  margin-inline: auto;
  font-size: var(--fs-hero);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps-tight);
  line-height: var(--lh-display);
  text-transform: uppercase;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

/* ---------------------------------------------------------------
 * Feature trio: two photographs flanking a linked panel
 * --------------------------------------------------------------- */

.trio {
  padding-block: var(--section-y) 0;
}

/*
 * Three linked cards. The design shows the middle one with its overlay
 * revealed: that is the hover state, so all three share it.
 */
.trio__card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1000 / 1042;
  padding: var(--space-6);
  overflow: hidden;
  color: var(--color-text-invert);
  text-align: center;
  text-decoration: none;
  isolation: isolate;
}

.trio__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}

.trio__card:hover img,
.trio__card:focus-visible img {
  transform: scale(1.04);
}

/*
 * Two scrims on one pseudo-element, cross-faded by opacity.
 *
 * At rest a flat wash, enough to hold the white title at AA and no more, so
 * the photograph still reads. On hover a centre-weighted gradient takes over:
 * the copy sits in the middle, so the darkening is concentrated there and the
 * corners keep their picture. A flat scrim heavy enough for the 16px orange
 * cue turned the whole image to mud.
 */
.trio__card .backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim-card-rest);
  transition: opacity var(--dur-slow) var(--ease);
}

.trio__card .backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background:
    radial-gradient(
      ellipse 75% 55% at 50% 50%,
      rgba(7, 9, 11, 0.9) 0%,
      rgba(7, 9, 11, 0.82) 55%,
      rgba(7, 9, 11, 0.55) 100%
    ),
    var(--scrim-card);
  transition: opacity var(--dur-slow) var(--ease);
}

.trio__card:hover .backdrop::before,
.trio__card:focus-visible .backdrop::before {
  opacity: 1;
}

.trio__card-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trio__card-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps);
  line-height: var(--lh-heading);
  text-transform: uppercase;
}

/*
 * The cue is the only part that waits for hover. The title stays put: a card
 * whose label appears on hover has no label at all on a phone, and no
 * accessible name for anything that is not a mouse.
 */
.trio__card-cue {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  color: var(--color-accent);
  font-size: var(--fs-btn);
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.trio__card:hover .trio__card-cue,
.trio__card:focus-visible .trio__card-cue {
  opacity: 1;
  transform: none;
}

.trio__card-cue .btn__arrow {
  transition: transform var(--dur) var(--ease);
}

.trio__card:hover .trio__card-cue .btn__arrow {
  transform: translateX(0.25em);
}

/*
 * Touch has no hover, so there is no state to reveal. Show the finished card
 * rather than leaving a permanently half-rendered one.
 */
@media (hover: none) {
  .trio__card .backdrop::before {
    opacity: 1;
  }

  .trio__card-cue {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------
 * Introduction: statistics and copy, with an image bleeding off the right
 * --------------------------------------------------------------- */

.intro {
  padding-block: var(--section-y);
}

/*
 * The design runs the photograph off the right edge of the page. This is a
 * full-width grid whose left column is padded to line up with the container,
 * rather than a container with a negatively-margined child.
 *
 * The negative-margin version (margin-right: calc(50% - 50vw)) resolves its
 * percentage against the grid cell, not the container, so it overshot by
 * 328px and pushed real horizontal overflow onto every width above 1024.
 * Nothing here is ever wider than 100%, so it cannot overflow at all.
 */
.intro__grid {
  display: grid;
  align-items: center;
  gap: var(--space-8) var(--space-9);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding-left: max(var(--gutter), (100% - var(--container)) / 2);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-8);
  margin: 0 0 var(--space-7);
  padding: 0;
}

.stat {
  margin: 0;
}

/*
 * Regular, not light. Measured against the design, these numerals carry
 * noticeably more ink than Gill Sans Light gives: 6.1% coverage over the
 * figure block versus 5.0% at weight 300.
 */
.stat__value {
  display: block;
  font-size: var(--fs-stat);
  font-weight: var(--fw-regular);
  line-height: 1;
}

/*
 * Width set in em rather than ch so it tracks the label's own size. This is
 * what decides where each label wraps, and the design wraps two of the three.
 */
.stat__label {
  display: block;
  max-width: 10.5em;
  margin-top: var(--space-3);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-caps-tight);
  line-height: var(--lh-heading);
  text-transform: uppercase;
}

.intro__body {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
}

.intro__actions {
  margin-top: var(--space-6);
}

/*
 * The design runs this image off the right edge of the page rather than
 * stopping at the container. Anchoring to the viewport keeps that true at
 * every width instead of only at 1440.
 */
.intro__media {
  position: relative;
  aspect-ratio: 1500 / 1107;
}

.intro__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 800px) {
  .intro__grid {
    grid-template-columns: 1fr;
    padding-right: var(--gutter);
  }

  .intro__media {
    /* Stacked, the bleed reads as a mistake rather than a device. */
    margin-right: calc(var(--gutter) * -1);
    order: -1;
  }
}

/* ---------------------------------------------------------------
 * Featured event band
 * --------------------------------------------------------------- */

.feature-band {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 34rem;
  padding-block: var(--section-y);
  color: var(--color-text-invert);
}

/*
 * A directional scrim rather than a flat one. All the type sits on the left,
 * and the Augusta photograph is brightest on the right, so a flat scrim heavy
 * enough for the orange eyebrow would have needlessly flattened the picture.
 * Measured: the eyebrow was 1.99:1 in the worst 5% of its background against
 * a 3.0 requirement.
 */
.feature-band::after {
  background: linear-gradient(
    90deg,
    rgba(7, 9, 11, 0.88) 0%,
    rgba(7, 9, 11, 0.8) 40%,
    rgba(7, 9, 11, 0.45) 75%,
    rgba(7, 9, 11, 0.3) 100%
  );
}

.feature-band__content {
  max-width: 46rem;
}

.feature-band__title {
  margin-bottom: var(--space-5);
  font-size: var(--fs-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-display);
}

.feature-band__body {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
}

.feature-band__actions {
  margin-top: var(--space-7);
}

/* ---------------------------------------------------------------
 * Event grid, with the brand dot pattern
 * --------------------------------------------------------------- */

.event-grid {
  position: relative;
  padding-block: var(--section-y);
}

/*
 * The dot pattern from the brand sheet, sitting behind the top-right corner
 * of the grid. Decorative, so it is hidden from assistive tech and dropped
 * entirely on narrow screens where there is no room for it to read as texture.
 */
.event-grid__pattern {
  position: absolute;
  top: 0;
  right: 0;
  width: min(22rem, 30vw);
  height: 11rem;
  background-image: radial-gradient(var(--sgh-charcoal) 1.5px, transparent 1.6px);
  background-size: 17px 17px;
  pointer-events: none;
}

@media (max-width: 900px) {
  .event-grid__pattern {
    display: none;
  }
}

.event-grid__inner {
  position: relative;
  z-index: 1;
}
