/* style.css - Versão Completa com Imagem de Fundo Maior */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    scroll-behavior: smooth;
}

:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3f37c9;
    --secondary: #f72585;
    --accent: #4cc9f0;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --dark: #2b2d42;
    --gray: #8d99ae;
    --light: #edf2f4;
    --white: #ffffff;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    --shadow-hover: 0 30px 50px rgba(67, 97, 238, 0.25);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Header com efeito glassmorphism */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(67, 97, 238, 0.1);
    width: 100%;
    max-width: 100vw;
}

/* Overlay para menu mobile */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    transition: var(--transition);
    margin-right: auto;
}

.logo:hover {
    transform: scale(1.05);
}

.logo a {
    display: inline-flex;
    line-height: 0;
    text-decoration: none;
}

.logo img {
    max-height: 55px;
    width: auto;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(67, 97, 238, 0.2));
    transition: opacity 0.2s;
}

.logo a:hover img {
    opacity: 0.85;
}

/* Menu Desktop com efeitos modernos */
.menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.menu li {
    list-style: none;
}

.menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.menu a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.menu a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.menu a:hover::before {
    width: 200px;
    height: 200px;
}

.menu a.ativo {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.menu a.ativo::before {
    display: none;
}

/* Menu Hamburguer */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
    background: transparent;
    border: none;
    width: 45px;
    height: 45px;
    pointer-events: auto;
    border-radius: 50%;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: rgba(67, 97, 238, 0.1);
}

.menu-toggle span {
    width: 25px;
    height: 2.5px;
    background: var(--dark);
    transition: var(--transition);
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

/* Container com animação */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeInUp 0.8s ease-out;
    width: 100%;
    overflow-x: hidden;
}

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

/* ===== HERO SECTION - CORRIGIDO COM IMAGEM MAIOR ===== */
.hero, .hero-home {
    padding: 0;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.6s ease-out;
    width: 100%;
    max-width: 100%;
    isolation: isolate;
    min-height: 360px;
    display: block;
}

