/*
Theme Name: WPMS - IRIHS
Theme URI: 
Author: Pole Numérique - IRIHS
Author URI: 
Description: 
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 5.7
Version: 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: neve-fse
Text Domain: wpms-irihs
Tags: 
*/

/* === Carrousel Gutenberg === */

/* Conteneur principal du carrousel */
.carrousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  height: 380px;
}
@media (max-width: 781px) {
  .carrousel {
    height: 260px;
  }
}
/* Piste contenant les slides */
.carrousel-images {
  position:relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
}
/* Chaque "slide" = chaque figure */
.carrousel-images > figure {
  position: absolute;
  inset: 0;                  				/* top:0; right:0; bottom:0; left:0; */
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;  					/* on ne clique pas à travers */
  transition: opacity 1s ease-in-out; 	/* durée du fondu */
}
/* Slide visible */
.carrousel .carrousel-images > figure.is-active {
  opacity: 1;
  pointer-events: auto;
}
/* L'image à l'intérieur de la slide */
.carrousel-images img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height:  100%;
  object-fit: contain;
}
/* Flèches */
.carrousel-precedent,
.carrousel-suivant {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-size: 20px;
  line-height: 1;
}

.carrousel-precedent { left: 23px; }
.carrousel-suivant   { right: 23px; }

.carrousel-precedent:hover,
.carrousel-suivant:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* --- MODE AUTO (CSS uniquement) --- */
/* Durée totale du cycle : 18s (3 slides × 6s chacune, à adapter) */
.carrousel:not(.is-manual) .carrousel-images > figure {
  animation: fadeSlide 18s infinite;
}
/* Slide 1 */
.carrousel:not(.is-manual) .carrousel-images > figure:nth-child(1) {
  animation-delay: 0s;
}
/* Slide 2 */
.carrousel:not(.is-manual) .carrousel-images > figure:nth-child(2) {
  animation-delay: 6s;
}
/* Slide 3 */
.carrousel:not(.is-manual) .carrousel-images > figure:nth-child(3) {
  animation-delay: 12s;
}
/* Keyframes de fondu :
   - 0–5%   : fade in
   - 5–30%  : visible
   - 30–35% : fade out
   - 35–100%: invisible
   (appliqué avec un décalage différent pour chaque slide)
*/
@keyframes fadeSlide {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  30%  { opacity: 1; }
  35%  { opacity: 0; }
  100% { opacity: 0; }
}
/* Pause au survol (desktop) */
.carrousel:hover .carrousel-images {
  animation-play-state: paused;
}

/* --------- MODE MANUEL (après clic flèche) --------- */
.carrousel.is-manual .carrousel-images > figure {
  animation: none;                            /* on coupe l'auto */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;      /* fondu manuel */
}
.carrousel.is-manual .carrousel-images > figure.is-active {
  opacity: 1;
  pointer-events: auto;
}


