/* Native scrolling keeps banners usable before JavaScript and with touch/keyboard. */

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track > * {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
}

.carousel-track a {
  position: relative;
  display: block;
  height: 100%;
}

/* The editor's legacy blocks use img + p inside a link, without caption classes. */
.carousel-track a::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgb(0 0 0 / 72%));
  pointer-events: none;
}

.carousel-track a > p {
  position: absolute;
  z-index: 1;
  inset-inline: 20px;
  bottom: 36px;
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgb(0 0 0 / 45%);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  pointer-events: none;
}

.carousel-track a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.carousel-track img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  bottom: 4px;
  display: flex;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.carousel-dots button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.carousel-dots button::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 8px;
  background: #ffffffa6;
  box-shadow: 0 1px 4px #24334240;
  transition: width .2s, background-color .2s;
}

.carousel-dots button[aria-current="true"]::before {
  width: 18px;
  background: #fff;
}

.carousel-dots button:hover::before {
  background: #fff;
}

.carousel-dots button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .carousel-track a > p {
    inset-inline: 14px;
    bottom: 32px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-dots button::before { transition: none; }
}