/* Quando tem imagem de fundo */
.hero[style*="url"], .hero-home[style*="url"] {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* Desktop grande */
@media (min-width: 1200px) {
    .hero, .hero-home {
        min-height: 480px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1199px) {
    .hero, .hero-home {
        min-height: 340px;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero::before, .hero-home::before {
    display: none;
}

.hero::after, .hero-home::after {
    display: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-caption {
    background: var(--white);
    border: 1px solid rgba(67, 97, 238, 0.12);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    margin: 0 auto 2.25rem;
    padding: 1rem 1.25rem;
    text-align: center;
}

.hero-caption h1 {
    font-size: 1.7rem;
    margin-bottom: 0.55rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.hero-caption p {
    font-size: 1rem;
    max-width: 680px;
    margin: 0 auto;
    color: var(--gray);
    font-weight: 400;
    line-height: 1.55;
}

/* Cards com design moderno */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
    animation: fadeIn 0.8s ease-out;
    width: 100%;
}

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    animation: scaleIn 0.5s ease-out backwards;
    width: 100%;
    max-width: 100%;
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.6s ease;
    transform-origin: left;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.card:hover::before {
    transform: scaleX(1);
}

.card-imagem {
    width: 100%;
    max-width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card:hover .card-imagem {
    transform: scale(1.1);
}

.card-conteudo {
    padding: 1.8rem;
    position: relative;
    z-index: 1;
    background: var(--white);
}

.card h3 {
    color: var(--dark);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.card:hover h3 {
    color: var(--primary);
}

.card .data {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.25rem 1rem;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(247, 37, 133, 0.1));
    border-radius: 30px;
    font-weight: 500;
}

.card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Botões modernos */
.btn {
    display: inline-block;
    padding: 0.875rem 2.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.4);
}

.btn:hover::before {
    opacity: 1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}

.btn-outline::before {
    display: none;
}

/* Seção de título */
.section-title {
    color: var(--dark);
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

/* Página Sobre */
.sobre-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin: 3rem 0;
}

.sobre-imagem {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    height: auto;
    border: 4px solid var(--white);
}

.sobre-imagem:hover {
    transform: scale(1.03) rotate(1deg);
    box-shadow: var(--shadow-hover);
}

.informacoes-contato {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(247, 37, 133, 0.05));
    padding: 3rem;
    border-radius: var(--radius-lg);
    margin: 3rem 0;
    border: 1px solid rgba(67, 97, 238, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.informacoes-contato:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.informacoes-contato h3 {
    color: var(--primary);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.contato-item {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.contato-item:hover {
    background: var(--white);
    transform: translateX(10px);
    box-shadow: var(--shadow-sm);
}

.contato-item strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Paginação */
.paginacao {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.pagina-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--white);
    border: 1px solid #e9ecef;
    color: var(--dark);
    text-decoration: none;
    border-radius: 30px;
    transition: var(--transition);
    min-width: 45px;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.pagina-link:hover,
.pagina-link.ativo {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

/* Filtros */
.filtros {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filtro-btn {
    padding: 0.8rem 2rem;
    background: var(--white);
    border: 1px solid #e9ecef;
    color: var(--dark);
    text-decoration: none;
    border-radius: 30px;
    transition: var(--transition);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.filtro-btn:hover,
.filtro-btn.ativo {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

/* Documentos */
.documento-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(67, 97, 238, 0.1);
    position: relative;
    overflow: hidden;
}

.documento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    transition: height 0.4s ease;
}

.documento-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.documento-card:hover::before {
    height: 100%;
}

.documento-titulo {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.documento-observacao {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border-left: 4px solid #ffc107;
    padding: 1.2rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    color: #856404;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: var(--white);
    padding: 0.875rem 1.8rem;
    text-decoration: none;
    border-radius: 30px;
    transition: var(--transition);
    align-self: flex-start;
    margin-top: auto;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

.btn-pdf:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(220, 53, 69, 0.4);
}

/* Eventos */
.evento-info {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(247, 37, 133, 0.05));
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
    padding: 0.5rem;
    transition: var(--transition);
}

.info-item:hover {
    transform: translateX(10px);
}

.info-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.3);
}

/* Rodapé moderno */
footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--white);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--success));
    animation: gradientMove 5s linear infinite;
    background-size: 300% 100%;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.footer-conteudo {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    position: relative;
    z-index: 1;
}

footer h4 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.8rem;
    color: var(--white);
}

footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

footer div:hover h4::after {
    width: 80px;
}

footer p {
    opacity: 0.8;
    line-height: 1.8;
    transition: opacity 0.3s ease;
    margin-bottom: 0.8rem;
}

footer p:hover {
    opacity: 1;
}

.copyright {
    text-align: center;
    padding-top: 3rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.copyright:hover {
    opacity: 1;
}

/* Animações extras */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.float-animation {
    animation: float 4s ease-in-out infinite;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
    }
    
    .logo img {
        max-height: 45px;
    }
    
    .menu-toggle {
        display: flex !important;
    }
    
    .menu {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        z-index: 1001 !important;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 90px 0 30px 0 !important;
        margin: 0 !important;
        list-style: none !important;
        display: block !important;
        box-shadow: -5px 0 30px rgba(0,0,0,0.2) !important;
        overflow-y: auto;
        border-radius: 0 20px 20px 0;
    }
    
    .menu.active {
        left: 0 !important;
    }
    
    .menu li {
        width: 100% !important;
        border-bottom: 1px solid rgba(67, 97, 238, 0.1);
    }
    
    .menu a {
        display: block !important;
        padding: 1.2rem 2rem !important;
        font-size: 1.1rem !important;
        color: var(--dark) !important;
        text-decoration: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        width: 100% !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    
    .menu a:hover {
        background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(247, 37, 133, 0.1)) !important;
        padding-left: 2.5rem !important;
    }
    
    .menu a.ativo {
        color: var(--white) !important;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
        background: var(--primary);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
        background: var(--primary);
    }
    
    .hero-caption h1 {
        font-size: 1.4rem;
    }
    
    .hero-caption p {
        font-size: 0.95rem;
    }
    
    .hero, .hero-home {
        min-height: clamp(170px, 52vw, 230px);
        margin-bottom: 0.75rem;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
        background-color: #0f172a;
    }

    .hero-caption {
        padding: 0.9rem 0.95rem;
        margin-bottom: 1.8rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .container {
        padding: 1.2rem;
    }
    
    .footer-conteudo {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sobre-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .informacoes-contato {
        padding: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero-caption h1 {
        font-size: 1.2rem;
    }
    
    .hero-caption p {
        font-size: 0.9rem;
    }
    
    .hero, .hero-home {
        min-height: clamp(160px, 56vw, 210px);
        margin-bottom: 0.6rem;
        border-radius: 20px;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
    }

    .hero-caption {
        padding: 0.8rem 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.8rem;
        font-size: 0.9rem;
    }
    
    .logo img {
        max-height: 40px;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .menu {
        width: 90% !important;
    }
    
    .card-conteudo {
        padding: 1.5rem;
    }
    
    .card h3 {
        font-size: 1.2rem;
    }
}

/* ===== DARK MODE ===== */

/* Botão dark mode */
.dark-mode-toggle {
    background: transparent;
    border: 2px solid rgba(67, 97, 238, 0.3);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: var(--transition);
    color: var(--dark);
    flex-shrink: 0;
    line-height: 1;
}

.dark-mode-toggle:hover {
    background: rgba(67, 97, 238, 0.1);
    border-color: var(--primary);
    transform: scale(1.1) rotate(20deg);
}

/* Mostrar/ocultar ícones conforme o modo */
html:not(.dark-mode) .dark-mode-toggle .light-icon { display: none; }
html.dark-mode .dark-mode-toggle .dark-icon { display: none; }

/* Variáveis do modo escuro */
html.dark-mode {
    color-scheme: dark;
}

html.dark-mode body {
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 100%);
    color: #e2e8f0;
}

html.dark-mode header {
    background: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(67, 97, 238, 0.25);
}

html.dark-mode .menu-toggle span {
    background: #e2e8f0;
}

html.dark-mode .dark-mode-toggle {
    border-color: rgba(148, 163, 184, 0.4);
    color: #e2e8f0;
}

html.dark-mode .dark-mode-toggle:hover {
    background: rgba(67, 97, 238, 0.2);
    border-color: var(--primary-light);
}

/* Menu mobile - fundo escuro */
@media (max-width: 768px) {
    html.dark-mode .menu {
        background: rgba(15, 23, 42, 0.98) !important;
    }

    html.dark-mode .menu a {
        color: #e2e8f0 !important;
        border-bottom-color: rgba(67, 97, 238, 0.15) !important;
    }

    html.dark-mode .menu a:hover {
        background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(247, 37, 133, 0.1)) !important;
    }

    html.dark-mode .menu a.ativo {
        color: var(--white) !important;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    }
}

/* Menu desktop - links */
html.dark-mode .menu a {
    color: #e2e8f0;
}

/* Cards */
html.dark-mode .card {
    background: #1e293b;
    border-color: rgba(67, 97, 238, 0.2);
}

html.dark-mode .card-conteudo {
    background: #1e293b;
}

html.dark-mode .card h3 {
    color: #e2e8f0;
}

html.dark-mode .card p {
    color: #94a3b8;
}

html.dark-mode .card .data {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(247, 37, 133, 0.15));
    color: #94a3b8;
}

html.dark-mode .hero-caption {
    background: #1e293b;
    border-color: rgba(67, 97, 238, 0.24);
}

html.dark-mode .hero-caption h1 {
    color: #e2e8f0;
}

html.dark-mode .hero-caption p {
    color: #94a3b8;
}

/* Paginação e filtros */
html.dark-mode .pagina-link {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-mode .filtro-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* Documentos */
html.dark-mode .documento-card {
    background: #1e293b;
    border-color: rgba(67, 97, 238, 0.2);
}

html.dark-mode .documento-titulo {
    color: #e2e8f0;
}

html.dark-mode .documento-observacao {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.08));
    color: #fcd34d;
}

/* Eventos */
html.dark-mode .evento-info {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.12), rgba(247, 37, 133, 0.08));
    border-color: rgba(67, 97, 238, 0.2);
}

/* Sobre / Contato */
html.dark-mode .informacoes-contato {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.12), rgba(247, 37, 133, 0.08));
    border-color: rgba(67, 97, 238, 0.25);
}

