/* ==================================================
   PÁGINA PORTFÓLIO
================================================== */


/* ==================================================
   1. HERO DO PORTFÓLIO
================================================== */

.portfolio-hero {
    position: relative;

    min-height: 265px;

    display: flex;
    align-items: center;

    background-image: url('../img/about-banner.jpg');
    background-repeat: no-repeat;
    background-size: cover;

    /*
    Mantém a estante do lado direito e o ambiente
    claro semelhante ao hero antigo.
    */
    background-position: 50% 42%;

    overflow: hidden;
}


/* ==================================================
   DEGRADÊ SOBRE A IMAGEM
================================================== */

.portfolio-hero::before {
    content: '';

    position: absolute;
    inset: 0;
    z-index: 1;

    background:
        linear-gradient(
            90deg,
            rgba(244, 242, 237, 0.96) 0%,
            rgba(239, 235, 226, 0.91) 31%,
            rgba(221, 211, 192, 0.76) 59%,
            rgba(176, 149, 108, 0.61) 100%
        );

    pointer-events: none;
}


/* ==================================================
   CONTEÚDO
================================================== */

.portfolio-hero-content {
    position: relative;
    z-index: 2;

    width: min(100% - 40px, var(--container));
    max-width: var(--container);

    margin: 0 auto;
}


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

.portfolio-hero h1 {
    margin: 0;

    font-family: var(--fonte-titulo);
    font-size: clamp(2.8rem, 3.3vw, 3.8rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.035em;
    text-transform: uppercase;

    color: var(--preto-elegante);
}


/* Remove qualquer decoração antiga */

.portfolio-hero h1::after {
    display: none;
}


/* ==================================================
   RESPONSIVO — TABLET
================================================== */

@media (max-width: 1024px) {

    .portfolio-hero {
        min-height: 240px;
        background-position: 55% 40%;
    }

}


/* ==================================================
   RESPONSIVO — MOBILE
================================================== */

@media (max-width: 768px) {

    .portfolio-hero {
        min-height: 210px;
        padding: 0;

        background-position: 60% center;
    }

    .portfolio-hero-content {
        width: min(100% - 28px, var(--container));
    }

    .portfolio-hero::before {
        background:
            linear-gradient(
                90deg,
                rgba(244, 242, 237, 0.97) 0%,
                rgba(237, 230, 217, 0.88) 58%,
                rgba(185, 157, 116, 0.60) 100%
            );
    }

    .portfolio-hero h1 {
        font-size: clamp(2.5rem, 11vw, 3.3rem);
    }

}


/* ==================================================
   RESPONSIVO — CELULAR PEQUENO
================================================== */

@media (max-width: 480px) {

    .portfolio-hero {
        min-height: 190px;
        background-position: 62% center;
    }

    .portfolio-hero h1 {
        font-size: 2.5rem;
    }

}


/* ==================================================
   2. CONTEÚDO PRINCIPAL
================================================== */

.portfolio-page-section {
    padding: 92px 0 120px;

    background: var(--bege-fundo);
}


/* ==================================================
   CABEÇALHO
================================================== */

.portfolio-page-top{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:end;
    gap:60px;

    margin-bottom:38px;
}

.portfolio-page-top > div{
    max-width:760px;
}

.portfolio-page-top .section-label{
    margin-bottom:16px;
}

.portfolio-page-top h2{
    margin:0 0 18px;

    max-width:650px;

    font-family:var(--fonte-titulo);
    font-size:clamp(2.3rem,3vw,3.7rem);
    font-weight:400;
    line-height:.96;
    letter-spacing:-.035em;

    color:var(--preto-elegante);
}

.portfolio-page-top p{
    max-width:560px;

    font-size:.93rem;
    line-height:1.75;

    color:var(--cinza-quente);
}

.portfolio-page-top .btn-outline{
    margin-bottom:6px;
}


/* ==================================================
   3. FILTROS DO PORTFÓLIO
================================================== */

.portfolio-page-filters{
    display:flex;
    justify-content:center;
    gap:34px;

    margin-bottom:36px;
}


/* Botão */

.portfolio-page-filters button{
    position:relative;

    padding:0 0 8px;

    border:0;
    background:none;

    font-size:.92rem;

    color:var(--dourado-escuro);

    cursor:pointer;
}


/* Linha inferior */

.portfolio-page-filters button::after {
    content: '';

    position: absolute;
    left: 0;
    bottom: 0;

    width: 0;
    height: 2px;

    background: var(--dourado);

    transition: var(--transition);
}


/* Estado ativo e hover */

.portfolio-page-filters button.active::after,
.portfolio-page-filters button:hover::after {
    width: 100%;
}


/* ==================================================
   4. GALERIA
================================================== */

.portfolio-gallery{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
}


/* ==================================================
   GALERIA — ITEM
================================================== */

.portfolio-gallery-item {
    position: relative;

    height: 295px;
    padding: 0;

    overflow: hidden;

    border: 0;
    background: transparent;

    cursor: pointer;
}


/* Camada escura */

.portfolio-gallery-item::before {
    content: '';

    position: absolute;
    inset: 0;
    z-index: 1;

    background: rgba(28, 26, 23, 0.34);

    opacity: 0;

    transition: var(--transition);
}


/* Ícone de ampliar */

.portfolio-gallery-item::after {
    content: '\f00e';

    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;

    width: 52px;
    height: 52px;

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

    border-radius: 50%;

    background: rgba(255, 253, 248, 0.92);

    font-family: "Font Awesome 6 Free";
    font-weight: 900;

    color: var(--preto-elegante);

    opacity: 0;

    transform: translate(-50%, -50%) scale(0.8);

    transition: var(--transition);
}


/* Imagem */

.portfolio-gallery-item img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: transform 0.7s ease;
}


