/* ── Shared carousel base ─────────────────────────────────
   Common styling for any kokoto carousel (image or features).
   Variant files (carousel.css, features-carousel.css) layer on
   element-specific rules (img sizing, text slide layout, …).

   Scoped to .carousel so it only touches Bootstrap carousels.
   Variant rules use their own modifier class (.c-img, .c-text)
   so two carousels can live on one page.
────────────────────────────────────────────────────────── */

:root {
  --carousel-control-width: 14%;
  --carousel-control-icon-size: 1.75rem;
  --carousel-indicator-size: 12px;
  --carousel-indicator-icon-size: 0.45rem;
  --carousel-backdrop-color: transparent;
  --carousel-fade-duration: 1.1s;
  --carousel-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --carousel-indicators-margin: 12px;
  --carousel-fg: #ffffff;
}

/* Per-instance light/dark modifiers — apply whichever matches the
   background the carousel sits on. */

.carousel.c-dark {
  --carousel-fg: #ffffff;
}

.carousel.c-light {
  --carousel-fg: #1a1a1a;
}

.carousel {
  width: 100%;
  --bs-carousel-transition-duration: var(--carousel-fade-duration);
}

.carousel-inner {
  overflow: hidden;
  background-color: var(--carousel-backdrop-color);
}

/* Carousel item base — variants set their own height. */

.carousel-item {
  position: relative;
  background-color: var(--carousel-backdrop-color);
  transition: transform var(--carousel-fade-duration) var(--carousel-transition-easing);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transform: translateZ(0);
}

.carousel-item-next:not(.carousel-item-start), .carousel-item-prev:not(.carousel-item-end), .active.carousel-item-start, .active.carousel-item-end {
  opacity: 1;
}

/* ── Controls ─────────────────────────────────────────── */

.carousel-control-prev-icon, .carousel-control-next-icon {
  display: none;
}

.c-arrow {
  font-size: var(--carousel-control-icon-size);
  color: var(--carousel-fg);
}

.carousel-control-prev, .carousel-control-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--carousel-control-width);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
  transition: opacity 0.25s ease;
}

.carousel-control-prev {
  justify-content: flex-start;
}

.carousel-control-next {
  justify-content: flex-end;
}

.carousel-control-prev:hover, .carousel-control-next:hover {
  opacity: 0.75;
}

/* ── Indicators ───────────────────────────────────────── */

.carousel-indicators {
  flex-wrap: wrap;
  justify-content: center;
  background-color: transparent;
}

.carousel-indicators [data-bs-target] {
  width: var(--carousel-indicator-size);
  height: var(--carousel-indicator-size);
  background: transparent !important;
  background-image: none !important;
  border: none;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  opacity: 0.4;
  padding: 0;
  margin: 0 4px;
  text-indent: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 0.25s ease;
}

.carousel-indicators [data-bs-target]:focus, .carousel-indicators [data-bs-target]:focus-visible {
  outline: none;
  box-shadow: none;
}

.carousel-indicators .active {
  opacity: 1;
}

.c-dot {
  font-size: var(--carousel-indicator-icon-size);
  line-height: 1;
  color: var(--carousel-fg);
  display: block;
}

.c-dot-f {
  display: none;
}

.carousel-indicators .active .c-dot-o {
  display: none;
}

.carousel-indicators .active .c-dot-f {
  display: block;
}

/* While sliding, dim every dot and show the outline icon so
   only the slide that's fully in frame stays highlighted. */

.carousel.c-busy .carousel-indicators [data-bs-target] {
  opacity: 0.4;
}

.carousel.c-busy .carousel-indicators .active .c-dot-o {
  display: block;
}

.carousel.c-busy .carousel-indicators .active .c-dot-f {
  display: none;
}

/* ── Below-slide indicator option ─────────────────────────
   Add class="c-dots-below" to the carousel to move the dots
   beneath the slide with a margin.
────────────────────────────────────────────────────────── */

.carousel.c-dots-below {
  display: flex;
  flex-direction: column;
}

.carousel.c-dots-below .carousel-inner {
  order: 1;
  position: relative;
}

.carousel.c-dots-below .carousel-indicators {
  order: 2;
  position: static;
  margin: var(--carousel-indicators-margin) 0 0;
  justify-content: center;
}

.carousel.c-dots-below .carousel-control-prev, .carousel.c-dots-below .carousel-control-next {
  top: 0;
  bottom: calc(var(--carousel-indicators-margin) + var(--carousel-indicator-size));
  height: auto;
}

/* Hide Bootstrap's default caption overlay — our carousels keep text
   in dedicated slides (features carousel) or omit it entirely (images). */

.carousel-caption {
  display: none;
}

/* ── Per-instance visibility modifiers ───────────────────
   Add .c-no-arrows and/or .c-no-dots to a .carousel to suppress
   the arrows or dots on that instance.
────────────────────────────────────────────────────────── */

.carousel.c-no-arrows .carousel-control-prev, .carousel.c-no-arrows .carousel-control-next {
  display: none;
}

.carousel.c-no-dots .carousel-indicators {
  display: none;
}

/* When indicators are hidden in below-mode, drop the reserved space
   so controls return to full height. */

.carousel.c-dots-below.c-no-dots .carousel-control-prev, .carousel.c-dots-below.c-no-dots .carousel-control-next {
  bottom: 0;
}

/* ── Responsive sizing — Bootstrap breakpoints ──────────── */

/* sm — ≥576px */

@media (min-width: 576px) {
  :root {
    --carousel-control-icon-size: 2rem;
    --carousel-indicator-size: 14px;
    --carousel-indicator-icon-size: 0.5rem;
  }
}

/* md — ≥768px */

@media (min-width: 768px) {
  :root {
    --carousel-control-width: 10%;
    --carousel-control-icon-size: 2.5rem;
    --carousel-indicator-size: 16px;
    --carousel-indicator-icon-size: 0.6rem;
  }
}

/* lg — ≥992px */

@media (min-width: 992px) {
  :root {
    --carousel-control-icon-size: 3rem;
  }
}

/* xl — ≥1200px */

@media (min-width: 1200px) {
  :root {
    --carousel-control-width: 8%;
  }
}

/* xxl — ≥1400px */

@media (min-width: 1400px) {
  :root {
    --carousel-control-icon-size: 3.5rem;
  }
}

