.fotogenic-scope .ad-story__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--fotogenic-title-intro-gap);
  width: calc(100% - 64px);
  max-width: 1280px;
  margin-inline: auto;
  margin-bottom: var(--fotogenic-content-gap);
}

.ad-story__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.fotogenic-scope .ad-story__title {
  margin: 0;
  text-align: center;
}

.ad-story__title span {
  display: block;
  width: fit-content;
  margin-inline: auto;
  color: #462bd0;
  background: linear-gradient(105deg, #ae087f 4%, #7727d6 48%, #1163e8 98%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ad-story__intro {
  --fg-section-intro-margin: 0;
  --fg-section-intro-color: #4d5264;
  --fg-section-intro-width: 46ch;
  --fg-section-intro-weight: 500;
  text-wrap: balance;
}

/* The unenhanced gallery remains usable without scripting. */
.ad-story__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 16px;
  width: calc(100% - 44px);
  max-width: 1400px;
  margin-inline: auto;
}

.ad-story__figure {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
}

.fotogenic-scope .ad-story__image {
  display: block;
  width: 100%;
  height: auto;
  contain-intrinsic-size: none;
  object-fit: contain;
}

.ad-story__shade {
  display: none;
}

.ad-story.is-ready .ad-story__stage {
  position: relative;
  height: min(820px, 82svh, var(--ad-story-fit-height, 80vw));
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.ad-story.is-ready .ad-story__stage:active {
  cursor: grabbing;
}

.ad-story.is-ready .ad-story__track {
  display: block;
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  touch-action: pan-y pinch-zoom;
  perspective: 1400px;
}

.ad-story.is-ready .ad-story__figure {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 0;
  transform-origin: center;
  backface-visibility: hidden;
  user-select: none;
}

.ad-story.is-ready .ad-story__image {
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* One optional video follows the settled original slide. Decorative copies
   remain image-only, and the poster stays visible until playback succeeds. */
.ad-story.is-ready .ad-story__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
}

.ad-story.is-ready .ad-story__video[data-playback="playing"] {
  opacity: 1;
}

.ad-story.is-ready .ad-story__shade {
  display: block;
  position: absolute;
  inset: 0;
  background: #0b1019;
  pointer-events: none;
}

@media (min-width: 768px) {
  .ad-story.is-ready .ad-story__stage::before,
  .ad-story.is-ready .ad-story__stage::after {
    content: '';
    position: absolute;
    z-index: 2;
    inset-block: 0;
    width: clamp(32px, 8vw, 170px);
    pointer-events: none;
  }

  .ad-story.is-ready .ad-story__stage::before {
    inset-inline-start: 0;
    background: linear-gradient(90deg, #fff, #ffffff00);
  }

  .ad-story.is-ready .ad-story__stage::after {
    inset-inline-end: 0;
    background: linear-gradient(270deg, #fff, #ffffff00);
  }
}

.ad-story__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #4d5264;
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.ad-story__arrow svg {
  pointer-events: none;
}

.ad-story__arrow:hover {
  color: #121212;
  background-color: #f1f0f5;
}

.ad-story__navigation {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  width: calc(100% - 32px);
  max-width: calc(var(--ad-story-count) * 80px + 112px);
  margin: 24px auto 0;
}

.ad-story__progress {
  position: relative;
  justify-content: flex-start;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.ad-story__progress .editorial-hero__step {
  flex: 1 0 44px;
  min-width: 44px;
}

.ad-story__progress .editorial-hero__step.is-current > span {
  background: #925bfa38;
}

.ad-story__progress::-webkit-scrollbar {
  display: none;
}

.ad-story__navigation[hidden] {
  display: none;
}

.ad-story__navigation .editorial-hero__pause:focus-visible {
  right: auto;
  bottom: 52px;
}

.ad-story__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ad-story__progress button:focus-visible {
  outline: 3px solid #462bd0;
  outline-offset: -3px;
}

.ad-story__stage:focus-visible {
  outline: 3px solid #462bd0;
  outline-offset: -3px;
}

.ad-story__arrow:focus-visible {
  outline: 3px solid #462bd0;
  outline-offset: 4px;
}

@media (max-width: 1024px) {
  .fotogenic-scope .ad-story__header {
    width: calc(100% - 40px);
  }
}

@media (max-width: 767px) {
  .ad-story:not(.is-ready) .ad-story__stage {
    overflow-x: auto;
  }

  .ad-story:not(.is-ready) .ad-story__track {
    width: calc(100% - 28px);
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc(100% - 20px);
    gap: 12px;
  }

  .ad-story.is-ready .ad-story__stage {
    height: var(--ad-story-fit-height, 120vw);
  }

  .ad-story__navigation {
    column-gap: 4px;
  }

  .ad-story__progress {
    gap: 0;
  }

  .ad-story__progress .editorial-hero__step {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-story__arrow {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ad-story__title span {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }

  .ad-story__arrow {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }
}
