/* ==========================================================================
   1. VARIÁVEIS E IDENTIDADE VISUAL
   ========================================================================== */
:root {
    --primary-brown: #a37a4c;     /* Marrom médio presente nos textos e detalhes */
    --dark-brown: #5c4028;        /* Marrom escuro da base da ampulheta e títulos fortes */
    --bg-cream: #f7f3e8;          /* Bege/Creme claro do fundo do banner */
    --accent-terracota: #c85333;  /* Vermelho/Terracota do logotipo "EDUCAÇÃO" */
    --gold: #d4a359;              /* Dourado envelhecido dos detalhes */
    --white: #ffffff;
    --text-main: #4a3b32;         /* Marrom escuro acinzentado para leitura confortável */
}

/* ==========================================================================
   2. RESET E ESTRUTURA BASE (MOBILE-FIRST PADRÃO)
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    background-color: #e8e2d5; 
    background-image: linear-gradient(135deg, #e8e2d5 0%, #f7f3e8 100%);
    background-attachment: fixed;
    font-family: 'Droid Sans', sans-serif;
    color: var(--text-main);
    line-height: 1.8;
}

#wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
}

#sidebar { 
    width: 100%; 
    background: var(--dark-brown);
    padding: 20px 15px;
    transition: all 0.3s ease-in-out; 
}

#container {
    width: 100%;
    background: var(--white);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* BOTÃO HAMBÚRGUER PADRÃO (Escondido no Desktop) */
.menu-toggle {
    display: none;
}

/* ==========================================================================
   3. BANNER (FEATURED)
   ========================================================================== */
#featured {
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
    border-bottom: 6px solid var(--primary-brown);
}

#featured img {
    width: 100% !important;
    height: auto;
    display: block;
}

/* ==========================================================================
   4. CONTEÚDO E TIPOGRAFIA
   ========================================================================== */
#content {
    padding: 20px 15px; /* Compacto no Mobile */
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 600px;
    position: relative;
}

#content > *:not(#copyright) {
    flex-grow: 0;
}

#content h1, #content h2, #content h3, #content h4, #content h5 {
    color: var(--primary-brown);
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

#content h2 { 
    font-size: 24px; /* Mobile */
    border-bottom: 3px solid var(--accent-terracota);
    padding-bottom: 10px;
    text-transform: uppercase;
}

#content h3 { 
    font-size: 20px; 
    border-left: 5px solid var(--gold);
    padding-left: 15px;
}

#content p {
    margin-bottom: 1.5em; 
    line-height: 1.8;
    text-align: justify;
}

#content p:last-child {
    margin-bottom: 0;
}

#content > *:last-child:not(#copyright) {
    margin-bottom: 40px; 
}

.info-evento {
    margin-bottom: 40px;
}

/* ==========================================================================
   5. LISTAS: BULLETS DO CONTEÚDO
   ========================================================================== */
#content ul:not(#nav ul) {
    list-style: none !important;
    margin: 20px 0;
}

#content ul:not(#nav ul) li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: var(--text-main);
    text-align: justify;
}

#content ul:not(#nav ul) li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-terracota);
    border-radius: 50%;
}

/* ==========================================================================
   6. MENU LATERAL (#nav) - COM FONT-AWESOME FIXO E ALINHADO
   ========================================================================== */
#nav ul, #nav li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-indent: 0 !important;
}

#nav li::before {
    content: none !important;
    display: none !important;
}

#nav a {
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.3s all ease;
}

#nav a:hover {
    background: var(--primary-brown);
    color: var(--white) !important;
    padding-left: 20px;
}

/* ESTILIZAÇÃO COMPATÍVEL COM FONT-AWESOME */
.nav-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px !important;       /* Largura fixa força o alinhamento em coluna */
    height: auto !important;
    margin-right: 12px !important;
    font-size: 14px !important;    /* Tamanho do ícone moderno */
    background: none !important;   /* Deleta o sprite antigo */
    text-align: center;
}

/* ==========================================================================
   7. CONFIGURAÇÃO EXCLUSIVA PARA DESKTOP (Telas maiores que 950px)
   ========================================================================== */
@media (min-width: 951px) {
    /* CONTROLADOR DO "GIGANTISMO" - Mantém proporcional e centrado */
    #wrapper {
        display: flex;
        flex-direction: row;
        max-width: 1140px;    /* Site compacto, visual elegante */
        margin: 35px auto;    
        gap: 20px;            
        width: 95%;
    }

    /* Ajuste para deixar a barra lateral marrom mais estreita */
    #sidebar {
        width: 240px;         
        flex-shrink: 0;
        border-radius: 8px;
        height: fit-content;  
        padding: 22px 12px;   
        position: static;     
    }

    /* Box branco elegante e equilibrado */
    #container {
        flex: 1;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    }
    
    #content {
        padding: 40px 50px 50px 50px; /* Mais área de respiro interna */
    }

    /* AJUSTE CIRÚRGICO DO RODAPÉ EM DESKTOP PARA BATER COM O PADDING (50px) */
    #copyright {
        margin-left: -50px !important; 
        margin-right: -50px !important;
        margin-bottom: -50px !important; 
        width: calc(100% + 100px) !important;
        padding: 30px 50px !important;
    }

    #content h2 { 
        font-size: 28px; 
    }

    #nav a {
        padding: 9px 12px;    /* Menu mais fino e profissional */
        font-size: 12.5px;
    }
}

