/*
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 === */
/* --- Mise en page générale --- */
/* Conteneur principal du carrousel */
.carrousel {
  position: relative;
  height: 475px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
@media (max-width: 781px) {
  .carrousel {
    height: 200px;
  }
}
/* Piste contenant les slides */
.carrousel-slides {
  position:relative;
  width: 1280px;
  max-width: 100%;
  height: 100%;
}
/* Chaque "slide"*/
.carrousel-slide {
  position: absolute;
  height: 380px;
  inset: 0;                  				/* top:0; right:0; bottom:0; left:0; */
  margin: 0;
  display: flex;
  flex-direction: column;
  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 */
}
@media (max-width: 781px) {
  .carrousel-slide {
    height: 200px;
  }
}
/* L'image à l'intérieur de la slide */
.carrousel-slide .wp-block-image {
  position: absolute;
  inset: 0;  
  margin:  0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.carrousel-slide .wp-block-image img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 380px !important;
  object-fit: contain;
}
@media (max-width: 781px) {
  .carrousel-slide .wp-block-image img {
    max-height: 200px !important;
  }
}
/* Le titre en superposition */
.carrousel-slide h3 {
  position:  relative;
  z-index:  5;
  color: #fff;
  align-self: flex-start;
  text-align: left;
  width:  auto;
  margin: 0 !important;
  margin-top: auto ! important;
  margin-bottom:  10px ! important;
  padding:  8px 16px ! important;
  font-size:  24px;
  font-weight: bold;
  line-height: 1.3;
  background: rgba(0, 0, 0, 0.8);
}
/* La description en superposition */
.carrousel-slide p {
  position: relative;
  z-index: 5;
  color: #fff;
  align-self: flex-start;
  text-align: left;
  width: auto;
  margin: 0 !important;
  margin-bottom: 60px !important;
  padding: 8px 16px !important; 
  font-size: 16px;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.7);
}
@media (max-width: 781px) {
  .carrousel-slide h3 {
    font-size: 18px;
    margin-left: 20px !important;
    margin-right: 20px !important;
    padding: 6px 12px !important;
    padding: 0 20px ! important;
  }
  
  .carrousel-slide p {
    font-size: 14px;
    margin-left: 20px !important;
    margin-right: 20px !important;
    margin-bottom: 50px !important;
    padding: 6px 12px !important;
  }
}
/* Points de navigation */
.carrousel-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.carroussel-points {
  position:  absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}
.carrousel-point {
  margin: 0;
  width:  12px;
  height:  12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease;
}
.carrousel-point:hover {
  background: rgba(255, 255, 255, 0.8);
}
/* --- Auto-défilement par défaut --- */
/* Cycle de fondu : 18s (3 slides × 6s chacune, à adapter) */
.carrousel-slide {
  animation: fadeSlide 12s infinite;
}
/* Slide 1 */
.carrousel-slide:nth-child(1) {
  animation-delay: 0s;
}
/* Slide 2 */
.carrousel-slide:nth-child(2) {
  animation-delay: 4s;
}
/* Slide 3 */
.carrousel-slide:nth-child(3) {
  animation-delay: 8s;
}
/* 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*/
.carrousel:hover .carrousel-slide {
  animation-play-state: paused;
}
/* --- Choix manuel d'une slide --- */
/* Point actif (en fonction du radio coché) */
#slide-1:checked ~ .carroussel-points label[for="slide-1"],
#slide-2:checked ~ .carroussel-points label[for="slide-2"],
#slide-3:checked ~ .carroussel-points label[for="slide-3"] {
  background:  #fff;
}
/* Dès qu'un radio est coché, on coupe l'animation */
#slide-1:checked ~ .carrousel-slide,
#slide-2:checked ~ .carrousel-slide,
#slide-3:checked ~ .carrousel-slide {
  animation: none;
  opacity: 0;
  pointer-events: none;
}
#slide-1:checked ~ .carrousel-slide:nth-child(1) {
  opacity: 1;
  pointer-events: auto;
}
#slide-2:checked ~ .carrousel-slide:nth-child(2) {
  opacity: 1;
  pointer-events: auto;
}
#slide-3:checked ~ .carrousel-slide:nth-child(3) {
  opacity: 1;
  pointer-events: auto;
}