.hero-carousel {
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.hero-carousel__viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 10 / 7;
  border-radius: 0.5rem;
  background: var(--md-default-bg-color);
  box-shadow: rgba(0, 0, 0, 0.15) 0 5px 15px 0;
  overflow: hidden;
  touch-action: pan-y;
  outline: none;
}

.hero-carousel__viewport:focus-visible {
  box-shadow:
    0 0 0 3px var(--md-primary-fg-color--light, #5c6bc0),
    rgba(0, 0, 0, 0.15) 0 5px 15px 0;
}

.hero-carousel__viewport img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.hero-carousel.is-switching .hero-carousel__viewport img,
.hero-carousel.is-switching .hero-carousel__caption {
  opacity: 0;
}

.hero-carousel.is-loading .hero-carousel__viewport {
  cursor: progress;
}

.hero-carousel__caption {
  width: 100%;
  min-height: 2.8rem;
  margin-top: 0.75rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
  transition: opacity 0.18s ease;
}

.hero-carousel__control {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--md-default-fg-color);
  background: color-mix(in srgb, var(--md-default-bg-color) 84%, transparent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.hero-carousel__control:hover,
.hero-carousel__control:focus-visible {
  background: var(--md-default-bg-color);
  transform: translateY(-50%) scale(1.04);
}

.hero-carousel__control--prev {
  left: 0.75rem;
}

.hero-carousel__control--next {
  right: 0.75rem;
}

.hero-carousel__indicators {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.hero-carousel__indicator {
  position: relative;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.hero-carousel__indicator::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  background: #d1d5db;
  content: "";
  transform: translate(-50%, -50%);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.hero-carousel__indicator:hover::after,
.hero-carousel__indicator:focus-visible::after {
  transform: translate(-50%, -50%) scale(1.18);
}

.hero-carousel__indicator.is-active::after {
  background: var(--md-primary-fg-color, #3f51b5);
  transform: translate(-50%, -50%) scale(1.22);
}

@media (max-width: 700px) {
  .hero-carousel__viewport {
    max-width: 100%;
    aspect-ratio: 4 / 3;
  }

  .hero-carousel__control {
    width: 2rem;
    height: 2rem;
    font-size: 1.35rem;
  }

  .hero-carousel__control--prev {
    left: 0.5rem;
  }

  .hero-carousel__control--next {
    right: 0.5rem;
  }
}
