/* =========================================
   PORTFOLIO MASONRY
   ========================================= */

/* La Grille Magique (Sans JS) */
.masonry-grid {
    column-count: 3; /* 3 Colonnes sur Desktop */
    column-gap: 20px;
}

/* L'élément */
.masonry-item {
    break-inside: avoid; /* Empêche de couper une image en deux */
    margin-bottom: 20px;
}

/* La Carte Photo */
.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #eee; /* Placeholder gris pendant chargement */
}

.gallery-card img {
    width: 100%;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s ease;
}

/* Overlay au survol */
.gallery-card .overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-card .overlay i {
    color: white;
    font-size: 2rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* Animation Hover */
.gallery-card:hover img {
    transform: scale(1.05);
}
.gallery-card:hover .overlay {
    opacity: 1;
}
.gallery-card:hover .overlay i {
    transform: scale(1);
}

/* Responsive */
@media (max-width: 992px) {
    .masonry-grid { column-count: 2; }
}
@media (max-width: 576px) {
    .masonry-grid { column-count: 1; }
}

/* =========================================
   LIGHTBOX CUSTOM
   ========================================= */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-caption {
    color: #fff;
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
}

/* Boutons Lightbox */
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 20px;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    color: var(--bs-primary);
}

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