/* ==========================================================================
   IBRA stats band
   Full bleed, because it reads as a continuation of the banner above it
   rather than as a section in its own right.
   ========================================================================== */

.ibra-stats {
  position: relative;
  isolation: isolate;
  background: var(--band-bg, #7E1220);
  color: var(--band-ink, #fff);
  padding-block: var(--band-pad, 30px);
  overflow: hidden;
}

/* A flat fill of a deep colour looks like a swatch. A wide, soft highlight
   rising from the centre gives the band a light source and keeps the
   figures sitting in the brightest part of it. */
.ibra-stats::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 140% at 50% 0%,
      rgba(255, 255, 255, .14) 0%,
      rgba(255, 255, 255, .04) 38%,
      transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .1));
}

/* A hairline along the top edge, where the band meets the banner */
.ibra-stats::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, .28) 20%,
    rgba(255, 255, 255, .28) 80%,
    transparent);
}

.ibra-stats__inner {
  max-width: var(--ibra-max, 1240px);
  margin-inline: auto;
  padding-inline: var(--ibra-gutter, 1rem);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: 24px;
}

.ibra-stats__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

/* Rules that fade at both ends, rather than a hard line butting into the
   band's edges. */
.ibra-stats.has-rules .ibra-stats__item + .ibra-stats__item::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 64%;
  background: linear-gradient(180deg,
    transparent,
    color-mix(in srgb, var(--band-ink, #fff) 34%, transparent) 25%,
    color-mix(in srgb, var(--band-ink, #fff) 34%, transparent) 75%,
    transparent);
}

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
  .ibra-stats.has-rules .ibra-stats__item + .ibra-stats__item::before {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .34) 25%,
                rgba(255, 255, 255, .34) 75%, transparent);
  }
}

/* Type ------------------------------------------------------------------ */

.ibra-stats__value {
  display: block;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--band-ink, #fff);
  /* Tabular figures stop the width jumping as the counter runs */
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.ibra-stats__label {
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .02em;
  color: color-mix(in srgb, var(--band-ink, #fff) 82%, transparent);
}

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
  .ibra-stats__label { opacity: .82; }
}

/* Reveal -----------------------------------------------------------------
   The band arrives one figure after another rather than all at once. The
   guard class means nothing is hidden unless the script is running, so a
   failed script cannot leave the band blank. */

.ibra-stats.is-ready .ibra-stats__item {
  opacity: 0;
  transform: translateY(10px);
}

.ibra-stats.is-ready.is-in .ibra-stats__item {
  opacity: 1;
  transform: none;
  transition:
    opacity .5s ease,
    transform .6s cubic-bezier(.2, .7, .3, 1);
  transition-delay: calc(var(--i, 0) * 110ms);
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 767px) {
  .ibra-stats__inner {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 16px;
  }
  .ibra-stats.has-rules .ibra-stats__item + .ibra-stats__item::before { display: none; }
}

@media (max-width: 420px) {
  .ibra-stats__inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ibra-stats.is-ready .ibra-stats__item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}