.editorial-carousel {
  --editorial-carousel-accent: #2eabff;
  margin: 24px 0;
  min-width: 0;
  width: 100%;
}

.editorial-carousel__viewport {
  border: 1px solid #262634;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}

.editorial-carousel__track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.editorial-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.editorial-carousel--hero .editorial-carousel__slide {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editorial-carousel--hero .editorial-carousel__slide > a {
  aspect-ratio: 16 / 9;
  background: #0c0f1d;
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
}

.editorial-carousel--hero .editorial-carousel__slide img {
  display: block;
  height: 100%;
  margin: 0;
  max-width: none;
  object-fit: contain;
  user-select: none;
  width: 100%;
  -webkit-user-drag: none;
}

.editorial-carousel__caption {
  background: #151723;
  color: #c9ccd6;
  flex: 1 0 auto;
  font-size: 14px;
  line-height: 1.55;
  padding: 14px 18px 16px;
}

.editorial-carousel__caption > :first-child {
  margin-top: 0;
}

.editorial-carousel__caption > :last-child {
  margin-bottom: 0;
}

.editorial-carousel__navigation {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.editorial-carousel--hero .editorial-carousel__navigation {
  aspect-ratio: 16 / 9;
  bottom: auto;
}

.editorial-carousel__arrow {
  align-items: center;
  backdrop-filter: blur(6px);
  background: rgba(12, 15, 29, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 27px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  z-index: 1;
}

.editorial-carousel__arrow:hover {
  background: rgba(12, 15, 29, 0.9);
}

.editorial-carousel__arrow--previous {
  left: 12px;
}

.editorial-carousel__arrow--next {
  right: 12px;
}

.editorial-carousel__controls {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 14px;
}

.editorial-carousel__controls[hidden] {
  display: none !important;
}

.editorial-carousel__count {
  color: #858ba0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.editorial-carousel__dots {
  align-items: center;
  display: flex;
  gap: 6px;
}

.editorial-carousel__dot {
  background: #585d6d;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  height: 5px;
  padding: 0;
  transition: background 0.25s ease, width 0.25s ease;
  width: 18px;
}

.editorial-carousel__dot[aria-current="true"] {
  background: var(--editorial-carousel-accent);
  width: 40px;
}

.editorial-carousel__autoplay {
  background: none;
  border: 0;
  box-sizing: border-box;
  color: #aeb2c1;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  inline-size: 96px;
  justify-self: end;
  line-height: 1;
  min-height: 24px;
  padding: 4px 0;
  white-space: nowrap;
}

.editorial-carousel__autoplay:hover {
  color: #fff;
}

.editorial-carousel button:focus-visible,
.editorial-carousel a:focus-visible {
  outline: 3px solid var(--editorial-carousel-accent);
  outline-offset: 3px;
}

.editorial-carousel--ad {
  margin: 0;
}

.editorial-carousel--ad .editorial-carousel__viewport {
  border: 0;
  border-radius: 6px;
}

.editorial-carousel--ad .editorial-carousel__controls {
  display: flex;
  justify-content: center;
  margin: 6px 0 0;
}

@media (max-width: 640px) {
  .editorial-carousel--hero .editorial-carousel__arrow {
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
    bottom: 0;
    font-size: 34px;
    height: auto;
    padding: 0 12px 3px;
    top: 0;
    transform: none;
    width: clamp(58px, 20%, 84px);
  }

  .editorial-carousel--hero .editorial-carousel__arrow--previous,
  .editorial-carousel--hero .editorial-carousel__arrow--previous:hover {
    background: linear-gradient(90deg, rgba(7, 9, 17, 0.52), rgba(7, 9, 17, 0));
    justify-content: flex-start;
    left: 0;
  }

  .editorial-carousel--hero .editorial-carousel__arrow--next,
  .editorial-carousel--hero .editorial-carousel__arrow--next:hover {
    background: linear-gradient(270deg, rgba(7, 9, 17, 0.52), rgba(7, 9, 17, 0));
    justify-content: flex-end;
    right: 0;
  }

  .editorial-carousel__caption {
    font-size: 13px;
    padding: 12px 14px 14px;
  }

  .editorial-carousel__autoplay {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-carousel__track,
  .editorial-carousel__dot {
    transition: none;
  }
}
