﻿/* PAGE */

.gallery-page {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    padding: 80px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.gallery-title {
    font-family: "Playfair Display", serif;
    font-size: 42px;
    margin-bottom: 40px;
    text-align: center;
}

/* FILTERS */

.gallery-filters {
    text-align: center;
    margin-bottom: 40px;
}

.filter-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    margin: 0 10px;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .3s;
}

    .filter-btn.active {
        border-color: #000;
        font-weight: 600;
    }

/* GRID */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.gallery-item {
    display: block;
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity .4s ease, transform .4s ease;
}

    .gallery-item.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .gallery-item.hide {
        opacity: 0;
        pointer-events: none;
    }

    /* Fade individuale */
    .gallery-item.fade-out {
        opacity: 0 !important;
        transform: translateY(20px);
    }

    .gallery-item.fade-in {
        opacity: 1 !important;
        transform: translateY(0);
    }


/* LIGHTBOX */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 9999;
}

    .gallery-lightbox.active {
        opacity: 1;
        pointer-events: auto;
    }

.lightbox-inner {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

    .lightbox-inner img {
        max-width: 100%;
        max-height: 100%;
        display: block;
        border-radius: 6px;
    }

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

.lb-image {
    max-width: 90vw !important;
    max-height: 90vh !important;
    object-fit: contain;
}

/* RESPONSIVE */

@media (max-width: 768px) {
    .gallery-page {
        padding: 60px 15px;
    }

    .gallery-title {
        font-size: 32px;
    }
}