/* ==================================================
   GALERIA — HOVER
================================================== */

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

.portfolio-gallery-item:hover::before,
.portfolio-gallery-item:hover::after {
    opacity: 1;
}

.portfolio-gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
}


/* ==================================================
   5. LIGHTBOX
================================================== */

.portfolio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;

    padding: 72px 92px;

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

    background: rgba(10, 9, 8, 0.94);
}


/* Lightbox aberto */

.portfolio-lightbox.active {
    display: flex;
}


/* ==================================================
   LIGHTBOX — CONTEÚDO
================================================== */

.lightbox-content {
    width: 100%;
    height: 100%;

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

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}


/* ==================================================
   LIGHTBOX — BOTÕES
================================================== */

.lightbox-close,
.lightbox-arrow {
    position: fixed;
    z-index: 3;

    border: 0;

    background: rgba(255, 253, 248, 0.12);

    color: var(--bege-claro);

    cursor: pointer;

    transition: var(--transition);
}


/* Botão fechar */

.lightbox-close {
    top: 28px;
    right: 32px;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    font-size: 1.25rem;
}


/* Setas */

.lightbox-arrow {
    top: 50%;

    width: 58px;
    height: 58px;

    border-radius: 50%;

    font-size: 1.15rem;

    transform: translateY(-50%);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}


/* Hover */

.lightbox-close:hover,
.lightbox-arrow:hover {
    background: var(--dourado);

    color: var(--preto-elegante);
}


/* ==================================================
   LIGHTBOX — INFORMAÇÕES
================================================== */

.lightbox-info {
    position: fixed;
    left: 32px;
    bottom: 28px;
    z-index: 3;

    display: flex;
    align-items: center;
    gap: 18px;

    color: var(--bege-claro);
}

.lightbox-info strong {
    font-family: var(--fonte-titulo);
    font-size: 1.8rem;
    font-weight: 500;
}

.lightbox-info span {
    font-size: 0.9rem;

    color: rgba(255, 253, 248, 0.7);
}


/* ==================================================
   ANIMAÇÃO
================================================== */

