/**
 * Styles pour le Bloc Galerie d'Images
 * Mode Masonry avec colonnes dynamiques
 */

.bloc-galerie-images {
    width: 100%;
    padding: 40px 0;
}

.galerie-masonry {
    column-count: 3;
    column-gap: 20px;
    padding: 0 20px;
}

.galerie-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galerie-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.galerie-item a {
    display: block;
    position: relative;
    border-bottom: none!important
}

.galerie-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.galerie-item:hover img {
    transform: scale(1.05);
}

/* Responsive - Tablettes */
@media screen and (max-width: 1024px) {
    .galerie-masonry {
        column-count: 2;
        column-gap: 15px;
        padding: 0 15px;
    }
    
    .galerie-item {
        margin-bottom: 15px;
    }
}

/* Responsive - Mobile */
@media screen and (max-width: 640px) {
    .bloc-galerie-images {
        padding: 20px 0;
    }
    
    .galerie-masonry {
        column-count: 1;
        column-gap: 0;
        padding: 0 10px;
    }
    
    .galerie-item {
        margin-bottom: 10px;
    }
}

/* Support pour les navigateurs plus anciens */
@supports not (column-count: 3) {
    .galerie-masonry {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .galerie-item {
        width: calc(33.333% - 14px);
        margin-bottom: 20px;
    }
    
    @media screen and (max-width: 1024px) {
        .galerie-item {
            width: calc(50% - 10px);
        }
    }
    
    @media screen and (max-width: 640px) {
        .galerie-item {
            width: 100%;
        }
    }
}

/* Lightbox */
.galerie-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.galerie-lightbox.active {
    display: block;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 10px 15px;
    transition: background 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 50px;
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 4px;
    max-width: 80%;
}

@media screen and (max-width: 640px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 35px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: 5px 10px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-caption {
        font-size: 14px;
        padding: 8px 15px;
    }
}
