/* ==========================================================================
   ACP-SG
   PÁGINA GALERIA
   ========================================================================== */


/* ==========================================================================
   VARIÁVEIS LOCAIS
   ========================================================================== */

.gallery-page {

    --gallery-green: var(--cor-primaria);
    --gallery-green-dark: var(--cor-agua-escura);
    --gallery-teal: var(--cor-agua);

    --gallery-bg: var(--cor-fundo);
    --gallery-bg-soft: var(--cor-fundo-claro);

    --gallery-text: #263c35;
    --gallery-text-soft: #60716c;

    --gallery-border: rgba(38, 60, 53, .11);

    width: 100%;

    overflow: hidden;

    background: var(--gallery-bg);

    color: var(--gallery-text);
}


/* ==========================================================================
   CONTAINER
   ========================================================================== */

.gallery-page .container {

    width: min(1240px, calc(100% - 80px));

    margin-inline: auto;
}


/* ==========================================================================
   HERO
   ========================================================================== */

.gallery-hero {

    position: relative;

    padding: 76px 0 62px;

    background:
        linear-gradient(
            135deg,
            rgba(238, 246, 242, .96),
            rgba(255, 255, 255, .99)
        );

    border-bottom:
        1px solid rgba(38, 60, 53, .06);
}


.gallery-hero__content {

    max-width: 900px;

    margin-inline: auto;

    text-align: center;
}


/* ==========================================================================
   LABEL DO HERO
   ========================================================================== */

.gallery-hero__label {

    display: inline-flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 17px;

    color: var(--gallery-green-dark);

    font-size: .69rem;

    font-weight: 800;

    letter-spacing: .2em;

    line-height: 1.4;

    text-transform: uppercase;
}


.gallery-hero__label::before,
.gallery-hero__label::after {

    content: "";

    width: 28px;

    height: 2px;

    background: var(--gallery-teal);
}


/* ==========================================================================
   TÍTULO
   ========================================================================== */

.gallery-hero h1 {

    margin: 0;

    color: var(--gallery-green);

    font-size: clamp(2.8rem, 5vw, 4.7rem);

    font-weight: 800;

    letter-spacing: -.045em;

    line-height: 1;
}


/* ==========================================================================
   DESCRIÇÃO
   ========================================================================== */

.gallery-hero p {

    max-width: 760px;

    margin: 22px auto 0;

    color: var(--gallery-text-soft);

    font-size: 1.05rem;

    line-height: 1.75;
}


/* ==========================================================================
   CONTEÚDO DA GALERIA
   ========================================================================== */

.gallery-content {

    padding: 68px 0 100px;

    background: var(--gallery-bg);
}


/* ==========================================================================
   GRADE DE FOTOS
   ========================================================================== */

.gallery-grid {

    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 30px 18px;
}


/* ==========================================================================
   ITEM
   ========================================================================== */

.gallery-item {

    min-width: 0;

    margin: 0;
}


/* ==========================================================================
   IMAGEM
   ========================================================================== */

.gallery-item__image {

    position: relative;

    width: 100%;

    aspect-ratio: 4 / 3;

    overflow: hidden;

    background: var(--gallery-bg-soft);

    border-radius: var(--raio-pequeno);

    box-shadow:
        0 10px 28px rgba(35, 61, 52, .06);

    cursor: pointer;
}


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

.gallery-item__image img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transition:
        transform .55s ease;
}


/* ==========================================================================
   OVERLAY
   ========================================================================== */

.gallery-item__image::after {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(20, 40, 34, 0),
            rgba(20, 40, 34, .38)
        );

    opacity: 0;

    transition:
        opacity .3s ease;
}


/* ==========================================================================
   ÍCONE DE AMPLIAÇÃO
   ========================================================================== */

.gallery-item__overlay {

    position: absolute;

    right: 13px;

    bottom: 13px;

    z-index: 2;

    display: grid;

    place-items: center;

    width: 37px;

    height: 37px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, .94);

    color: var(--gallery-green-dark);

    font-size: .7rem;

    opacity: 0;

    transform: translateY(7px);

    transition:
        opacity .3s ease,
        transform .3s ease;
}


/* ==========================================================================
   HOVER
   ========================================================================== */

.gallery-item__image:hover img {

    transform: scale(1.045);
}


.gallery-item__image:hover::after {

    opacity: 1;
}


.gallery-item__image:hover .gallery-item__overlay {

    opacity: 1;

    transform: translateY(0);
}


/* ==========================================================================
   LEGENDA
   ========================================================================== */

.gallery-item__caption {

    margin-top: 12px;

    padding: 0 3px;

    color: var(--gallery-text-soft);

    font-size: .79rem;

    font-weight: 600;

    line-height: 1.55;
}


/* ==========================================================================
   ACESSIBILIDADE
   ========================================================================== */

.gallery-item__image:focus-visible {

    outline:
        3px solid rgba(66, 201, 193, .45);

    outline-offset: 4px;
}


/* ==========================================================================
   DESKTOP MENOR
   ========================================================================== */

@media (max-width: 1180px) {

    .gallery-page .container {

        width: min(100% - 60px, 1080px);
    }


    .gallery-grid {

        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap: 28px 18px;
    }

}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 900px) {

    .gallery-page .container {

        width: min(100% - 48px, 760px);
    }


    .gallery-hero {

        padding: 62px 0 52px;
    }


    .gallery-grid {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 27px 16px;
    }


    .gallery-content {

        padding-top: 55px;
    }

}


/* ==========================================================================
   TABLET PEQUENO
   ========================================================================== */

@media (max-width: 700px) {

    .gallery-page .container {

        width: calc(100% - 36px);
    }


    .gallery-hero {

        padding: 52px 0 45px;
    }


    .gallery-hero h1 {

        font-size:
            clamp(2.45rem, 9vw, 3.5rem);
    }


    .gallery-hero p {

        margin-top: 18px;

        font-size: .98rem;
    }


    .gallery-content {

        padding: 45px 0 70px;
    }


    .gallery-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 28px 14px;
    }


    .gallery-item__caption {

        font-size: .77rem;
    }

}


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

@media (max-width: 480px) {

    .gallery-page .container {

        width: calc(100% - 28px);
    }


    .gallery-hero {

        padding: 44px 0 40px;
    }


    .gallery-hero__label {

        margin-bottom: 14px;

        font-size: .63rem;

        letter-spacing: .17em;
    }


    .gallery-hero__label::before,
    .gallery-hero__label::after {

        width: 22px;
    }


    .gallery-hero h1 {

        font-size: 2.45rem;

        line-height: 1.02;
    }


    .gallery-hero p {

        font-size: .92rem;

        line-height: 1.65;
    }


    .gallery-content {

        padding: 38px 0 60px;
    }


    .gallery-grid {

        grid-template-columns: 1fr;

        gap: 30px;
    }


    .gallery-item__image {

        aspect-ratio: 16 / 10;

        border-radius: var(--raio-pequeno);
    }


    .gallery-item__caption {

        margin-top: 10px;

        padding: 0 2px;

        font-size: .8rem;
    }


    /*
     * Em dispositivos touch, o botão de ampliar
     * permanece discretamente visível.
     */

    .gallery-item__overlay {

        opacity: .9;

        transform: none;
    }

}


/* ==========================================================================
   REDUÇÃO DE MOVIMENTO
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .gallery-page *,
    .gallery-page *::before,
    .gallery-page *::after {

        transition-duration: .01ms !important;

        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;
    }

}