.oa-carousel {
  --oa-card-width: 44%;
  --oa-gap: 16px;
  position: relative;
  width: 100%;
  max-width: 100%;
  isolation: isolate;
  direction: ltr;
}

.oa-carousel .oa-carousel__track {
  display: flex;
  gap: var(--oa-gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 24px 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  perspective: 1000px;
}

.oa-carousel__track::before,
.oa-carousel__track::after {
  flex: 0 0 calc((100% - var(--oa-card-width)) / 2 - var(--oa-gap));
  content: "";
}

.oa-carousel__track::-webkit-scrollbar {
  display: none;
}

.oa-carousel .oa-carousel__slide {
  flex: 0 0 var(--oa-card-width);
  min-width: 0;
  scroll-snap-align: center;
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.oa-carousel .oa-carousel__video {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  color: #fff;
  background: #161616;
  text-decoration: none;
}

.oa-carousel .oa-carousel__video img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.oa-carousel__play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(0 0 0 / 65%);
  transform: translate(-50%, -50%);
}

.oa-carousel__play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.oa-carousel .oa-carousel__arrow,
.oa-carousel .oa-carousel__dot,
.oa-carousel .oa-carousel__close {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  color: #fff;
  background: rgb(0 0 0 / 75%);
  cursor: pointer;
  line-height: 1;
}

.oa-carousel .oa-carousel__arrow {
  position: absolute;
  top: calc(50% - 44px);
  z-index: 2;
}

.oa-carousel__arrow--previous {
  left: 8px;
}

.oa-carousel__arrow--next {
  right: 8px;
}

.oa-carousel__arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.oa-carousel .oa-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.oa-carousel .oa-carousel__dot {
  color: #a1a1a1;
  background: transparent;
}

.oa-carousel__dot::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.oa-carousel .oa-carousel__dot[aria-current="true"] {
  color: #282828;
}

.oa-carousel .oa-carousel__video:focus-visible,
.oa-carousel .oa-carousel__track:focus-visible,
.oa-carousel .oa-carousel__arrow:focus-visible,
.oa-carousel .oa-carousel__dot:focus-visible,
.oa-carousel .oa-carousel__close:focus-visible {
  outline: 3px solid #1673b8;
  outline-offset: 3px;
}

.oa-carousel .oa-carousel__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.oa-carousel .oa-carousel__dialog {
  position: fixed;
  inset: 0;
  width: min(960px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 72px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: #000;
}

.oa-carousel__dialog::backdrop {
  background: rgb(0 0 0 / 88%);
}

.oa-carousel .oa-carousel__dialog:not([open]) {
  display: none;
}

.oa-carousel .oa-carousel__close {
  position: absolute;
  top: -48px;
  right: 0;
  z-index: 1;
  font-family: sans-serif;
  font-size: 32px;
}

.oa-carousel__player {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 100px);
}

.oa-carousel__player iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
}

@media (max-width: 767px) {
  .oa-carousel {
    --oa-card-width: 82%;
    --oa-gap: 10px;
  }

  .oa-carousel .oa-carousel__track {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .oa-carousel .oa-carousel__arrow {
    top: calc(50% - 44px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .oa-carousel .oa-carousel__slide {
    transition: none;
  }
}
