/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    color: #2d3748;
    line-height: 1.6;
}

/* Header */
header {
    background-color: #1e3a8a;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* DEPOIS */
.logo {
    text-decoration: none;
    color: white; /* Mantém a cor de fundo caso a imagem falhe */
}

.logo img {
    height: 80px; /* <-- Defina a altura desejada para o seu logo */
    width: auto;  /* auto' mantém a proporção da imagem */
    display: block; /* Remove possíveis espaços extra abaixo da imagem */
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    width: 250px;
    font-size: 0.9rem;
}

.search-box button {
    padding: 0.5rem 1.5rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #2563eb;
}

/* Navegação */
nav {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 2rem;
    overflow-x: auto;
}

.nav-container a {
    padding: 1rem 0;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-container a:hover {
    color: #1e3a8a;
    border-bottom-color: #3b82f6;
}

/* Container Principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* Publicidade */
.ad-top {
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
    min-height: 100px; /* Altura mínima para o "Carregando" */
    height: 250px;
    width: 100%;
    max-width: 970px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.ad-horizontal {
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
    min-height: 100px; /* Altura mínima */
    height: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 2rem 0;
}

.ad-sidebar {
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
    min-height: 250px; /* Altura mínima */
    height: 600px;
    width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.ad-sidebar-quadrado {
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
    min-height: 250px; /* Altura mínima */
    height: 250px;
    width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 3rem auto 0; /* Margem superior (igual ao .mais-lidas) e centralizado */
}

/* Ajuste para quando o anúncio carregar */
.ad-sidebar-quadrado.anuncio-carregado {
    background-color: transparent;
    border: none;
    height: auto; /* Permite que o anúncio defina a altura */
    min-height: 0;
}

/* Estilos para anúncios carregados (esconde o 'Carregando...') */
.ad-top.anuncio-carregado,
.ad-horizontal.anuncio-carregado,
.ad-sidebar.anuncio-carregado {
    background-color: transparent;
    border: none;
    height: auto; /* Permite que o anúncio defina a altura */
    min-height: 0;
}

/* Notícia Destaque */
.destaque {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.noticia-principal {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.noticia-principal img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.3s;
}

.noticia-principal:hover img {
    transform: scale(1.05);
}

.noticia-principal .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 2rem;
}

.noticia-principal .categoria {
    display: inline-block;
    background-color: #3b82f6;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.noticia-principal h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.noticia-principal .meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

.noticias-secundarias {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.noticia-card-pequeno {
    background-color: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
    display: flex; /* <-- ADICIONE ESTA LINHA */
    flex-direction: column; /* <-- ADICIONE ESTA LINHA */
}

.noticia-card-pequeno:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.noticia-card-pequeno img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.noticia-card-pequeno .conteudo {
    padding: 1rem;
    display: flex; /* <-- ADICIONE ESTA LINHA */
    flex-direction: column; /* <-- ADICIONE ESTA LINHA */
    flex-grow: 1;
}

.noticia-card-pequeno h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    flex-grow: 1; /* <-- ADICIONE ESTA LINHA */
}

.noticia-card-pequeno .meta {
    font-size: 0.75rem;
    color: #64748b;
}

/* Seção de Notícias */
.secao {
    margin-bottom: 3rem;
}

.secao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3b82f6;
}

.secao-header h2 {
    font-size: 1.5rem;
    color: #1e3a8a;
}

.secao-header a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.secao-header a:hover {
    text-decoration: underline;
}

/* Grid de Notícias */
.grid-noticias {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.noticia-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
    display: flex; /* <-- ADICIONE ESTA LINHA */
    flex-direction: column; /* <-- ADICIONE ESTA LINHA */
}

.noticia-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.noticia-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.noticia-card .conteudo {
    padding: 1.25rem;
    display: flex; /* <-- ADICIONE ESTA LINHA */
    flex-direction: column; /* <-- ADICIONE ESTA LINHA */
    flex-grow: 1; /* <-- ADICIONE ESTA LINHA */
}

.noticia-card .categoria {
    display: inline-block;
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.noticia-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    line-height: 1.4;
    flex-grow: 1; /* <-- ADICIONE ESTA LINHA */
}

.noticia-card .resumo {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.noticia-card .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* Layout com Sidebar */
.layout-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* Footer */
footer {
    background-color: #1e293b;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #3b82f6;
}

.copyright {
    color: #64748b;
    font-size: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

/* Responsividade */
@media (max-width: 1024px) {
    .destaque {
        grid-template-columns: 1fr;
    }

    .grid-noticias {
        grid-template-columns: repeat(2, 1fr);
    }

    .layout-sidebar {
        grid-template-columns: 1fr;
    }

    .ad-sidebar {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .grid-noticias {
        grid-template-columns: 1fr;
    }

    .noticias-secundarias {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ad-top {
        height: 150px;
    }
}

/* --- ESTILOS DO NOVO TOP BAR (PRE-HEADER) --- */
.top-bar {
    background-color: #1e293b; 
    color: white;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Lado Esquerdo: Ticker de Notícias */
.latest-news-ticker {
    display: flex;
    align-items: center;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.ticker-content {
    position: relative;
    height: 1.5em;
    flex: 1;
}

.ticker-item {
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-item.active {
    opacity: 1;
}

.ticker-item a {
    color: white;
    text-decoration: none;
}
.ticker-item a:hover {
    text-decoration: underline;
}

/* Lado Direito: Data, Tempo e Sociais */
.header-info-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

#dateTime {
    white-space: nowrap;
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.social-icons-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.social-icons-top .social-icon {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
    font-weight: bold;
    font-family: Arial, sans-serif;
    border: 2px solid white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.social-icons-top .social-icon.social-yt {
    font-size: 0.7rem;
}

.social-icons-top .social-icon:hover {
    opacity: 1;
    background-color: white;
    color: #1e293b;
}

/* --- CORREÇÃO DO ÍCONE E LABEL --- */

.ticker-label {
    display: flex; /* Alinha o [círculo+ícone] e o [texto] */
    align-items: center; 
    background-color: white;
    color: #1e293b;
    padding: 2px 12px 2px 3px; /* 2px topo, 12px dir, 2px baixo, 3px esq */
    border-radius: 20px; /* Borda arredondada */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-right: 1rem;
}

/* ▼▼▼ SUBSTITUA O SELETOR AQUI ▼▼▼ */
.ticker-label .fa-solid.fa-bolt {
    background-color: #5555ff; /* Cor do círculo (azul vibrante) */
    color: white; /* Cor do ícone (raio) */
    
    border-radius: 50%; /* Círculo perfeito */
    
    width: 26px; /* Tamanho do círculo */
    height: 26px; /* Tamanho do círculo */
    
    /* Correção: Usar text-align/line-height para centrar o ícone (que é um "caractere" de fonte) */
    display: inline-block;
    font-size: 13px; /* Tamanho do raio */
    line-height: 26px; /* Centraliza verticalmente (deve ser igual à altura) */
    text-align: center; /* Centraliza horizontalmente */
    
    margin-right: 0.5rem; /* Espaço entre o círculo e o texto "Últimas" */
    
    /* Impede que o ícone seja selecionado como texto */
    user-select: none;
}

.ticker-label span {
    color: #1e293b;
    vertical-align: middle; /* Garante alinhamento com o ícone */
}

/* Responsividade para o Top Bar */
@media (max-width: 768px) {
    .top-bar-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    .latest-news-ticker {
        width: 100%;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .header-info-right {
        justify-content: space-between;
        width: 100%;
    }
}

/* ============================================
   SEÇÃO SUB-DESTAQUES (BULLET POINTS) - V3 (2x2 Grid)
   ============================================ */

.secao-subdestaques {
    margin: 2.5rem 0; /* Espaçamento */
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #e2e8f0; /* Borda para separar */
}

/* * Usamos 'display: grid' para criar duas colunas 
*/
.grid-subdestaques {
    display: grid;
    grid-template-columns: 1fr 1fr; /* <-- Define 2 colunas */
    gap: 2rem; /* Espaço entre linhas e colunas */
    list-style: none;
    padding: 0;
    margin: 0;
}

.subdestaque-item {
    position: relative;
    padding-left: 1.5rem; /* Espaço para o bullet */
    /* Removemos 'flex: 1' e 'min-width' */
}

.subdestaque-item::before {
    content: '•';
    position: absolute;
    left: 0;
    top: -2px;
    color: #1e3a8a; 
    font-size: 1.5rem;
    font-weight: 700;
}

.subdestaque-item a {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748; 
    text-decoration: none;
    line-height: 1.4;
}

.subdestaque-item a:hover {
    color: #689bed;
    text-decoration: none;
}

/* Responsividade: empilha os itens (1 coluna) */
@media (max-width: 768px) {
     .grid-subdestaques {
        grid-template-columns: 1fr; /* <-- Muda para 1 coluna */
        gap: 1.5rem;
     }
}

/* ============================================
   WIDGETS DA SIDEBAR (HOME) - NOVO ESTILO
   ============================================ */

.sidebar-widget {
    margin-top: 2rem;
    background-color: #f8fafc; 
    padding: 1.5rem;
    border-radius: 8px;
}

.sidebar-widget h3 {
    font-size: 1.2rem;
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3b82f6; /* Destaque do título */
}

.sidebar-widget-lista .loading-small {
    text-align: center;
    padding: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Novo Estilo (baseado em noticia.css) */
.sidebar-item-novo {
    position: relative;
    padding: 0.85rem 0 0.85rem 1.25rem; 
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    /* Adiciona transição para o padding-left para suavizar o hover */
    transition: background-color 0.3s, padding-left 0.3s;
}

.sidebar-item-novo:last-child {
    border-bottom: none;
    padding-bottom: 0.5rem; /* Ajuste para o último item */
}

.sidebar-item-novo:first-child {
    padding-top: 0.5rem; /* Ajuste para o primeiro item */
}

.sidebar-item-novo:hover {
    background-color: #f1f5f9;
    /* Truque para o hover parecer maior */
    margin: 0 -1.5rem; 
    padding-left: 2.75rem; /* 1.5rem margin + 1.25rem padding */
    padding-right: 1.5rem;
}

/* A barra vertical usa a variável --categoria-cor definida no HTML */
.sidebar-item-novo::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem; 
    bottom: 0.85rem; 
    width: 4px; 
    /* Usa a variável de cor (com um padrão azul) */
    background-color: var(--categoria-cor, #1e3a8a); 
    border-radius: 2px;
    /* Adiciona transição para a posição */
    transition: left 0.3s;
}

.sidebar-item-novo:hover::before {
    left: 1.5rem; /* Acompanha o hover do padding */
}

.sidebar-item-novo-conteudo {
    flex: 1;
}

.sidebar-item-novo-categoria {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #3b82f6; /* A cor real é definida inline no JS */
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.sidebar-item-novo-titulo {
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
}

/* ============================================
   SISTEMA DE NOTIFICAÇÃO TOAST
   ============================================ */

/* O container que segura todas as notificações */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* O visual de cada notificação */
.toast {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 5px solid;
    opacity: 0; /* Começa invisível */
    animation: toastFadeIn 0.5s forwards;
    min-width: 300px;
}

.toast i {
    font-size: 1.2rem;
}

/* Animação de entrada */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animação de saída */
.toast.fade-out {
    animation: toastFadeOut 0.5s forwards;
}
@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* --- Tipos de Toast --- */

.toast-success {
    border-left-color: #10b981;
    color: #065f46;
}
.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
    color: #991b1b;
}
.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-left-color: #3b82f6;
    color: #1e3a8a;
}
.toast-info .toast-icon {
    color: #3b82f6;
}

/* ============================================
   SLIDER DESTAQUE PRINCIPAL (HOME)
   ============================================ */

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px; /* Mantém o estilo do .noticia-principal */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Sombra do .noticia-principal */
    height: 100%;
}

.slides-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
    /* REMOVEMOS a lógica de 'width' */
}

.slide-item {
    min-width: 100%; /* Cada slide ocupa 100% do container */
    box-sizing: border-box; 
    position: relative;
    cursor: pointer;
    overflow: hidden; /* <-- ADICIONE ESTA LINHA */
    height: 100%;
}
   

/* NOVO: Classe para a imagem de fundo do slide */
.slide-image {
    width: 100%;
    height: 100%;

    /* A MÁGICA PARA CORRIGIR A DISTORÇÃO: */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    transition: transform 0.3s ease-out;
}

/* Efeito de zoom no hover (agora no .slide-image) */
.slide-item:hover .slide-image {
    transform: scale(1.05);
}

.slide-item:hover img {
    transform: scale(1.05); /* Efeito de hover */
}

/* Reutilizando estilos do .overlay */
.slide-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 2rem;
}

.slide-item .categoria {
    display: inline-block;
    background-color: #3b82f6;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.slide-item h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.slide-item .meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Controles (Setas) */
.slider-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 41, 59, 0.5); /* Cor escura semi-transparente */
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}
.slider-control:hover {
    background-color: rgba(30, 41, 59, 0.8);
}
.slider-control.prev {
    left: 15px;
}
.slider-control.next {
    right: 15px;
}

/* Navegação (Pontos) */
.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s;
}
.nav-dot.active {
    background-color: white;
}