/* ==========================================================================
   8. RESPONSIVIDADE EXCLUSIVA PARA MENU HAMBÚRGUER (MOBILE - Até 950px)
   ========================================================================== */
@media (max-width: 950px) {
    /* Ativa e estiliza o contêiner do botão hambúrguer */
    .menu-toggle { 
        display: flex !important; 
        flex-direction: column;
        justify-content: space-around;
        position: fixed;
        top: 15px;
        right: 15px;
        width: 42px;
        height: 38px;
        background: var(--dark-brown);
        border: none;
        padding: 9px;
        border-radius: 6px;
        cursor: pointer;
        z-index: 9999;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    /* Linhas internas do botão */
    .menu-toggle .bar {
        width: 100%;
        height: 3px;
        background-color: var(--white);
        display: block;
        transition: all 0.3s ease-in-out;
    }

    /* EFEITO DE ANIMAÇÃO TRANSFORMA EM "X" */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Configuração da barra lateral como gaveta deslizante */
    #sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        width: 280px;
        height: 100vh;
        background: var(--dark-brown); /* Corrigido de roxo para o marrom da identidade */
        z-index: 9998;
        padding: 80px 20px 40px 20px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch; 
    }

    #sidebar.active {
        left: 0;
    }

    /* Garante respiro superior no mobile por causa do botão fixo */
    #container {
        padding-top: 0px;
    }
}

/* ==========================================================================
   9. COMPONENTES EXTRA (BOTÕES, TABELAS, PARCEIROS, RODAPÉ)
   ========================================================================== */

/* BOTÕES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    margin: 10px 0;
    font-family: 'Droid Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    background-color: var(--primary-brown);
    color: var(--white) !important;
    border: 2px solid var(--primary-brown);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: transparent;
    color: var(--primary-brown) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(107, 62, 154, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn.success {
    background-color: var(--accent-terracota);
    border-color: var(--accent-terracota);
}

.btn.success:hover {
    background-color: transparent;
    color: var(--accent-terracota) !important;
}

.btn i, .btn .nav-icon {
    margin-right: 10px;
    color: inherit !important;
}

/* ESTILO DE TABELAS */
#content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 14px;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden; 
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

#content table thead tr {
    background-color: var(--dark-brown);
    color: #ffffff;
    text-align: left;
    font-weight: bold;
}

#content table th, #content table td {
    padding: 12px 15px;
    border: 1px solid #eeeeee;
}

#content table tbody tr:nth-of-type(even) {
    background-color: #f8f8f8;
}

#content table tbody tr:hover {
    background-color: var(--bg-cream);
    color: var(--dark-brown);
}

@media (max-width: 768px) {
    #content { overflow-x: auto; }
    #content table { min-width: 600px; }
}

/* ESTILO DO RODAPÉ BASE (Padrão Configurado para Mobile) */
#copyright {
    margin-top: auto;
    margin-left: -15px; 
    margin-right: -15px;
    margin-bottom: -20px;
    width: calc(100% + 30px);
    padding: 20px;
    background-color: #f2ede2; 
    border-top: 2px solid var(--primary-brown);
    display: block;
    clear: both;
    text-align: center;
    border-radius: 0; 
}

#copyright p {
    margin: 0 !important; 
    padding: 0 !important;
    text-align: center !important;
    color: #777 !important;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* ALINHAMENTO DE LISTAS ORDENADAS (<ol>) */
#content ol {
    margin: 20px 0 20px 25px; 
    padding: 0;
    list-style: none;
    counter-reset: li; 
}

#content ol li {
    position: relative;
    margin-bottom: 15px;
    padding-left: 10px;
    color: var(--text-main);
    line-height: 1.6;
    text-align: justify;
}

#content ol li::before {
    content: counter(li) "."; 
    counter-increment: li;
    position: absolute;
    left: -25px; 
    color: var(--primary-brown);
    font-weight: bold;
    width: 20px;
    text-align: right;
}

#content ol ol, #content ul ol {
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: justify;
}

/* PÁGINA PARCEIROS / APOIADORES */
.intro-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 35px;
    line-height: 1.6;
}

.sponsor-section {
    margin-bottom: 50px;
}

.sponsor-section h3 {
    font-size: 18px;
    color: var(--primary-brown);
    text-transform: uppercase;
    border-bottom: 2px solid #eef2f5;
    padding-bottom: 12px;
    margin-bottom: 30px !important;
    letter-spacing: 0.5px;
}

.sponsor-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
}

.sponsor-item {
    background: #ffffff;
    border: 1px solid #f2f5f8;
    border-radius: 8px;
    padding: 25px; 
    width: calc(50% - 12px);
    min-width: 280px;
    height: 190px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; 
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.sponsor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(28, 64, 124, 0.08);
    border-color: #d0dbe5;
}

.sponsor-item img {
    width: 100%;
    height: auto;
    max-width: 90%;      
    max-height: 100px;    
    object-fit: contain;  
    display: block;
    margin: auto;         
}

.sponsor-item span {
    font-size: 11px;
    color: #4a5568;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    max-width: 100%;
    word-wrap: break-word;
    margin-top: 10px;
}

.grid-large .sponsor-item { height: 210px; }
.grid-large .sponsor-item img { max-height: 120px; }

@media (max-width: 768px) {
    .sponsor-grid { gap: 16px; }
    .grid-large .sponsor-item, .grid-medium .sponsor-item {
        width: 100%;
        height: 180px;
    }
    .sponsor-item img { max-height: 90px; }
}