/* =========================================================
   PAGINA REALIZZAZIONI / GALLERIA
   ========================================================= */

.gallery-page {
    padding: 92px 0 110px;
    background: #fff;
}


/* =========================================================
   INTRODUZIONE
   ========================================================= */

.gallery-intro {
    margin-bottom: 46px;
    max-width: 760px;
    padding-bottom: 0;
    border-bottom: 0;
}

.gallery-intro h1 {
    margin: 0 0 16px;
    max-width: 800px;
}

.gallery-intro p {
    margin: 0;
    max-width: 760px;
    color: var(--gray);
    font-size: 1.08rem;
    line-height: 1.6;
}


/* =========================================================
   FILTRI CATEGORIE
   ========================================================= */

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 34px 0 42px;
}

.gallery-filter {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--black);
    padding: 11px 19px;

    font-family: "Montserrat", Arial, sans-serif;
    font-size: .78rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .03em;

    cursor: pointer;
    transition: .2s ease;
}

.gallery-filter:hover,
.gallery-filter.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}


/* =========================================================
   GALLERIA MASONRY
   ========================================================= */

.gallery-masonry {
    columns: 2 420px;
    column-gap: 26px;
}


/* =========================================================
   SINGOLA FOTO
   ========================================================= */

.gallery-card {
    break-inside: avoid;
    margin: 0 0 48px;
    display: inline-block;
    width: 100%;
    cursor: pointer;
}


/* =========================================================
   CONTENITORE IMMAGINE
   ========================================================= */

.gallery-image {
    min-height: 360px;

    background: #ececec;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    position: relative;
}


/* Formati diversi per creare movimento nella pagina */

.gallery-card--large .gallery-image {
    min-height: 500px;
}

.gallery-card--wide .gallery-image {
    min-height: 420px;
}

.gallery-image--portrait {
    min-height: 500px;
}


/* =========================================================
   IMMAGINI REALI
   ========================================================= */

.gallery-image img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;

    transition: transform .35s ease;
}


/* Leggero effetto al passaggio del mouse */

.gallery-card:hover .gallery-image img {
    transform: scale(1.025);
}


/* =========================================================
   PLACEHOLDER
   ========================================================= */

.gallery-image span {
    font-size: .72rem;
    letter-spacing: .16em;
    font-weight: 800;
    color: #777;
    text-transform: uppercase;
}


/* =========================================================
   INFORMAZIONI SOTTO LA FOTO
   ========================================================= */

.gallery-card-info {
    padding: 16px 2px 0;
}

.gallery-category {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--red);
}

.gallery-card-info h2 {
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;

    margin: 6px 0 0;

    line-height: 1.15;
}


/* Nasconde gli elementi esclusi dal filtro */

.gallery-card[hidden] {
    display: none;
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

.gallery-lightbox {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, .92);

    z-index: 9999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 50px;
}

.gallery-lightbox.open {
    display: flex;
}


/* Contenitore della foto ingrandita */

.gallery-lightbox-content {
    max-width: min(1100px, 90vw);
    max-height: 85vh;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* Immagine lightbox */

.gallery-lightbox-image {
    width: 100%;
    height: 100%;

    min-height: 0 !important;

    background: #222;
    color: #fff;
}

.gallery-lightbox-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* =========================================================
   CONTROLLI LIGHTBOX
   ========================================================= */

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: fixed;

    border: 0;
    background: none;

    color: #fff;

    cursor: pointer;

    font-size: 42px;
    line-height: 1;

    z-index: 2;
}

.gallery-lightbox-close {
    top: 18px;
    right: 28px;
}

.gallery-lightbox-prev {
    left: 24px;
    top: 50%;

    transform: translateY(-50%);
}

.gallery-lightbox-next {
    right: 24px;
    top: 50%;

    transform: translateY(-50%);
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .gallery-page {
        padding: 65px 0 75px;
    }

    .gallery-intro {
        margin-bottom: 36px;
    }

    .gallery-intro h1 {
        margin-bottom: 14px;
    }

    .gallery-intro p {
        font-size: 1rem;
    }

    .gallery-filters {
        margin: 28px 0 34px;
    }

    .gallery-filter {
        padding: 10px 15px;
        font-size: .72rem;
    }

    .gallery-masonry {
        columns: 1;
    }

    .gallery-image,
    .gallery-card--large .gallery-image,
    .gallery-card--wide .gallery-image,
    .gallery-image--portrait {
        min-height: 330px;
    }

    .gallery-card {
        margin-bottom: 38px;
    }

    .gallery-lightbox {
        padding: 25px;
    }

    .gallery-lightbox-prev {
        left: 8px;
    }

    .gallery-lightbox-next {
        right: 8px;
    }

    .gallery-lightbox-close {
        top: 12px;
        right: 15px;
        font-size: 34px;
    }
}