/**
 * nxhero — hero advert slideshow. Original work, Nexus Labs 2026.
 * The file name carries .rN (Cloudflare caches by URL): bump NxHero::ASSET_REV and rename on every change.
 *
 * Box: aspect-ratio 1920/800 (desktop + tablet), 1080/1350 at <=767px, so an ad made to spec is never cropped
 * and the page does not shift while it loads. The soft bottom fade (140px, 90px on phones) is a mask on
 * .nx-hero__track only: the ad fades into whatever is behind the section; controls sit outside the mask.
 * Swiper's own CSS comes from the theme (nx-swiper); the rules marked "fallback" keep the first slide showing
 * as a still image if Swiper is missing.
 */
.nx-hero {
  --nx-hero-fade: 140px;
  --nx-hero-accent: var(--nx-accent, #8eb364);
  --nx-hero-focus: var(--nx-amber, #f5b800);
  --nx-hero-ink: var(--nx-text-strong, #f2f2f2);
  --nx-hero-bar: rgba(10, 10, 10, .55);
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  isolation: isolate;
}

.nx-hero__track {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 800;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--nx-hero-fade)), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 calc(100% - var(--nx-hero-fade)), transparent 100%);
}

/* swipe off (1.1.0 default): the page still scrolls vertically over the slideshow and zooms normally */
.nx-hero--no-swipe .nx-hero__track {
  touch-action: pan-y pinch-zoom;
}

/* fallback (no Swiper): a flex row, only the first slide is in view */
.nx-hero .swiper-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
}
.nx-hero .nx-hero__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.nx-hero__link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.nx-hero__link:focus-visible {
  outline: 3px solid var(--nx-hero-focus);
  outline-offset: -3px;
}
.nx-hero__picture,
.nx-hero__img {
  display: block;
  width: 100%;
  height: 100%;
}
.nx-hero__img {
  max-width: none;
  object-fit: cover;
  object-position: center;
}

/* controls: one pill at the bottom centre, inside the faded band (the ad spec keeps that band free of text) */
.nx-hero__controls {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--nx-hero-bar);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: var(--nx-hero-ink);
}
.nx-hero:not(.nx-hero--ready) .nx-hero__controls {
  display: none;
}
.nx-hero__arrow,
.nx-hero__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.nx-hero__toggle[hidden] {
  display: none;
}
.nx-hero__arrow:hover,
.nx-hero__toggle:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
.nx-hero__arrow:focus-visible,
.nx-hero__toggle:focus-visible,
.nx-hero__dot:focus-visible {
  outline: 3px solid var(--nx-hero-focus);
  outline-offset: 2px;
}
.nx-hero__arrow.swiper-button-disabled {
  opacity: .35;
  cursor: default;
}
.nx-hero__toggle .nx-hero__icon-play,
.nx-hero__toggle.is-paused .nx-hero__icon-pause {
  display: none;
}
.nx-hero__toggle.is-paused .nx-hero__icon-play {
  display: block;
}

.nx-hero .nx-hero__dots {
  position: static;
  display: flex;
  align-items: center;
  gap: 2px;
  width: auto;
  margin: 0;
  transform: none;
}
/* Swiper renders the bullets as <button class="nx-hero__dot"> (bulletElement + bulletClass in nxhero.js) */
.nx-hero__dot {
  position: relative;
  width: 28px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nx-hero__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 999px;
  background: rgba(245, 245, 245, .55);
  transition: width .25s ease, margin .25s ease, background-color .25s ease;
}
.nx-hero__dot:hover::before {
  background: #fff;
}
.nx-hero__dot.is-active::before {
  width: 22px;
  margin-left: -11px;
  background: var(--nx-hero-accent);
}

/* preview page only: status tag on scheduled / ended / off slides */
.nx-hero__status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 3px;
  background: #f59e0b;
  color: #111;
  font: 600 12px/1.4 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nxhero-preview__note {
  margin: 12px 16px;
  font-size: 14px;
  opacity: .8;
}
/* preview page: full-bleed like the CE hero, whatever the theme's boxed container does */
body.nxhero-preview {
  overflow-x: hidden;
}
body.nxhero-preview .nx-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}

@media (max-width: 767px) {
  .nx-hero {
    --nx-hero-fade: 90px;
  }
  .nx-hero__track {
    aspect-ratio: 1080 / 1350;
  }
  .nx-hero__controls {
    bottom: 14px;
    gap: 2px;
  }
  .nx-hero__arrow,
  .nx-hero__toggle {
    width: 34px;
    height: 34px;
  }
  .nx-hero__dot {
    width: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nx-hero .swiper-wrapper,
  .nx-hero .swiper-slide {
    transition-duration: 0ms !important;
  }
  .nx-hero__dot::before {
    transition: none;
  }
}

/* smoke transition (r5, data-effect="smoke"): nxhero.js adds this canvas inside the track (so the bottom fade masks
   it too) and shows it only while a change runs; underneath, Swiper crossfades as the fallback */
.nx-hero__smoke {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  visibility: hidden;
}
.nx-hero__smoke.is-on {
  visibility: visible;
}
