/* ========================================
   GALERIE - Écuries du Neu Près
   ======================================== */

/* --- Filtres --- */
.galerie-filtres {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 3rem;
}

.filtre-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: 2px solid var(--primary-gold);
    background: transparent;
    color: var(--primary-gold);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.filtre-btn:hover,
.filtre-btn.active {
    background: var(--primary-gold);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

/* --- Grille masonry --- */
.galerie-grid {
    columns: 3;
    column-gap: 1.2rem;
    margin: 0 auto;
}

.galerie-item {
    break-inside: avoid;
    margin-bottom: 1.2rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(62, 39, 35, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galerie-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(62, 39, 35, 0.2);
}

.galerie-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.galerie-item:hover img {
    transform: scale(1.05);
}

/* Variantes de taille */
.galerie-item.galerie-large {
    break-inside: avoid;
}

.galerie-item.galerie-large img {
    min-height: 320px;
}

.galerie-item.galerie-tall img {
    min-height: 420px;
}

/* --- Overlay --- */
.galerie-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(62, 39, 35, 0.9) 0%,
        rgba(62, 39, 35, 0.3) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.galerie-item:hover .galerie-overlay {
    opacity: 1;
}

.galerie-overlay-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.galerie-category {
    color: var(--primary-gold);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.galerie-overlay-content h4 {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.3;
}

.galerie-zoom {
    align-self: flex-end;
    width: 38px;
    height: 38px;
    background: var(--primary-gold);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    margin-top: 0.5rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.galerie-zoom:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary-gold);
}

/* --- Items cachés (filtre) --- */
.galerie-item.hidden {
    display: none;
}

.galerie-item.visible {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 8, 0.95);
    backdrop-filter: blur(4px);
}

.lightbox-container {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    background: var(--dark-brown);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.lightbox-content img {
    max-width: 80vw;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.lightbox-info {
    padding: 1.2rem 1.8rem;
    background: var(--dark-brown);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lightbox-cat {
    color: var(--primary-gold);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#lightboxTitle {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin: 0;
}

/* Boutons lightbox */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lightbox-close:hover {
    background: var(--primary-gold);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lightbox-prev { left: 2vw; }
.lightbox-next { right: 2vw; }

.lightbox-nav:hover {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    transform: translateY(-50%) scale(1.1);
}

/* ========================================
   RESPONSIVE GALERIE
   ======================================== */

@media (max-width: 1024px) {
    .galerie-grid {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .galerie-filtres {
        gap: 0.6rem;
    }

    .filtre-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .galerie-grid {
        columns: 2;
        column-gap: 0.8rem;
    }

    .galerie-item {
        margin-bottom: 0.8rem;
    }

    /* Overlay toujours visible sur mobile (pas de hover) */
    .galerie-overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(62, 39, 35, 0.8) 0%,
            transparent 60%
        );
    }

    .galerie-zoom {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .lightbox-content img {
        max-width: 95vw;
        max-height: 65vh;
    }
}

@media (max-width: 480px) {
    .galerie-grid {
        columns: 1;
    }

    .galerie-item.galerie-large img,
    .galerie-item.galerie-tall img {
        min-height: 200px;
    }

    .galerie-filtres {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .filtre-btn {
        flex-shrink: 0;
    }

    .lightbox-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        padding: 1rem;
    }
}
