/* --- STYLE SPÉCIFIQUE À LA PAGE RÉALISATIONS --- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background-color: #f0f0f0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* Icône de loupe au survol */
.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* --- LIGHTBOX (SYSTÈME DE ZOOM) --- */
#lightbox-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none; /* Caché par défaut */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur petit mobile */
    }
    .gallery-item {
        height: 200px;
    }
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Empêche le recalcul constant du layout */
    aspect-ratio: 4 / 3; 
    /* Améliore la vitesse de rendu */
    content-visibility: auto; 
    transition: transform 0.3s ease;
}