/* gallery.css */

#gallery-container {
    position: relative;
    width: 100%;
    /* Prend toute la hauteur de la fenêtre pour être parfaitement centré */
    height: 100vh; 
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* On retire le padding qui gênait le centrage */
    padding: 0;
}

.gallery-item {
    position: absolute;
    /* Taille responsive */
    width: min(500px, 65vw);
    aspect-ratio: 1 / 1;
    
    top: 50%;
    left: 50%;
    
    /* ATTENTION : On enlève le background-color ici pour ne pas voir le carré */
    background-color: transparent; 
    
    cursor: pointer;
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* ATTENTION : On enlève le clip-path ici ! */
    
    /* Par défaut caché */
    opacity: 0;
    z-index: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    
    /* C'EST ICI QU'ON MET LA FORME MAINTENANT */
    clip-path: polygon(
        50% 0%, 65% 15%, 85% 15%, 85% 35%, 
        100% 50%, 85% 65%, 85% 85%, 65% 85%, 
        50% 100%, 35% 85%, 15% 85%, 15% 65%, 
        0% 50%, 15% 35%, 15% 15%, 35% 15%
    );
}

/* --- 1. IMAGE ACTIVE (Nette + Contour + Ombre) --- */
.gallery-item.active {
    opacity: 1;
    z-index: 20;
    transform: translate(-50%, -50%) scale(1);
    
    /* 
       1er drop-shadow : Contour Blanc (0 décalage, 0 flou, mais répété pour l'intensité ou léger flou 2px)
       2ème drop-shadow : Ombre Noire portée
    */
    filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 3px #ffffff) drop-shadow(0 20px 30px rgba(0,0,0,0.8));
}

/* --- 2. IMAGE PRÉCÉDENTE (Floue + Léger contour) --- */
.gallery-item.prev {
    opacity: 0.8; /* Un peu plus visible */
    z-index: 10;
    transform: translate(-150%, -50%) scale(0.6);
    
    /* Flou + Contour léger */
    filter: blur(4px) drop-shadow(0 0 2px #ffffff);
}

/* --- 3. IMAGE SUIVANTE (Floue + Léger contour) --- */
.gallery-item.next {
    opacity: 0.8;
    z-index: 10;
    transform: translate(50%, -50%) scale(0.6);
    
    /* Flou + Contour léger */
    filter: blur(4px) drop-shadow(0 0 2px #ffffff);
}

/* --- 4. LES AUTRES (Cachées loin sur les côtés pour l'effet linéaire) --- */

/* Celles qui sont passées partent très loin à gauche */
.gallery-item.off-left {
    opacity: 0;
    z-index: 0;
    transform: translate(-300%, -50%) scale(0.4);
}

/* Celles qui vont arriver attendent très loin à droite */
.gallery-item.off-right {
    opacity: 0;
    z-index: 0;
    transform: translate(200%, -50%) scale(0.4);
}


/* --- LE PETIT "+" --- */
.gallery-item::after {
    content: '+'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); font-size: 0px;
    color: white; background: rgba(0, 0, 0, 0.6); border-radius: 50%;
    width: 60px; height: 60px;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s; pointer-events: none; z-index: 1001;
}
.gallery-item.active:hover::after { font-size: 35px; opacity: 1; }


/* --- ADAPTATION MOBILE --- */
@media (max-width: 768px) {
    /* Sur mobile, on rapproche les images de côté pour qu'on les voie encore */
    .gallery-item.prev {
        transform: translate(-110%, -50%) scale(0.5);
    }
    .gallery-item.next {
        transform: translate(10%, -50%) scale(0.5);
    }
}

/* Lightbox styles (inchangé) */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(26, 26, 80, 0.95); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-img { max-width: 95%; max-height: 80%; border: 2px solid white; }
.lb-btn { position: absolute; color: white; font-size: 40px; cursor: pointer; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 5px; }
.lb-btn:hover { background: rgba(255,153,0, 0.8); }
.lb-prev { left: 10px; } .lb-next { right: 10px; } .lb-close { top: 20px; right: 20px; }