html.dark-mode .contato-item {
    background: rgba(30, 41, 59, 0.7);
}

html.dark-mode .contato-item:hover {
    background: #1e293b;
}

/* Títulos e textos gerais */
html.dark-mode .section-title {
    color: #e2e8f0;
}

html.dark-mode h1, html.dark-mode h2, html.dark-mode h3,
html.dark-mode h4, html.dark-mode h5, html.dark-mode h6 {
    color: #e2e8f0;
}

html.dark-mode p {
    color: #94a3b8;
}

/* Blocos de texto em fundo branco inline */
html.dark-mode [style*="background: white"],
html.dark-mode [style*="background:#fff"],
html.dark-mode [style*="background: #fff"] {
    background: #1e293b !important;
    color: #94a3b8 !important;
}

/* Transição suave ao trocar de modo */
body {
    transition: background 0.4s ease, color 0.3s ease;
}

header {
    transition: background 0.4s ease, border-color 0.3s ease;
}

.card, .card-conteudo, .documento-card, .evento-info,
.informacoes-contato, .pagina-link, .filtro-btn {
    transition: var(--transition), background 0.4s ease, border-color 0.3s ease;
}

/* ===== PDF VIEWER MODAL ===== */
.pdf-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 3000;
    align-items: stretch;
    justify-content: center;
}

