/* ==========================================================================
   HOME PAGE - SCROLL SNAP (PÁGINA INICIAL)
   ==========================================================================
   Este arquivo implementa scroll snap apenas para a página inicial.
   As seções são centralizadas automaticamente ao fazer scroll.
   O rodapé só aparece quando chegar ao final.
*/

/* --- 1. CONTAINER PRINCIPAL DA HOME --- */
/* Aplicar scroll snap apenas na página inicial quando o container existe */
.home-page-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Aplicar scroll snap no html apenas quando na página inicial */
body.home-page-active {
    overflow-x: hidden;
}

/* Aplicar scroll snap no html quando a classe está ativa - Sobrescrever global-scroll.css */
html.home-page-active {
    scroll-snap-type: y mandatory !important;
    scroll-behavior: smooth !important;
    overflow-y: scroll !important;
}

body.home-page-active {
    scroll-snap-type: y mandatory !important;
    scroll-behavior: smooth !important;
}

/* --- 2. REMOVER ESPAÇOS ANTES/DEPOIS DO CABEÇALHO E RODAPÉ --- */
body.home-page-active .navbar,
.home-page-container ~ .navbar {
    margin-top: 0 !important;
    padding-top: 0.8rem !important;
    padding-bottom: 0.8rem !important;
}

.home-page-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.home-page-active footer,
.home-page-container + footer {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* --- 3. SEÇÕES COM SCROLL SNAP E CENTRALIZAÇÃO --- */
/* Sobrescrever estilos do global-scroll.css para centralizar */
.home-page-container > *,
.home-page-container > section,
.home-page-container .snap-section {
    scroll-snap-align: center !important;
    scroll-snap-stop: always !important;
    min-height: 100vh !important;
    position: relative !important;
    box-sizing: border-box !important;
    padding-bottom: 0 !important;
}

/* Hero Section - Altura total da viewport */
.home-page-container > section.hero-universal-wrapper,
.home-page-container > .hero-universal-wrapper {
    min-height: 100vh !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    scroll-snap-align: center !important;
    scroll-snap-stop: always !important;
    position: relative !important;
    display: block !important;
}

/* Áreas Carousel Section */
.home-page-container > section.areas-carousel-section,
.home-page-container > .areas-carousel-section {
    min-height: 100vh;
    padding-top: var(--header-height, 85px);
    padding-bottom: 0;
    margin: 0;
}

/* Seções dinâmicas (home-section-wrapper) */
.home-page-container .home-section-wrapper {
    min-height: 100vh;
    padding: var(--header-height, 85px) 0 0 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

/* Seção de História */
.home-page-container .section-adaptive-alt {
    min-height: 100vh;
    padding: var(--header-height, 85px) 0 0 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

/* Ajuste para imagem da história - Tamanho aumentado e harmônico */
.home-page-container .section-adaptive-alt .history-composition {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.home-page-container .section-adaptive-alt .history-img-frame {
    max-width: 100%;
    max-height: 550px; /* Aumentado de 400px para 550px */
    width: auto;
    display: inline-block;
}

.home-page-container .section-adaptive-alt .history-img-frame img {
    max-height: 550px; /* Aumentado de 400px para 550px */
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Responsividade para a seção de história */
@media (max-width: 991px) {
    .home-page-container .section-adaptive-alt .history-img-frame {
        max-height: 400px; /* Aumentado de 300px para 400px no mobile */
    }
    
    .home-page-container .section-adaptive-alt .history-img-frame img {
        max-height: 400px; /* Aumentado de 300px para 400px no mobile */
    }
}

/* CTA Section */
.home-page-container .cta-section-ultimate {
    min-height: 100vh;
    padding: var(--header-height, 85px) 0 0 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    position: relative;
}

/* Garantir que o CTA mantenha seus estilos */
.home-page-container .cta-section-ultimate .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height, 85px));
}

/* Map Section */
.home-page-container .glass-map-wrapper {
    min-height: 100vh;
    padding: var(--header-height, 85px) 0 0 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

/* --- 4. RODAPÉ - SÓ APARECE NO FINAL --- */
body.home-page-active footer,
.home-page-container ~ footer {
    scroll-snap-align: end;
    scroll-snap-stop: always;
    min-height: auto;
    margin-top: 0 !important;
    padding-top: 3rem !important;
    position: relative;
    z-index: 10;
}

/* --- 5. AJUSTES RESPONSIVOS --- */
@media (max-width: 991px) {
    .home-page-container > * {
        padding-top: var(--header-height, 65px);
    }
    
    .home-page-container .home-section-wrapper,
    .home-page-container .section-adaptive-alt,
    .home-page-container .cta-section-ultimate,
    .home-page-container .glass-map-wrapper {
        padding-top: var(--header-height, 65px) !important;
    }
    
    /* Ajustar altura mínima em mobile para melhor visualização */
    .home-page-container > * {
        min-height: 100vh;
    }
}

@media (max-width: 576px) {
    .home-page-container > * {
        min-height: 100vh;
        padding-top: var(--header-height, 65px);
    }
}

/* --- 6. REMOVER DIVISORES ENTRE SEÇÕES --- */
.home-page-container .section-divider {
    display: none !important;
}

/* Remover ::after do global-scroll.css nas seções da página inicial */
.home-page-container > *::after,
.home-page-container > section::after,
.home-page-container .snap-section::after {
    display: none !important;
    content: none !important;
}

/* --- 7. GARANTIR QUE CONTEÚDO DAS SEÇÕES SEJA CENTRALIZADO --- */
.home-page-container .home-section-wrapper > .container,
.home-page-container .section-adaptive-alt > .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: calc(100vh - var(--header-height, 85px));
}

.home-page-container .cta-section-ultimate > .container,
.home-page-container .glass-map-wrapper > .content-centered-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height, 85px));
}

/* --- 8. AJUSTES ESPECÍFICOS PARA HERO --- */
.home-page-container .hero-universal-wrapper {
    position: relative;
    min-height: 100vh !important;
    height: 100vh;
    overflow: hidden;
}

/* --- 9. REMOVER MARGENS E PADDINGS DESNECESSÁRIOS --- */
body.home-page-active main,
.home-page-container {
    margin: 0;
    padding: 0;
}

/* --- 10. GARANTIR QUE O SCROLL SNAP FUNCIONE CORRETAMENTE --- */
/* Aplicar scroll snap no html quando a página inicial está ativa */
html.home-page-active {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: no-preference) {
    html.home-page-active {
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
    }
}

