/*=================================== SECTION HERO ==================================*/

#hero {
    background-image: url('../img/gallery_BG.webp');
    background-size: cover;
    background-position: center;
}

.hero__container {
    flex-direction: column;
    gap: var(--size-xl);
    width: 100%;
    color: var(--color-white);
    padding: var(--size-7xl) var(--size-5xl);
}

@media (max-width: 768px) {
    .hero__container {
        padding: var(--size-7xl) var(--size-lg);
    }
}

/*=================================== SECTION GALLERY ==================================*/

.gallery__container {
    flex-direction: column;
    gap: var(--size-3xl);
}

.gallery__category {
    display: flex;
    flex-direction: column;
    gap: var(--size-3xl);
}

.gallery__images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 colonnes par défaut */
    gap: var(--size-sm);
}

.gallery__images img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 3/2;
    cursor: pointer;
}

/* Animation au survol */
.gallery__images img:hover {
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
}

/* ===================================== Lightbox ===================================== */

.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
}

.gallery-lightbox__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--size-2xl);
    max-width: var(--display-desktop);
    width: 100%;
    height: 100%;
    padding: var(--size-5xl);
    box-sizing: border-box;
}

.gallery-lightbox__title {
    color: var(--color-white);
}

.gallery-lightbox__image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0 !important;
}

/* Empêche l’image d’être sélectionnée et d’avoir un effet bleu au clic */
.gallery-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    transition: opacity 0.3s ease-in-out;
    user-select: none;
    /* Empêche la sélection */
    pointer-events: auto;
    /* Permet les interactions normales */
    -webkit-user-drag: none;
    /* Empêche le drag sur WebKit */
}

.gallery-lightbox__controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    width: 100%;
    padding: var(--size-xl);
}

.gallery-lightbox__prev {
    transform: rotate(90deg);
}

.gallery-lightbox__next {
    transform: rotate(-90deg);
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
    width: var(--size-2xl);
    height: var(--size-2xl);
    cursor: pointer;
    filter: invert(1);
    transition: transform 0.3s ease;
}

.gallery-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: var(--size-2xl);
    height: var(--size-2xl);
    cursor: pointer;
    filter: invert(1);
    transition: transform 0.3s ease;
}

.gallery-lightbox__close:hover {
    transform: scale(1.2);
}

.gallery-lightbox.show {
    display: flex;
}

/* Empêcher le défilement du fond quand la lightbox est ouverte */
body.lightbox-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .gallery-lightbox__content {
        gap: 0;
        padding: var(--size-5xl) var(--size-lg);
    }
}