/* ========================================================
   ARQUIVO: site/estilos-gerais/layout-site.css
   DESCRIÇÃO: Estrutura do Site (AdSense), Modal e SEO.
   ======================================================== */

/* Barra de Rolagem Ultrafina e Profissional */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.seo-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* 1. LAYOUT BASE (COLUNA CENTRAL E ADSENSE LATERAIS) */
.page-layout-wrapper {
    display: flex; justify-content: space-between;
    width: 100%; max-width: 1400px;
    margin: 0 auto; padding: 0 15px; gap: 30px;
}

.site-main-content {
    flex: 1; min-width: 0;
    padding-top: 20px; padding-bottom: 60px;
    display: flex; flex-direction: column; /* Permite reordenar seções */
}

.adsense-sidebar {
    width: 300px; flex-shrink: 0; display: none; padding-top: 20px;
}

/* Marcação provisória de anúncios APENAS nas laterais do site */
.adsense-sidebar .adsense-slot-js {
    width: 100%; 
    min-height: 600px;
    background: rgba(0,0,0,0.03); 
    border-radius: 8px;
}

/* 2. TEXTO DE INTRODUÇÃO (SEO) */
.seo-intro-text {
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url('../imagens/boas-vindas.jpg') center/cover;
    padding: 15px 20px; border-radius: 12px; margin-bottom: 25px;
    font-size: 0.95rem; color: #1a1a1a; font-weight: 500; line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #eee; text-align: center;
    order: 2; /* Fica abaixo do carrossel no celular */
}
.seo-intro-text strong { color: #003399; }
.intro-desktop { display: none; }
.intro-mobile { display: block; }

/* Texto introdutório para aprovação do AdSense nas páginas internas */
.page-intro-text {
    background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), url('../imagens/texto-apresentacao.jpg') center/cover;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    border-left: 4px solid #003399; /* Destaque azul do Ranking Maranhão */
}
.page-intro-text strong { color: #003399; }

/* Modo Noturno para o Texto Introdutório */
body.dark-theme .page-intro-text {
    background: linear-gradient(rgba(30, 30, 30, 0.3), rgba(30, 30, 30, 0.3)), url('../imagens/texto-apresentacao.jpg') center/cover;
    color: #ccc;
    border-color: #333;
}
body.dark-theme .page-intro-text strong { color: #90caf9; }

/* 3. CARROSSEL DINÂMICO (TOPO) */
.dynamic-carousel-section { order: 1; margin-bottom: 25px; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); position: relative; }
.dynamic-carousel-section.hidden { display: none !important; }
.dynamic-carousel-container { width: 100%; aspect-ratio: 5 / 1; position: relative; }
.dynamic-carousel-track { display: flex; height: 100%; }
.dyn-slide { flex: 0 0 100%; height: 100%; }
.dyn-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: #fff; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; }
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

/* 4. ORDENAÇÃO MOBILE (Flexbox) */
#gov-eval-container { order: 3; } /* Sobe o Governador para logo abaixo do texto */
.news-carousel-section { order: 4; }
.latest-news-section { order: 5; }
.rankings-grid-section, .rankings-feed { order: 6; } /* Força os rankings a ficarem sempre por último */

/* 5. MODAL UNIVERSAL DO APLICATIVO */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.hidden { display: none !important; }
.download-app-card { background: #fff; width: 100%; max-width: 400px; border-radius: 16px; padding: 35px 25px; text-align: center; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.3); animation: popIn 0.3s ease-out; }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.btn-close-modal { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; color: #999; cursor: pointer; }
.modal-app-icon img { width: 80px; height: 80px; border-radius: 20px; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.download-app-card h2 { font-size: 1.4rem; color: #003399; margin-bottom: 10px; font-weight: 800; }
.download-app-card p { font-size: 0.95rem; color: #666; margin-bottom: 25px; line-height: 1.5; }
.store-buttons-container { display: flex; flex-direction: column; gap: 12px; }
.store-btn { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 12px; border-radius: 8px; text-decoration: none; color: #fff; background: #000; transition: transform 0.2s; }
.store-btn:hover { transform: translateY(-2px); }
.store-text { display: flex; flex-direction: column; text-align: left; }
.store-text span { font-size: 0.65rem; text-transform: uppercase; }
.store-text strong { font-size: 1.1rem; }

/* 6. CORREÇÕES DE RESPONSIVIDADE (Mobile < 900px) */
@media (max-width: 899px) {
    .rankings-wrapper { grid-template-columns: 1fr; } /* 1 Coluna no celular */
    .horizontal-scroll-wrapper { flex-direction: column; padding-bottom: 10px; } /* Empilha notícias */
    .news-mini-card { width: 100%; min-width: 100%; max-width: 100%; }
}

/* 7. REGRAS PARA PC E LINKS GERAIS (Telas maiores >= 900px) */
.slide-link { 
    display: block; 
    width: 100%; 
    height: 100%; 
    text-decoration: none; 
    color: inherit; 
}

@media (min-width: 900px) {
    .adsense-sidebar { display: block; }
    .seo-intro-text { order: 0; text-align: left; }
    .dynamic-carousel-section, .news-carousel-section, .latest-news-section, #gov-eval-container, .rankings-grid-section, .rankings-feed { order: 0; }
    .intro-desktop { display: block; }
    .intro-mobile { display: none; }
    
    /* Trava carrossel de notícias no PC para não estourar */
    .news-carousel-section { height: auto; aspect-ratio: 16 / 7; }
    
    /* Permite e estiliza a barra de rolagem horizontal nas Notícias no PC */
    .horizontal-scroll-wrapper {
        scrollbar-width: thin; /* Força reexibição no Firefox */
        padding-bottom: 15px; /* Espaço para a barra não cortar os cards */
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar { 
        display: block !important; /* Força reexibição no Chrome/Edge */
        height: 8px; 
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar-track { 
        background: rgba(0, 0, 0, 0.05); 
        border-radius: 10px; 
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar-thumb { 
        background: #cbd5e1; 
        border-radius: 10px; 
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar-thumb:hover { 
        background: #94a3b8; 
    }
}



/* 8. MODO NOTURNO (Específico do Layout do Site) */
body.dark-theme .seo-intro-text { background: linear-gradient(rgba(30, 30, 30, 0.85), rgba(30, 30, 30, 0.85)), url('../imagens/boas-vindas.jpg') center/cover; color: #e0e0e0; border-color: #333; }
body.dark-theme .download-app-card { background: #1e1e1e; }
body.dark-theme .download-app-card h2 { color: #90caf9; }
body.dark-theme .download-app-card p { color: #aaa; }
body.dark-theme .store-btn { border: 1px solid #333; }
body.dark-theme .horizontal-scroll-wrapper::-webkit-scrollbar-track { background: #1e1e1e; }

/* ========================================================
   GRELHAS (GRIDS) DE ORGANIZAÇÃO - PC E MOBILE
   ======================================================== */

/* Ponto 3: Governador e Prefeito lado a lado no PC */
.executivos-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px; }

/* Ponto 2: Rankings em duas colunas no PC */
.rankings-feed { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* Ponto 4: Área exclusiva dos Senadores (2 em cima, 1 centralizado embaixo) */
.senadores-wrapper { background: rgba(0, 51, 153, 0.03); border: 1px solid rgba(0, 51, 153, 0.1); border-radius: 12px; padding: 20px; margin-bottom: 30px; }
body.dark-theme .senadores-wrapper { background: rgba(255,255,255,0.02); border-color: #333; }

/* Motor Flexbox que permite quebrar a linha e centralizar as sobras */
.senadores-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 15px; }
.senadores-grid > div { flex: 1 1 100%; max-width: 100%; } /* Celular: 1 por linha ocupando 100% */

/* Responsividade Mágica para Telas Maiores (PC e Tablet) */
@media (min-width: 900px) { 
    .executivos-grid { grid-template-columns: 1fr 1fr; } 
    .rankings-feed { grid-template-columns: 1fr 1fr; align-items: start; }
    
    /* PC: Os senadores ocupam metade do espaço (menos o gap). O 3º não cabe e desce centralizado. */
    .senadores-grid > div { flex: 0 0 calc(50% - 7.5px); max-width: calc(50% - 7.5px); } 
}