.pdf-modal-overlay.active {
    display: flex;
}

.pdf-modal-box {
    background: #1e293b;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100dvh;
    max-height: 100vh;
}

/* Cabeçalho do modal */
.pdf-modal-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    background: #0f172a;
    gap: 0.75rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pdf-modal-title {
    flex: 1;
    min-width: 0;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-modal-btns {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pdf-modal-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
    line-height: 1;
}

.pdf-btn-print {
    background: var(--primary);
    color: var(--white);
}

.pdf-btn-print:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.pdf-btn-download {
    background: var(--success);
    color: #0f172a;
}

.pdf-btn-download:hover {
    background: #05b386;
    transform: translateY(-1px);
}

.pdf-btn-close {
    background: var(--danger);
    color: var(--white);
}

.pdf-btn-close:hover {
    background: #d63557;
    transform: translateY(-1px);
}

/* Barra de zoom (mobile) */
.pdf-zoom-bar {
    display: none; /* mostrado via JS no mobile */
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.45rem 1rem;
    background: #162032;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pdf-zoom-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #e2e8f0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    font-size: 1.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.pdf-zoom-btn:active {
    background: rgba(255,255,255,0.28);
}

.pdf-zoom-label {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 3.2rem;
    text-align: center;
}

.pdf-zoom-hint {
    color: #64748b;
    font-size: 0.72rem;
}

/* Área das páginas renderizadas */
.pdf-pages {
    overflow: auto;
    flex: 1;
    min-height: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    background: #374151;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y; /* permite scroll mas bloqueia zoom nativo do browser */
}

/* Quando exibindo iframe (desktop), o iframe deve preencher o espaço */
.pdf-pages iframe {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: none;
    display: block;
    align-self: stretch;
}

.pdf-pages canvas {
    max-width: none;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* Estado de carregamento / erro */
.pdf-loading {
    color: #e2e8f0;
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.pdf-loading a {
    color: var(--accent);
    text-decoration: underline;
}

/* Botão "Visualizar PDF" no card — estilo de botão (sem <a>) */
button.btn-pdf {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* Responsivo mobile */
@media (max-width: 600px) {
    .pdf-modal-header {
        flex-wrap: wrap;
        padding: 0.75rem 0.9rem;
    }

    .pdf-modal-title {
        width: 100%;
        white-space: normal;
        font-size: 0.9rem;
    }

    .pdf-modal-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
}