/*
Theme Name: Fais et ris... aussi !
Theme URI: https://example.com/
Author: Ton Nom
Author URI: https://example.com/
Description: Thème WordPress léger et responsive pour les anniversaires d'enfants et d'ados.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fais-et-ris
*/


/* === CAROUSEL === */
.carousel-container {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    padding-left: calc(1vw + 40px); /* espace pour la photo ronde */
    box-sizing: border-box; /* important pour inclure le padding dans la largeur */
}

.carousel-slides {
  display: flex;
  transition: transform 0.8s ease;
}

.carousel-slide {
  min-width: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  position: relative;
}

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

.carousel-slide img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255,255,255,0.6);
  border: none;
  cursor: pointer;
  font-size: 2rem;
  padding: 8px 12px;
  border-radius: 50%;
  z-index: 2;
  transition: background 0.3s ease;
}

.carousel-btn:hover {
  background-color: rgba(255,255,255,0.9);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-dots {
  text-align: center;
  position: absolute;
  bottom: 10px;
  width: 100%;
  z-index: 3;
}

.carousel-dots button {
  height: 12px;
  width: 12px;
  margin: 0 4px;
  background-color: rgba(255,255,255,0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-dots button.active {
  background-color: var(--accent-red);
}

@media (max-width:768px) {
  .carousel-slide img { height: 220px; }
  .carousel-btn { font-size: 1.5rem; }
  .carousel-container {
        padding-left: calc(25vw + 20px);
    }
}

@media (max-width: 480px) {
    .carousel-container {
        padding-left: calc(35vw + 15px);
    }
}


/* === Correction d'affichage du carrousel === */


.carousel-slides {
  display: flex;
  transition: transform 0.6s ease;
  width: 100%;
}

.carousel-slide {
  min-width: 100%;
  flex: 0 0 100%;
  display: none;
  justify-content: center;
  align-items: center;
}

.carousel-slide.active {
    display: block; /* ou flex si tu veux centrer verticalement */
    box-sizing: border-box; /* IMPORTANT pour que padding ne dépasse pas */
    padding: 30px; /* padding uniforme */
    margin: 0 auto;
    max-width: 100%;
    overflow: hidden; /* sécurité */
}

@media (max-width: 768px) {
    .carousel-slide.active {
        padding: 15px; /* réduit le padding sur mobile */
    }
}


.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #ccc;
  cursor: pointer;
}

.carousel-dots button.active {
  background: #333;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.6);
  border: none;
  font-size: 24px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 2;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.page-carousel .overlay h2 {
  margin: 0;
  font-size: 1.8rem;
  font-family: var(--font-title, 'Comic Sans MS', cursive);
}
.page-carousel .overlay p {
  font-size: 1rem;
  margin-top: 8px;
}
.page-carousel .overlay a.btn:hover {
  background: #007bff;
}

.page-carousel .carousel-dots {
  position: relative;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  margin: 15px 0;
  gap: 8px;
}

.page-carousel .carousel-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s;
}

.page-carousel .carousel-dots button.active {
  background: #ff5252;
}

/* Supprime les flèches si elles existent encore */
.page-carousel .carousel-btn {
  display: none;
}

.carousel-slide {
  display: none; /* Les slides inactives sont cachées */
}

.carousel-slide.active {
  display: block; /* Slide actif visible */
}




/* === OVERLAY === */
.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.image-wrapper .overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: inherit;
}

.image-wrapper:hover .overlay {
    opacity: 1;
}

.image-wrapper .overlay a {
    color: #fff;
    font-weight: bold;
    font-size: 1.5rem;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}