.reveal-up{
    opacity:0;
    transform:translateY(70px);

    transition:
        opacity .85s ease,
        transform .85s cubic-bezier(.2,.7,.2,1);
}

.reveal-up.visible{
    opacity:1;
    transform:translateY(0);
}


/* ==================================================
   ANIMAÇÃO INDIVIDUAL DA GALERIA
================================================== */

.reveal-gallery-item {
    opacity: 0;
    transform: translateY(45px);

    transition:
        opacity 0.7s ease,
        transform 0.7s cubic-bezier(.2, .7, .2, 1);
}

.reveal-gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/*
Atraso em sequência dentro de cada linha.
Como a galeria possui três colunas no computador,
o padrão se repete a cada três imagens.
*/

.reveal-gallery-item:nth-child(3n + 1) {
    transition-delay: 0.05s;
}

.reveal-gallery-item:nth-child(3n + 2) {
    transition-delay: 0.18s;
}

.reveal-gallery-item:nth-child(3n + 3) {
    transition-delay: 0.31s;
}

@media (max-width: 1024px) {

    /*
    Em duas colunas, alterna o atraso entre
    a imagem esquerda e a imagem direita.
    */

    .reveal-gallery-item:nth-child(3n + 1),
    .reveal-gallery-item:nth-child(3n + 2),
    .reveal-gallery-item:nth-child(3n + 3) {
        transition-delay: 0s;
    }

    .reveal-gallery-item:nth-child(2n + 1) {
        transition-delay: 0.05s;
    }

    .reveal-gallery-item:nth-child(2n + 2) {
        transition-delay: 0.18s;
    }

}

@media (max-width: 768px) {

    /*
    No celular existe apenas uma coluna,
    então cada imagem anima quando entra na tela.
    */

    .reveal-gallery-item {
        transition-delay: 0s !important;
    }

}

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

    .reveal-up,
    .reveal-gallery-item {
        opacity: 1;
        transform: none;
        transition: none;
    }

}


/* ==================================================
   6. RESPONSIVO — TABLET
================================================== */

@media (max-width: 1024px) {

    /* Cabeçalho do conteúdo */

    .portfolio-page-top {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .portfolio-page-top .btn-outline {
        width: fit-content;
    }


    /* Galeria */

    .portfolio-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-gallery-item {
        height: 280px;
    }

}


/* ==================================================
   7. RESPONSIVO — MOBILE
================================================== */

@media (max-width: 768px) {

    /* Hero */

    .portfolio-hero {
        min-height: auto;

        padding: 90px 0;

        background-position: 72% top;
    }

    .portfolio-hero-content {
        width: min(100% - 28px, var(--container));
    }


    /* Conteúdo */

    .portfolio-page-section {
        padding: 68px 0 80px;
    }


    /* Filtros */

    .portfolio-page-filters {
        justify-content: flex-start;

        overflow-x: auto;

        padding-bottom: 4px;
    }

    .portfolio-page-filters button {
        flex: 0 0 auto;
    }


    /* Galeria */

    .portfolio-gallery {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .portfolio-gallery-item {
        height: 300px;
    }


    /* Lightbox */

    .portfolio-lightbox {
        padding: 70px 18px;
    }

    .lightbox-arrow {
        width: 46px;
        height: 46px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }

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

    .lightbox-info {
        left: 18px;
        bottom: 18px;
    }

    .lightbox-info strong {
        font-size: 1.4rem;
    }

}


/* ==================================================
   8. RESPONSIVO — CELULAR PEQUENO
================================================== */

@media (max-width: 480px) {

    .portfolio-hero {
        padding: 70px 0;
    }

    .portfolio-hero h1 {
        font-size: clamp(2.7rem, 13vw, 4rem);
    }

    .portfolio-hero p {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    .portfolio-gallery-item {
        height: 260px;
    }

    .lightbox-info {
        right: 70px;

        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .lightbox-info strong {
        font-size: 1.25rem;
    }

    .lightbox-info span {
        font-size: 0.8rem;
    }

}