/* --- 1. CONFIGURATION GLOBALE & VERROUILLAGE SCROLL --- */
/* C'EST CE BLOC QUI MANQUAIT POUR BLOQUER LE SCROLL : */
html.stop-scrolling, body.stop-scrolling {
    overflow: hidden !important;
    height: 100% !important;
    touch-action: none !important; /* Bloque le tactile */
    overscroll-behavior: none !important; /* Bloque le rebond élastique */
}

* {
    hyphens: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    box-sizing: border-box;
}

/* --- 2. HEADER DU SHOOTING --- */
.project-header { 
    padding: 120px 20px 60px; 
    text-align: center; 
    background: #000; 
}

.project-cat { 
    color: var(--accent); 
    text-transform: uppercase; 
    letter-spacing: 4px; 
    font-size: 0.8rem; 
    font-weight: 700; 
}

.project-title { 
    font-size: clamp(2rem, 5vw, 4rem); 
    margin-top: 10px; 
    color: #fff; 
    text-transform: uppercase;
    line-height: 1.1;
}

/* --- 3. GRILLE DU SHOOTING (3 COLONNES PC) --- */
.gallery-container { 
    padding: 0 20px 100px; 
    max-width: 1600px; 
    margin: 0 auto;
}

.gallery-masonry {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.gallery-item {
    cursor: zoom-in;
    background: #0a0a0a;
    overflow: hidden;
    position: relative;
    /* 3 colonnes sur PC */
    flex: 1 1 calc(33.333% - 10px); 
    max-width: calc(33.333% - 10px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
}

.gallery-item img[src] { opacity: 1; }
.gallery-item:hover img { transform: scale(1.05); }

/* --- 4. LIGHTBOX (CUT & NO SCROLL) --- */
.lightbox-ui {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    
    /* BLOQUAGE TOTAL DU SCROLL & REBOND MOBILE */
    overflow: hidden; 
    touch-action: none; 
    overscroll-behavior: none;
}

.lightbox-ui.active { display: flex; }

/* Bouton Fermer */
.lightbox-close {
    position: absolute; top: 20px; right: 30px;
    font-size: 40px; color: #fff; cursor: pointer; z-index: 10010;
    opacity: 0.7; font-weight: 100;
}

/* Zone Principale */
.lightbox-main-area {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; width: 100%; padding: 10px 0;
}

/* IMAGE PRINCIPALE (SANS ANIMATION) */
.lightbox-img {
    max-width: 90%; 
    max-height: 80vh;
    object-fit: contain;
    
    /* C'EST ICI LA CORRECTION MOBILE */
    opacity: 1 !important; /* On force l'image à être toujours visible */
    transition: none !important; /* Pas d'animation */
    
    /* Empêche l'image de faire 0px de haut pendant le chargement */
    min-width: 50px; 
    min-height: 50px;
    
    user-select: none;
}

/* Flèches PC */
.lightbox-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 60px; color: #fff; cursor: pointer; opacity: 0.5;
    padding: 30px; z-index: 10005; font-weight: 100; user-select: none;
}
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }
.lightbox-arrow:hover { opacity: 1; }

/* BANDEAU MINIATURES */
.lightbox-thumbnails {
    height: 100px; width: 100%;
    background: rgba(10, 10, 10, 0.9);
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    overflow-x: auto; scroll-behavior: auto; /* Scroll rapide */
    border-top: 1px solid #333;
    scrollbar-width: none;
}
.lightbox-thumbnails::-webkit-scrollbar { display: none; }

/* MINIATURES (ENTIÈRES & SANS BORDURES) */
.thumb-item {
    height: 100%; width: auto;
    object-fit: contain; /* Affiche l'image entière */
    cursor: pointer; opacity: 0.4; transition: 0.2s;
}
.thumb-item:hover { opacity: 0.8; }

/* Miniature Active */
.thumb-item.active {
    opacity: 1; 
    border: none;
}

/* --- 5. RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    /* GRILLE : Passage en 2 colonnes (Important qui manquait) */
    .gallery-item {
        flex: 1 1 calc(50% - 7.5px);
        max-width: calc(50% - 7.5px);
    }
    
    .project-header { padding-top: 140px; padding-bottom: 30px; }
    .project-title { font-size: 1.8rem !important; }

    /* LIGHTBOX MOBILE */
    .lightbox-arrow { display: none !important; }
    .lightbox-img { max-height: 70vh; }
    .lightbox-thumbnails { height: 70px; padding: 5px; gap: 5px; }
    .lightbox-close { top: 10px; right: 15px; font-size: 30px; }
}