/* 
   ARQUIVO: style.css
   PROJETO: AOFIPOL - Portal Institucional 2026
   DESCRIÇÃO: Layout Moderno com Sidebar e Grid Responsivo
*/

:root {
    --primary: #002855;    /* Azul Marinho Institucional */
    --secondary: #d90429;  /* Vermelho Alerta/Ação */
    --accent: #00509d;     /* Azul de destaque */
    --light: #f8f9fa;      /* Fundo claro */
    --dark: #111827;       /* Texto e rodapé escuro */
    --white: #ffffff;
    --transition: all 0.3s ease;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    
    /* Cores das Redes Sociais */
    --fb: #1877f2;
    --ig: #e4405f;
    --wa: #25d366;
    --yt: #ff0000;
}

/* 1. RESET E GERAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    display: block;
}

p {
    display: block !important;
    margin-bottom: 1em; /* Garante espaçamento de parágrafo */
}

/* 2. BARRA SUPERIOR (TOP BAR) */
.top-bar {
    background-color: var(--dark);
    color: var(--white);
    padding: 10px 0;
    font-size: 0.85rem;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-right: 20px;
}

.contact-info i {
    margin-right: 6px;
    color: var(--secondary);
}

.social-medias a {
    color: var(--white);
    text-decoration: none;
    margin-left: 15px;
    font-size: 1rem;
    transition: var(--transition);
}

.social-medias a:hover { transform: translateY(-3px); }
.social-medias a[title*="Facebook"]:hover { color: var(--fb); }
.social-medias a[title*="Instagram"]:hover { color: var(--ig); }
.social-medias a[title*="WhatsApp"]:hover { color: var(--wa); }
.social-medias a[title*="YouTube"]:hover { color: var(--yt); }

/* 3. HEADER E NAVEGAÇÃO */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 25px;
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover { color: var(--secondary); }

/* Botões de Ação */
.btn-member, .btn-area {
    background: var(--primary);
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: var(--transition);
}

.btn-member:hover, .btn-area:hover { background: var(--secondary) !important; }

/* 4. MENU DROPDOWN */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--secondary);
    padding: 10px 0;
}

.dropdown-content a {
    padding: 12px 20px;
    display: block;
    font-size: 0.9rem;
}

.dropdown:hover .dropdown-content { display: block; animation: fadeInUp 0.3s ease; }

/* 5. HERO SECTION */
.hero-modern {
    height: 50vh;
    min-height: 400px;
    background: linear-gradient(rgba(0,40,85,0.85), rgba(0,0,0,0.6)), url('images.unsplash.com') center/cover;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero-modern h1 { font-size: 3rem; margin: 20px 0; font-weight: 800; }
.hero-modern p { font-size: 1.2rem; max-width: 800px; margin: 0 auto 30px; opacity: 0.9; }

/* 6. LAYOUT PRINCIPAL (GRID) */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-bottom: 60px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.news-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card:hover { transform: translateY(-5px); }

.card-img { height: 180px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 20px; }
.card-body h3 { color: var(--primary); margin: 10px 0; font-size: 1.2rem; }
.card-body p { font-size: 0.9rem; color: #666; margin-bottom: 15px; }

/* 7. SIDEBAR (MAIS LIDAS) */
.sidebar { margin-top: 50px; }

.sidebar-widget {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.widget-title {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    text-transform: uppercase;
    font-weight: 800;
}

.popular-posts { list-style: none; }
.popular-posts li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.popular-posts .rank {
    font-size: 1.8rem;
    font-weight: 900;
    color: #e2e8f0;
    line-height: 1;
}

.popular-posts a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.popular-posts a:hover { color: var(--secondary); }

.sidebar-banner {
    background: var(--primary);
    color: var(--white);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

/* 8. RODAPÉ */
.footer-moderno {
    background: var(--dark);
    color: #cbd5e1;
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-about h3 { color: var(--white); margin-bottom: 20px; }
.footer-links h4 { color: var(--white); margin-bottom: 20px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #cbd5e1; text-decoration: none; }
.footer-links a:hover { color: var(--secondary); }

.footer-social { display: flex; gap: 15px; margin-top: 20px; }
.footer-social a {
    width: 35px; height: 35px; background: #2d3748;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--white); text-decoration: none;
}

.footer-bottom {
    background: #0f172a;
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
}

/* 9. RESPONSIVIDADE E MOBILE */
.mobile-menu-icon {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar { margin-top: 20px; }
    
    .mobile-menu-icon { display: block; }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow);
    }
    
    .nav-links.active { display: flex; }
    .nav-links li { margin: 10px 0; width: 100%; text-align: center; }
    
    .dropdown-content { position: static; box-shadow: none; width: 100%; display: none; }
    .hero-modern h1 { font-size: 2.2rem; }
}

@media (max-width: 480px) {
    .top-bar { display: none; }
    .hero-modern { height: auto; padding: 60px 0; }
    .hero-actions { display: flex; flex-direction: column; gap: 15px; }
    .hero-actions a { margin: 0 !important; }
}

/* ==========================================================================
   AJUSTES PARA RESPONSIVIDADE E INTERATIVIDADE (JS COMPATIBILITY)
   ========================================================================== */

@media (max-width: 992px) {
    /* Exibe o ícone do menu hambúrguer que estava oculto */
    .mobile-menu-icon {
        display: block !important;
        padding: 10px;
    }

    /* Transforma a lista de links em um menu suspenso vertical */
    .nav-links {
        display: none; /* Esconde por padrão no mobile */
        flex-direction: column;
        position: absolute;
        top: 80px; /* Altura do header */
        left: 0;
        width: 100%;
        background-color: var(--white);
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        z-index: 999;
    }

    /* Classe ativada pelo script.js */
    .nav-links.active {
        display: flex !important;
        animation: fadeInDown 0.3s ease forwards;
    }

    .nav-links li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 15px;
        width: 100%;
        border-bottom: 1px solid #f9f9f9;
    }

    /* Ajuste dos Dropdowns no Mobile */
    .dropdown-content {
        position: static; /* No mobile, ele empurra o conteúdo para baixo */
        width: 100%;
        box-shadow: none;
        background-color: #f8f9fa;
        display: none; /* Controlado pelo JS no clique */
    }

    .dropdown:hover .dropdown-content {
        display: none; /* Desativa o hover no mobile para não bugar o touch */
    }

    .btn-area {
        margin: 20px auto;
        width: 80%;
    }
}

/* Animação suave para abertura do menu */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajuste fino na Hero para telas pequenas */
@media (max-width: 480px) {
    .hero-modern h1 {
        font-size: 1.8rem;
    }
    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .hero-actions a {
        margin-left: 0 !important;
    }
}
