/* Estilo automático para o tipo de post: empreendimento */

/* ==========================================================================
   Página do empreendimento (single-empreendimento.php)
   Capa de vídeo (.qs-media), setas (.slider-arrow) e atalhos: style.css
   ========================================================================== */

.emp-page{
    position: relative; /* referência para o formulário sobre o topo (desktop) */

    *,
    *::before,
    *::after{
        box-sizing: border-box;
    }

    /* evita rolagem lateral causada pelos carrosséis que vazam da tela */
    overflow-x: clip;
}

.emp-sec{
    padding: 80px 0;
    /* ao abrir a página com a âncora na URL (ex.: #plantas), não fica escondida atrás do menu fixo */
    scroll-margin-top: 60px;

    @media (max-width: 767px){
        padding: 56px 0;

        .section-title{
            font-size: 28px;
        }
    }
}

/* ==========================================================================
   Topo
   ========================================================================== */

.emp-hero{
    position: relative;
    display: flex;
    min-height: 770px;
    background-color: var(--Dark-Blue);

    /* mesmo filtro azul do banner da home */
    &::after{
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(90deg, #183B67 0%, rgba(24, 59, 103, 0.55) 33.04%, rgba(23, 79, 130, 0.00) 96.5%);
        pointer-events: none;
    }

    .emp-hero-media{
        position: absolute;
        inset: 0;

        img{
            display: block;
            width: 100%;
            height: 100%;
            max-width: none;
            object-fit: cover;
        }
    }

    .emp-hero-inner{
        position: relative;
        z-index: 2;
        align-self: flex-end;
        padding: 170px 0 40px;
    }

    .emp-hero-content{
        max-width: 540px;
        padding-bottom: 20px;
    }

    .emp-hero-logo{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100px;
        height: 100px;
        margin-bottom: 18px;
        padding: 6px;
        border-radius: 8px;
        background-color: #fff;

        img{
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
    }

    .emp-hero-title{
        margin: 0;
        color: #fff;
        font-size: 48px;
        font-weight: 600;
        line-height: 1.1;
    }

    .emp-hero-address{
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 22px 0 0;
        color: #fff;
        font-size: 16px;
        font-weight: 600;

        svg{
            width: 22px;
            height: 22px;
            flex-shrink: 0;
        }
    }

    .emp-hero-subtitle{
        margin: 20px 0 0;
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, .6);
        color: #fff;
        font-size: 20px;
        font-weight: 600;
    }

    @media (max-width: 1199px){
        min-height: 560px;
    }

    @media (max-width: 767px){
        min-height: 540px;

        &::after{
            background:
                linear-gradient(0deg, rgba(24, 59, 103, .8) 0%, rgba(24, 59, 103, 0) 70%),
                linear-gradient(90deg, #183B67 0%, rgba(24, 59, 103, 0.55) 33.04%, rgba(23, 79, 130, 0.00) 96.5%);
        }

        .emp-hero-inner{
            padding: 140px 0 28px;
        }

        .emp-hero-content{
            padding-bottom: 0;
        }

        .emp-hero-logo{
            width: 80px;
            height: 80px;
            margin-bottom: 16px;
        }

        .emp-hero-title{
            font-size: 34px;
        }

        .emp-hero-address{
            align-items: flex-start;
            margin-top: 18px;
            font-size: 14px;
        }

        .emp-hero-subtitle{
            margin-top: 16px;
            padding-top: 18px;
            font-size: 18px;
        }
    }
}

/* ==========================================================================
   Formulário
   Desktop (>= 1200px): sobre a imagem do topo, à direita.
   Tablet e mobile: logo abaixo do menu da página, sobre fundo cinza claro.
   ========================================================================== */

.emp-form-layer{
    padding: 48px 0;
    background-color: #F4F6F9;

    .emp-form-card{
        max-width: 640px;
        margin: 0 auto;
    }

    @media (min-width: 1200px){
        position: absolute;
        top: 170px;
        left: 0;
        right: 0;
        z-index: 5;
        padding: 0;
        background: none;
        pointer-events: none;

        .container-site{
            display: flex;
            justify-content: flex-end;
        }

        .emp-form-card{
            width: 420px;
            margin: 0;
            pointer-events: auto;
        }
    }

    @media (max-width: 767px){
        padding: 24px 0;

        .emp-form-card{
            padding: 24px;
            box-shadow: none;
        }

        .emp-form-title{
            font-size: 24px;
        }

        .emp-form .emp-form-submit{
            align-self: stretch;
            height: 50px;
        }
    }
}

.emp-form-card{
    padding: 28px;
    border-radius: 20px;
    background-color: #fff;
    box-shadow: 0 10px 40px rgba(24, 59, 103, .18);

    .emp-form-title{
        margin: 10px 0 22px;
        padding-bottom: 16px;
        border-bottom: 1px solid #E2E8F0;
        color: var(--Primary-Blue);
        font-size: 24px;
        font-weight: 500;
        line-height: 1.4;
    }
}

.emp-form{
    display: flex;
    flex-direction: column;
    gap: 20px;

    .emp-field{
        label{
            display: block;
            margin-bottom: 10px;
            color: var(--Primary-Blue);
            font-size: 14px;
            font-weight: 600;
        }

        input{
            display: block;
            width: 100%;
            height: 44px;
            padding: 0 14px;
            border: 1px solid var(--Primary-Blue);
            border-radius: 22px;
            background-color: var(--Hero-Gray);
            color: #333;
            font-size: 16px;
            outline: none;
            transition: border-color .3s ease, box-shadow .3s ease;

            &::placeholder{
                color: #6B7280;
            }

            &:focus{
                border-color: var(--Primary-Green);
                box-shadow: 0 0 0 3px rgba(179, 197, 45, .25);
            }
        }
    }

    .emp-form-submit{
        align-self: flex-start;
        margin-top: 4px;
    }
}

/* ==========================================================================
   Menu da página (fixo ao rolar)
   ========================================================================== */

.emp-nav{
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: var(--Primary-Blue);

    .emp-nav-list{
        display: flex;
        justify-content: space-between;
        gap: 28px;
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-x: auto;
        scrollbar-width: none;

        &::-webkit-scrollbar{
            display: none;
        }
    }

    a{
        display: block;
        padding: 22px 0;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 1px;
        text-decoration: none;
        text-transform: uppercase;
        white-space: nowrap;
        transition: color .3s ease;

        &:hover,
        &:focus-visible{
            color: var(--Primary-Green);
        }
    }

    @media (max-width: 767px){
        a{
            padding: 18px 0;
            font-size: 12px;
        }
    }
}

/* ==========================================================================
   Descrição
   ========================================================================== */

.emp-descricao{
    .emp-descricao-grid{
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 656px);
        align-items: center;
        gap: 36px;
    }

    .section-title{
        margin: 12px 0 18px;
    }

    .emp-descricao-text{
        font-size: 15px;
        text-align: justify;

        p{
            margin-bottom: 18px;
        }
    }

    .emp-descricao-action{
        margin-top: 22px;

        .btn-icon{
            color: var(--Primary-Green);
        }
    }

    .emp-descricao-media{
        aspect-ratio: 656 / 482;
    }

    /* Tablet (até 1199px): texto em cima e vídeo embaixo, ocupando a largura toda */
    @media (max-width: 1199px){
        .emp-descricao-grid{
            grid-template-columns: 1fr;
            gap: 32px;
        }
    }

    @media (max-width: 991px){
        .emp-descricao-text{
            text-align: left;
        }
    }
}

/* ==========================================================================
   Ficha técnica (carrossel com barra)
   ========================================================================== */

.emp-ficha{
    background: linear-gradient(180deg, #FFFFFF 0%, #F1F4DC 100%);

    .emp-ficha-swiper{
        padding-bottom: 44px;
    }

    .emp-ficha-item{
        display: flex;
        align-items: flex-start;
        gap: 14px;
    }

    .emp-ficha-icon{
        display: flex;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        color: var(--Primary-Blue);

        svg{
            width: 100%;
            height: 100%;
        }
    }

    .emp-ficha-label{
        display: block;
        color: var(--Primary-Blue);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .6px;
        text-transform: uppercase;
    }

    .emp-ficha-value{
        display: block;
        margin-top: 4px;
        color: var(--Primary-Blue);
        font-size: 15px;
    }

    /* barra de rolagem do carrossel (verde = parte visível) */
    .emp-ficha-scrollbar{
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 5px;
        border-radius: 5px;
        background-color: #DDE3E8;

        .swiper-scrollbar-drag{
            border-radius: 5px;
            background-color: var(--Primary-Green);
        }

        /* com poucos itens (todos visíveis) a barra continua aparecendo, como no layout */
        &.swiper-scrollbar-lock{
            display: block;
        }
    }
}

/* ==========================================================================
   Carrosséis de imagens (galeria e fotos da obra)
   ========================================================================== */

.emp-carousel{
    --slide-w: 645px;
    position: relative;

    .swiper{
        overflow: visible;
    }

    .swiper-slide{
        width: var(--slide-w);
    }

    .emp-carousel-item{
        display: block;
        aspect-ratio: 645 / 455;
        overflow: hidden;
        border-radius: 12px;
        background-color: #DDE3E8;

        img{
            display: block;
            width: 100%;
            height: 100%;
            max-width: none;
            object-fit: cover;
            transition: transform .6s ease;
        }

        &:hover img{
            transform: scale(1.04);
        }
    }

    /* setas sobre as imagens laterais */
    .slider-arrow{
        position: absolute;
        top: 50%;
        z-index: 3;
        transform: translateY(-50%);
    }

    .slider-arrow-prev{
        left: calc(50% - var(--slide-w) / 2 - 114px);
        background-color: rgba(255, 255, 255, .85);
    }

    .slider-arrow-next{
        right: calc(50% - var(--slide-w) / 2 - 114px);
    }

    /* fotos da obra: mais baixas */
    &.emp-carousel-sm{
        margin-top: 48px;

        .emp-carousel-item{
            aspect-ratio: 645 / 300;
        }
    }

    @media (max-width: 767px){
        --slide-w: 82vw;

        .slider-arrow-prev{
            left: 12px;
        }

        .slider-arrow-next{
            right: 12px;
        }
    }
}

/* ==========================================================================
   Plantas
   ========================================================================== */

.emp-plantas{
    .emp-plantas-grid{
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: 40px;
    }

    .section-title{
        margin: 12px 0 18px;
    }

    .emp-plantas-list{
        margin: 0;
        padding: 0;
        list-style: none;

        li{
            border-bottom: 1px solid #E2E8F0;
        }
    }

    .emp-plantas-option{
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 16px 0;
        border: 0;
        background: none;
        color: var(--Primary-Blue);
        font-size: 15px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        transition: color .3s ease;

        .emp-plantas-arrow{
            display: flex;
            width: 18px;
            height: 18px;
            color: var(--Primary-Green);
            opacity: 0;
            transition: opacity .3s ease, transform .3s ease;

            svg{
                width: 100%;
                height: 100%;
            }
        }

        &:hover,
        &.is-active{
            color: #9AAA1E;

            .emp-plantas-arrow{
                opacity: 1;
            }
        }

        &:hover .emp-plantas-arrow{
            transform: translateX(3px);
        }
    }

    .emp-plantas-image{
        display: none;
        margin: 0;

        &.is-active{
            display: block;
        }

        a{
            display: block;
            cursor: zoom-in;
        }

        img{
            display: block;
            width: 100%;
            height: auto;
            max-height: 520px;
            object-fit: contain;
            border-radius: 8px;
        }
    }

    .emp-plantas-caption{
        margin: 16px 0 0;
        color: #565656;
        font-size: 13px;
        text-align: right;

        button{
            padding: 0;
            border: 0;
            background: none;
            color: var(--Primary-Blue);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;

            &:hover{
                text-decoration: underline;
            }
        }
    }

    @media (max-width: 991px){
        .emp-plantas-grid{
            grid-template-columns: 1fr;
        }
    }
}

/* ==========================================================================
   Estágios da obra
   ========================================================================== */

.emp-obra{
    background: linear-gradient(180deg, #FFFFFF 0%, #F1F4DC 45%, #FFFFFF 100%);

    .emp-obra-list{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 32px 16px;
        margin: 0;
        padding: 0 30px;
        list-style: none;
    }

    .emp-obra-item{
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        min-width: 120px;
    }

    .emp-obra-ring{
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 104px;
        height: 104px;

        svg{
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            transform: rotate(-90deg);
        }

        circle{
            fill: none;
            stroke-width: 3;
        }

        .emp-obra-track{
            stroke: #D4DEE8;
        }

        .emp-obra-progress{
            stroke: var(--Primary-Blue);
            stroke-linecap: round;
            transition: stroke-dashoffset 1s ease;
        }
    }

    .emp-obra-pct{
        color: var(--Primary-Blue);
        font-size: 18px;
        font-weight: 600;
    }

    .emp-obra-name{
        color: var(--Primary-Blue);
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 1px;
        text-align: center;
        text-transform: uppercase;
    }

    /* concluído: verde */
    .emp-obra-item.is-done{
        .emp-obra-progress{
            stroke: var(--Primary-Green);
        }

        .emp-obra-pct{
            color: #9AAA1E;
        }
    }

    @media (max-width: 991px){
        .emp-obra-list{
            justify-content: center;
            padding: 0;
        }
    }
}

/* ==========================================================================
   Localização
   ========================================================================== */

.emp-localizacao{
    .section-head-center{
        max-width: 760px;

        .section-desc strong{
            color: #333;
            font-weight: 600;
        }
    }

    .emp-mapa{
        aspect-ratio: 1320 / 420;
        overflow: hidden;
        border-radius: 20px;
        background-color: #DDE3E8;

        img,
        iframe{
            display: block;
            width: 100%;
            height: 100%;
            border: 0;
            object-fit: cover;
        }
    }

    .emp-mapa-actions{
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-top: 32px;
    }

    @media (max-width: 767px){
        .emp-mapa{
            aspect-ratio: 4 / 3;
        }
    }
}

/* Plantas: a seta ">" só aparece no mobile (ver bloco abaixo) */
.emp-plantas .emp-plantas-chevron{
    display: none;
}

/* Carrossel: dots só aparecem no mobile (ver bloco abaixo) */
.emp-carousel-dots{
    display: none;
}

/* ==========================================================================
   MOBILE (até 767px) - layout específico do print mobile
   ========================================================================== */

@media (max-width: 767px){

    /* ---------- Menu da página: rola para o lado, alinhado à esquerda ---------- */
    .emp-nav .emp-nav-list{
        justify-content: flex-start;
        gap: 24px;
    }

    /* ---------- Cabeçalhos das seções alinhados à esquerda ---------- */
    .emp-page .section-head-center{
        max-width: none;
        margin-bottom: 24px;
        text-align: left;

        .section-desc{
            margin-inline: 0;
        }
    }

    .emp-page .section-title{
        font-size: 24px;
    }

    /* ---------- Descrição: texto justificado e vídeo abaixo ---------- */
    .emp-descricao{
        .emp-descricao-grid{
            gap: 24px;
        }

        .emp-descricao-text{
            text-align: justify;
        }

        .emp-descricao-media{
            aspect-ratio: 345 / 260;
        }
    }

    /* ---------- Ficha técnica: lista vertical com 4 itens, sobe 1 item a cada 4s ---------- */
    .emp-ficha{
        .emp-ficha-swiper{
            padding-bottom: 0;
        }

        /* altura de 4 itens (52px cada + 3 espaços de 20px) */
        .emp-ficha-swiper.is-vertical{
            height: 268px;

            .emp-ficha-item{
                align-items: center;
                height: 52px;
            }
        }

        /* barra de progresso (abaixo da lista): verde = posição atual */
        .emp-ficha-scrollbar{
            position: relative;
            inset: auto;
            display: block;
            width: 100%;
            height: 5px;
            margin-top: 24px;
            overflow: hidden;
            border-radius: 5px;
            background-color: #DDE3E8;

            .swiper-pagination-progressbar-fill{
                position: absolute;
                inset: 0;
                border-radius: 5px;
                background-color: var(--Primary-Green);
                transform-origin: left center;
            }
        }

        .emp-ficha-icon{
            width: 32px;
            height: 32px;
        }

        .emp-ficha-value{
            font-size: 16px;
        }
    }

    /* ---------- Galeria e fotos da obra: dots + setas abaixo ---------- */
    .emp-carousel.is-mobile{
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 24px 12px;
        width: min(var(--container), 100% - (var(--gutter) * 2));
        margin-inline: auto;

        .swiper{
            grid-column: 1 / -1;
            width: 100%;
            overflow: hidden;
            border-radius: 16px;
        }

        .swiper-slide{
            width: auto;
        }

        .slider-arrow{
            position: static;
            transform: none;
        }

        .slider-arrow-prev{
            background-color: #E8EEF0;
        }

        .emp-carousel-dots{
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .emp-dot{
            display: block;
            width: 8px;
            height: 8px;
            border: 1.5px solid var(--Primary-Blue);
            border-radius: 8px;
            cursor: pointer;
            transition: width .3s ease, background-color .3s ease, border-color .3s ease;

            &.is-active{
                width: 40px;
                border-color: var(--Primary-Green);
                background-color: var(--Primary-Green);
            }
        }

        /* Galeria: 1 imagem grande em cima + 2 menores embaixo */
        .emp-gal-group{
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;

            .emp-carousel-item{
                aspect-ratio: 166 / 120;
                border-radius: 16px;
            }

            .emp-carousel-item:first-child{
                grid-column: 1 / -1;
                aspect-ratio: 345 / 245;
            }
        }

        /* Fotos da obra: 2 por vez */
        &.emp-carousel-sm .emp-carousel-item{
            aspect-ratio: 166 / 90;
            border-radius: 12px;
        }
    }

    .emp-carousel.emp-carousel-sm.is-mobile{
        margin-top: 24px;
    }

    /* ---------- Plantas: opções maiores, ">" nas não selecionadas ---------- */
    .emp-plantas{
        .emp-plantas-grid{
            gap: 32px;
        }

        .emp-plantas-option{
            font-size: 16px;
            font-weight: 400;

            .emp-plantas-arrow{
                display: none;
            }

            .emp-plantas-chevron{
                display: flex;
                width: 16px;
                height: 16px;
                color: var(--Primary-Blue);
                transform: rotate(-90deg);

                svg{
                    width: 100%;
                    height: 100%;
                }
            }

            /* selecionada: seta verde no lugar do ">" */
            &.is-active{
                .emp-plantas-arrow{
                    display: flex;
                    opacity: 1;
                }

                .emp-plantas-chevron{
                    display: none;
                }
            }
        }
    }

    /* ---------- Estágios: 2 círculos por vez, rolagem lateral ---------- */
    .emp-obra{
        .emp-obra-list{
            flex-wrap: nowrap;
            justify-content: flex-start;
            gap: 0;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            scrollbar-width: none;

            &::-webkit-scrollbar{
                display: none;
            }
        }

        .emp-obra-item{
            flex: 0 0 50%;
            min-width: 0;
            gap: 10px;
            scroll-snap-align: start;
        }

        .emp-obra-ring{
            width: 72px;
            height: 72px;
        }

        .emp-obra-pct{
            font-size: 14px;
        }

        .emp-obra-name{
            font-size: 11px;
        }
    }

    /* ---------- Localização: botões empilhados ---------- */
    .emp-localizacao{
        .section-desc{
            font-size: 16px;
        }

        .emp-mapa{
            aspect-ratio: 345 / 240;
            border-radius: 16px;
        }

        .emp-mapa-actions{
            flex-direction: column;
            margin-top: 24px;

            .btn{
                width: 100%;
                height: 50px;
            }
        }
    }

    /* ---------- Atalhos: texto alinhado à esquerda ---------- */
    .emp-page .sec-atalhos .atalho-label{
        justify-content: flex-start;
        padding-left: 20px;
        font-size: 15px;
    }
}
