/* =====================================================
   Hi Beirut Marrakech — Page Galerie
   ===================================================== */

/* ---------- Filtres catégorie (partagé avec carte.css — redéfini ici pour autonomie) ---------- */
.filter-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: #3D3D3D;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 22px;
    border-radius: 9999px;
    cursor: pointer;
}

.filter-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.5);
    color: #B8960C;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #D4AF37, #B8960C);
    border-color: #B8960C;
    color: #1A1A1A;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

/* ---------- Grille Masonry ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Motif masonry : variations de hauteur */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(17, 61, 27, 0.06);
    aspect-ratio: 1 / 1;
}

.gallery-item.tall { aspect-ratio: 3 / 4; }
.gallery-item.wide { aspect-ratio: 4 / 3; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.18);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(17, 61, 27, 0.85) 0%, rgba(17, 61, 27, 0.2) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-overlay h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: white;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.gallery-overlay span {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #E8D48B;
}

.gallery-zoom-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
    color: #B8960C;
}

.gallery-item:hover .gallery-zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 20, 15, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 2rem;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(212, 175, 55, 0.3);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    transform: none;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: #D4AF37;
    color: white;
}

.lightbox-caption {
    position: absolute;
    bottom: -3rem;
    left: 0; right: 0;
    text-align: center;
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-style: italic;
}

/* ---------- Insta thumbnails ---------- */
.insta-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.insta-thumb:hover {
    transform: scale(1.04);
}

.insta-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.insta-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(245, 64, 158, 0.6), rgba(255, 201, 58, 0.6));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.insta-thumb:hover::after {
    opacity: 1;
}

.insta-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.insta-thumb:hover .insta-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
