/* =========================================================================
   Component: fm-hero-slider
   Wraps two or more .fm-hero sections and rotates through them.
   Autoplays with an animated progress fill on the active dot.
   ========================================================================= */

.fm-hero-slider {
  position: relative;
  overflow: hidden;
  min-height: 600px;
}

/* Stacked slides */
.fm-hero-slider > .fm-hero {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 550ms var(--fm-ease);
}
.fm-hero-slider > .fm-hero.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* ---------- Controls panel ---------- */
.fm-hero-slider__controls {
  position: absolute;
  z-index: 5;
  bottom: var(--fm-sp-5);
  left: 50%;
  transform: translateX(-50%);
  background: var(--fm-white);
  border-radius: 999px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

@media (min-width: 992px) {
  .fm-hero-slider__controls {
    bottom: var(--fm-sp-6);
    right: 5%;
    left: auto;
    transform: none;
  }
}

/* Pause / play button (two orange bars → triangle when paused) */
.fm-hero-slider__pause {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  cursor: pointer;
  color: var(--fm-accent);
}
.fm-hero-slider__pause::before,
.fm-hero-slider__pause::after {
  content: '';
  width: 3px;
  height: 14px;
  background: currentColor;
  border-radius: 1px;
  transition: all var(--fm-dur-fast) var(--fm-ease);
}
.fm-hero-slider__pause.is-paused::before {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 10px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-radius: 0;
}
.fm-hero-slider__pause.is-paused::after { display: none; }

/* Dots */
.fm-hero-slider__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--fm-gray-200);
  padding: 0;
  cursor: pointer;
  transition: width 350ms var(--fm-ease), background 200ms var(--fm-ease);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.fm-hero-slider__dot.is-active {
  width: 44px; /* elongated pill */
}

/* Progress fill that sweeps left-to-right during the autoplay window */
.fm-hero-slider__dot.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--fm-accent);
  transform: translateX(-100%);
  animation: fm-hero-progress var(--fm-hero-autoplay, 5s) linear forwards;
}

.fm-hero-slider__dot.is-active.is-paused::after {
  animation-play-state: paused;
}

@keyframes fm-hero-progress {
  to { transform: translateX(0); }
}
