/* =========================================
   1. EN-TÊTE DE LA GALERIE (.gallery-project-page__header)
   ========================================= */
.gallery-project-page__header {
    /* Conteneur virtuel pour faciliter le placement si besoin, 
       actuellement les marges sont sur les éléments enfants */
    opacity: 1;
}

.gallery-project-page__title {
    margin-top: 200px; /* Décalage pour le header fixe */
    margin-bottom: -30px;
    margin-left: 150px;
    font-size: 60px;
}

.gallery-project-page__description {
    padding: 0px 150px;
    font-size: 16px;
}

/* =========================================
   2. GRILLE MASONRY (.gallery-grid)
   ========================================= */
.gallery-grid {
    column-count: 4;
    column-gap: 10px;
    padding: 0px 150px;
    max-width: 1400px;
    margin: 75px auto;
}

/* Élément individuel (créé en JS) */
.gallery-grid__item {
    break-inside: avoid;
    margin-bottom: 10px;
    background-color: transparent; 
    border-radius: 1px; 
    overflow: hidden; 
}

/* L'image elle-même */
.gallery-grid__img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0; 
    transform: translateY(50px) scale(0.1); 
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
    cursor: pointer;
}

/* Classe ajoutée par JS quand chargée */
.gallery-grid__img--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery-grid__img:hover {
    box-shadow: 0 0 30px rgb(255, 255, 255);
    filter: brightness(0.5);
}

/* Responsive Masonry */
@media (max-width: 1024px) { .gallery-grid { column-count: 3; } }
@media (max-width: 768px) { .gallery-grid { column-count: 2; column-gap: 10px; padding: 10px; } }
@media (max-width: 480px) { .gallery-grid { column-count: 1; } }


/* =========================================
   3. LIGHTBOX (MODALE) (.gallery-lightbox)
   ========================================= */
.gallery-lightbox {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: none; 
}

.gallery-lightbox--active {
    visibility: visible;
    opacity: 1;
}

.gallery-lightbox__img {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    border-radius: 4px;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform: scale(0.9);}
    to {transform: scale(1);}
}

/* =========================================
   4. CONTRÔLES LIGHTBOX 
   ========================================= */
/* Bouton Fermer */
.gallery-lightbox__close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1005;
    line-height: 40px;
}
.gallery-lightbox__close-btn:hover { color: #bbb; }

/* Bouton Partager */
.gallery-lightbox__share-btn {
    position: absolute;
    top: 25px; 
    right: 80px; 
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1005;
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.gallery-lightbox__share-btn svg { width: 20px; height: 20px; }
.gallery-lightbox__share-btn:hover { background-color: rgba(255, 255, 255, 0.4); transform: scale(1.1); }

/* Flèches Navigation */
.gallery-lightbox__nav-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    user-select: none;
    z-index: 1002;
}

.gallery-lightbox__nav-btn--next { right: 0; border-radius: 3px 0 0 3px; }
.gallery-lightbox__nav-btn--prev { left: 0; border-radius: 3px 0 0 3px; }
.gallery-lightbox__nav-btn:hover { background-color: rgba(0, 0, 0, 0.8); }

/* =========================================
   5. MODALE DE PARTAGE (.gallery-share-modal)
   ========================================= */
.gallery-share-modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
    z-index: 2000; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    color: #333;
}

.gallery-share-modal--active {
    display: block;
    animation: popIn 0.3s ease;
}

.gallery-share-modal__title { margin-top: 0; margin-bottom: 20px; font-size: 18px; }

.gallery-share-modal__options { display: flex; flex-direction: column; gap: 10px; }

.gallery-share-modal__option {
    display: block;
    padding: 12px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
}

/* Couleurs des réseaux */
.gallery-share-modal__option--fb { background: #3b5998; color: white; }
.gallery-share-modal__option--x { background: #000; color: white; }
.gallery-share-modal__option--wa { background: #25D366; color: white; }
.gallery-share-modal__option--copy { background: #f0f0f0; color: #333; border: 1px solid #ccc; }

.gallery-share-modal__option:hover { opacity: 0.85; }

.gallery-share-modal__close-btn {
    margin-top: 20px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Ajustements Mobile */
@media (max-width: 600px) {
    .gallery-lightbox__share-btn { right: 60px; top: 20px; width: 35px; height: 35px; }
    .gallery-lightbox__close-btn { right: 15px; }
    .gallery-lightbox__nav-btn { font-size: 20px; padding: 10px; }
}

@media (max-width: 768px) {
    .gallery-project-page__title {
        margin-left: 0;          /* On annule le grand décalage sur le côté */
        padding: 0 10px;         /* On applique les 10px de padding sur les côtés */
        width: 100%;             /* S'assure de prendre toute la largeur */
        box-sizing: border-box;  /* Empêche le padding de faire déborder l'élément */
    }

    .gallery-project-page__description {
        padding: 0 10px;         /* Remplace les 150px par tes 10px de padding */
        width: 100%;             /* S'assure de prendre toute la largeur */
        box-sizing: border-box;
    }
}

/* --- Animations de Slide (Gérées par JS) --- */
@keyframes slideInRight {
    from { transform: translateX(500px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-500px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-next { animation: slideInRight 0.3s ease-out; }
.slide-prev { animation: slideInLeft 0.3s ease-out; }