.inlayers-editorial-gallery-carousel {
  position: relative;
  width: calc(100% - (2 * var(--wp--custom--layout--gutter)));
  max-width: none;
  margin-block: 0 clamp(5rem, 12vw, 12rem);
  margin-inline: auto !important;
}

.inlayers-editorial-gallery-carousel__viewport {
  overflow: hidden;
}

.inlayers-editorial-gallery-carousel__track {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  align-items: stretch;
  will-change: transform;
}

.inlayers-editorial-gallery-carousel__slide {
  position: relative;
  flex: 0 0 calc(
    (100% - ((var(--inlayers-carousel-visible, 3) - 1) * clamp(0.75rem, 1.5vw, 1.5rem))) /
      var(--inlayers-carousel-visible, 3)
  );
  aspect-ratio: 4 / 5;
  margin: 0;
  background: var(--wp--preset--color--accent);
}

.inlayers-editorial-gallery-carousel__slide img,
.inlayers-editorial-gallery-carousel__slide video {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}

.inlayers-editorial-gallery-carousel__slide video {
  background: var(--wp--preset--color--border) url("../images/video-placeholder.svg") center / cover no-repeat;
}

.inlayers-editorial-gallery-carousel__control {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 4vw, 3.75rem);
  height: clamp(2.75rem, 4vw, 3.75rem);
  padding: 0;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 50%;
  color: var(--wp--preset--color--foreground);
  background: color-mix(in srgb, var(--wp--preset--color--background) 88%, transparent);
  font: inherit;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    color 200ms ease,
    background-color 200ms ease;
}

.inlayers-editorial-gallery-carousel__control--previous {
  left: clamp(0.5rem, 1.5vw, 1.5rem);
}

.inlayers-editorial-gallery-carousel__control--next {
  right: clamp(0.5rem, 1.5vw, 1.5rem);
}

.inlayers-editorial-gallery-carousel__control:hover {
  color: var(--wp--preset--color--background);
  background: var(--wp--preset--color--foreground);
}

.inlayers-editorial-gallery-carousel__control:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent-dark);
  outline-offset: 3px;
}

.inlayers-editorial-gallery-carousel__control[hidden] {
  display: none;
}

.inlayers-editorial-gallery-carousel--card {
  width: 100%;
  margin-block: clamp(1.5rem, 3vw, 3rem) 0;
}

.inlayers-editorial-gallery-carousel--card
  .inlayers-editorial-gallery-carousel__slide {
  aspect-ratio: 16 / 9;
}

@media (prefers-reduced-motion: reduce) {
  .inlayers-editorial-gallery-carousel__track,
  .inlayers-editorial-gallery-carousel__control {
    transition: none !important;
  }
}
