.home-slideshow {
  position: relative;
  isolation: isolate;
  background: #23171a;
}

.home-slideshow-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.home-slideshow-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Fondu croisé doux entre les deux images */
.home-slideshow-stage.is-ready .home-slide-buffer {
  opacity: 0;
  transform: scale(1.006);
  transition:
    opacity 0.8s cubic-bezier(.22, 1, .36, 1),
    transform 1.05s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.home-slideshow-stage.is-ready .home-slide-buffer.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Éléments décoratifs existants */
.home-slideshow .slash,
.home-slideshow > i {
  z-index: 2;
}

/* Contrôles */
.home-slideshow-controls {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.home-slideshow-controls button {
  min-width: 44px;
  min-height: 44px;
  border: 2px solid #fff;
  background: #171214e8;
  color: #fff;
  font: 900 14px/1 Arial, sans-serif;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px #0005;
}

.home-slideshow-controls button:hover {
  background: #fff;
  color: #171214;
}

.home-slideshow-controls button:focus-visible,
.home-slideshow-dots button:focus-visible {
  outline: 3px solid #f4c400;
  outline-offset: 3px;
}

.home-slideshow-controls .slide-toggle {
  padding: 0 13px;
  min-width: auto;
}

/* Points du diaporama : desktop uniquement */
.home-slideshow-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 5px;
  background: #171214b8;
  border-radius: 999px;
}

.home-slideshow-dots button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.home-slideshow-dots button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff9;
  border: 1px solid #171214;
}

.home-slideshow-dots button[aria-current="true"]::after {
  width: 13px;
  height: 13px;
  background: #f4c400;
  border-color: #f4c400;
}

/* État de chargement */
.home-slideshow[aria-busy="true"] .home-slideshow-controls,
.home-slideshow[aria-busy="true"] .home-slideshow-dots {
  opacity: 0.72;
}

/* Texte uniquement pour lecteurs d’écran */
.home-slideshow .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================
   TABLETTE / SMARTPHONE
   ========================= */

@media (max-width: 800px) {
  .home-slideshow {
    height: clamp(280px, 72vw, 390px);
  }

  /* Sur mobile, on supprime les points :
     les flèches suffisent pour naviguer */
  .home-slideshow-dots {
    display: none !important;
  }

  .home-slideshow-controls {
    right: 10px;
    bottom: 10px;
    gap: 5px;
  }

  .home-slideshow-controls button {
    min-width: 36px;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0;
    border-width: 1px;
    border-radius: 50%;
    font-size: 13px;
    box-shadow: 0 1px 5px #0006;
  }

  /* Le mot Pause devient une icône compacte */
  .home-slideshow-controls .slide-toggle {
    min-width: 36px;
    width: 36px;
    padding: 0;
    font-size: 0;
  }

  .home-slideshow-controls .slide-toggle::before {
    content: "Ⅱ";
    font: 900 13px/1 Arial, sans-serif;
    letter-spacing: -1px;
  }

  /* Quand le diaporama est arrêté,
     on affiche une icône Lecture */
  .home-slideshow-controls .slide-toggle[aria-pressed="true"]::before {
    content: "▶";
    font-size: 12px;
    letter-spacing: 0;
    transform: translateX(1px);
  }
}

/* Très petits smartphones */
@media (max-width: 420px) {
  .home-slideshow-controls {
    right: 8px;
    bottom: 8px;
    gap: 4px;
  }

  .home-slideshow-controls button,
  .home-slideshow-controls .slide-toggle {
    min-width: 34px;
    width: 34px;
    min-height: 34px;
    height: 34px;
  }
}

/* Accessibilité : pas d’animation si l’utilisateur
   préfère réduire les mouvements */
@media (prefers-reduced-motion: reduce) {
  .home-slideshow-stage.is-ready .home-slide-buffer {
    transition: none;
    transform: none;
  }
}