/*
 * The box the slider fills. Its shape comes from the Aspect ratio prop, or —
 * on "Fill parent" — from the element it is dropped into, which then needs a
 * height of its own (an aspect ratio or a fixed height) for the photos to show.
 */

.ofl-image-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ofl-image-carousel.is-fill {
  height: 100%;
}

/* A single photo renders without the slider. */
.ofl-image-carousel > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ofl-image-carousel > .ofl-canvas-placeholder {
  box-sizing: border-box;
  height: 100%;
}

/*
 * Card image carousel (ImageSlider.tsx). The values are the Swiper slider's it
 * replaced — Swiper's navigation/pagination defaults with the card overrides
 * (20px white chevrons 8px in from the sides; 12px white dots 2px apart, 8px
 * up from the bottom, pink when active) — so the card looks exactly as before.
 *
 * max-width + min-width cap the root's intrinsic width (all slides side by
 * side), which would otherwise stretch the card and break the page layout.
 */

.ofl-image-slider {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.ofl-image-slider-viewport {
  height: 100%;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.ofl-image-slider-track {
  display: flex;
  height: 100%;
}

.ofl-image-slider-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.ofl-image-slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ofl-image-slider-button {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 20px;
  height: 20px;
  margin: -10px 0 0;
  padding: 0;
  border: 0;
  background: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}

.ofl-image-slider-button svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.ofl-image-slider-button.is-prev {
  left: 8px;
}

.ofl-image-slider-button.is-prev svg {
  transform: rotate(180deg);
}

.ofl-image-slider-button.is-next {
  right: 8px;
}

/* Inline-block dots in a text-aligned row, as Swiper lays them out, so they
   sit on the same baseline (and the same distance from the bottom edge). */
.ofl-image-slider-pagination {
  position: absolute;
  bottom: 8px;
  left: 0;
  z-index: 10;
  width: 100%;
  text-align: center;
}

.ofl-image-slider-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 2px;
  padding: 0;
  border: none;
  border-radius: 50%;
  box-shadow: none;
  appearance: none;
  background: #fff;
  cursor: pointer;
}

.ofl-image-slider-dot.is-active {
  background: var(--ofl-pink, #ff41f2);
}

.ofl-image-slider-button:focus-visible,
.ofl-image-slider-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--ofl-purple, #7938b4);
}

/*
 * Canvas-only stand-in for CMS-driven components. Takes its colour from the
 * surrounding text, like the campaign badge placeholder, so it reads on light
 * and dark sections alike without a palette of its own.
 */

.ofl-canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 16px;
  border: 1px dashed currentColor;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0.5;
}

.ofl-canvas-placeholder.is-inline {
  display: inline;
  min-height: 0;
  padding: 0 4px;
  font-size: inherit;
  line-height: inherit;
}

