.image-carousel {
  min-width: 0;
  max-width: 100%;
  margin: 1.2em 0 1.6em;
  color: var(--global-text-color, #22261f);
}

.image-carousel__viewport {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border: 1px solid var(--global-border-color, #d8d2c4);
  border-radius: 6px;
  background: var(--global-bg-color, #fff);
}

.image-carousel__viewport::-webkit-scrollbar { display: none; }
.image-carousel__viewport:focus-visible,
.image-carousel__arrow:focus-visible {
  outline: 2px solid var(--global-base-color, #476d8a);
  outline-offset: 2px;
}

.image-carousel__slide {
  display: block;
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}

.image-carousel__frame {
  position: relative;
  width: 100%;
  height: clamp(240px, 55vw, 440px);
  overflow: hidden;
  background: #f7f7f4;
}

.image-carousel__frame img {
  position: absolute;
  inset: 0;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
}

.image-carousel__slide figcaption {
  min-height: 2.8em;
  width: 100%;
  margin: 0;
  padding: .55em .8em;
  color: var(--global-fig-caption-color, #545a4c);
  font-size: .82em;
  line-height: 1.4;
  text-align: center;
}

.image-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin-top: .55em;
}

.image-carousel__arrow {
  display: grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  padding: 0;
  border: 1px solid var(--global-border-color, #d8d2c4);
  border-radius: 50%;
  background: var(--global-bg-color, #fff);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.image-carousel__arrow:hover { border-color: currentColor; }
.image-carousel__count { min-width: 4em; text-align: center; font-size: .8em; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .image-carousel__frame { height: min(80vw, 360px); }
}
