/* ===================================================================
   CSS FINAL E COMPLETO - MOITA NEWS (17/06/2025)
   
   1. Configurações Globais e Variáveis
   2. Cabeçalho (Header) e Pesquisa
   3. Layout Principal da Página de Notícias
   4. Grids de Notícias
   5. Cards de Notícia (Article Cards)
   6. Página de Artigo Individual
   7. Rodapé (Footer)
   8. Responsividade (Media Queries)
=================================================================== */


/* =================================== */
/* 1. CONFIGURAÇÕES GLOBAIS E VARIÁVEIS */
/* =================================== */
:root {
    --azul: #0D2C54;
    --amarelo: #ffcc01;
    --branco: #FFFFFF;
    --preto: #212529;
    --cinza-claro: #f8f9fa;
    --font-poppins: 'Poppins', sans-serif;
    --font-spartan: 'League Spartan', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-poppins);
    color: var(--preto);
    background-color: var(--branco);
    padding-top: 80px; /* Compensa a altura do cabeçalho fixo */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main > section {
    padding: 60px 0;
}

.section-title {
    font-family: var(--font-spartan);
    font-size: 2.5rem;
    color: var(--azul);
    text-align: center;
    margin-bottom: 50px;
}


/* =================================== */
/* 2. CABEÇALHO (HEADER) E PESQUISA    */
/* =================================== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--azul);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 40px; /* Espaçamento entre logo, pesquisa e menu */
}

#header .logo img {
    height: 50px;
    display: block;
}

#form-pesquisa {
    flex-grow: 1; /* Faz a pesquisa ocupar o máximo de espaço disponível */
    display: flex;
}

#campo-pesquisa-header {
    width: 100%;
    padding: 10px 20px;
    font-family: var(--font-poppins);
    font-size: 0.95rem;
    background-color: #2A5894; 
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--branco);
    transition: all 0.3s ease;
}

#campo-pesquisa-header::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#campo-pesquisa-header:focus {
    outline: none;
    background-color: #3e6ab5;
    border-color: var(--amarelo);
}

#header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 0;
    margin: 0;
}

#header nav a {
    color: var(--amarelo);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

#header nav a:hover {
    color: var(--branco);
}

.btn-afiliado {
    background-color: var(--amarelo);
    color: var(--preto) !important;
    padding: 10px 20px;
    border-radius: 20px;
    white-space: nowrap; /* Impede que o texto quebre */
}


/* ========================================== */
/* 3. LAYOUT PRINCIPAL DA PÁGINA DE NOTÍCIAS  */
/* ========================================== */
#bloco-destaque-principal {
    margin-top: 40px;
    padding-top: 0;
}

.destaque-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.noticias-laterais {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* =================================== */
/* 4. GRIDS DE NOTÍCIAS                */
/* =================================== */
.grid-noticias-principais {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.grid-outras-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

#nenhum-resultado h3 {
    color: #555;
    font-weight: normal;
}


/* =================================== */
/* 5. CARDS DE NOTÍCIA (ARTICLES)      */
/* =================================== */
.card-noticia,
.card-noticia-menor {
    background-color: var(--branco);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-noticia:hover,
.card-noticia-menor:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.card-noticia img,
.card-noticia-menor img {
    border-bottom: 3px solid var(--amarelo);
    width: 100%;
}

.card-conteudo {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-conteudo h3 {
    font-family: var(--font-spartan);
    color: var(--azul);
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
}

.card-conteudo p {
    flex-grow: 1;
    margin-bottom: 20px;
    line-height: 1.6;
}

.leia-mais {
    font-weight: bold;
    align-self: flex-start;
    padding: 10px 18px;
    background-color: var(--amarelo);
    color: var(--preto);
    border-radius: 5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.leia-mais:hover {
    background-color: var(--azul);
    color: var(--branco);
    text-decoration: none;
}


/* =================================== */
/* 6. PÁGINA DE ARTIGO INDIVIDUAL      */
/* =================================== */
.article-container {
    max-width: 850px;
    margin: 40px auto 0 auto; /* Adiciona margem no topo */
    padding: 20px;
}

.article-header h1 {
    font-family: var(--font-spartan);
    font-size: 2.8rem;
    color: var(--azul);
    line-height: 1.2;
    margin-bottom: 15px;
}

.article-meta {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 30px;
}

.featured-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 40px;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-content p { margin-bottom: 1.5em; }
.article-content h2, .article-content h3 { font-family: var(--font-spartan); color: var(--azul); margin-top: 2.5em; margin-bottom: 1em; }
.article-content h2 { font-size: 2rem; }
.article-content h3 { font-size: 1.6rem; }
.article-content blockquote { margin: 2em 0; padding-left: 1.5em; border-left: 4px solid var(--amarelo); font-style: italic; font-size: 1.2rem; color: #555; }
.article-content ul, .article-content ol { margin-bottom: 1.5em; padding-left: 1.5em; }

.social-share { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; display: flex; align-items: center; gap: 15px; }
.social-share span { font-weight: bold; color: var(--azul); }
.share-btn { color: var(--branco); padding: 8px 15px; border-radius: 5px; font-size: 0.9rem; text-decoration: none; }
.share-btn.whatsapp { background-color: #25D366; }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.linkedin { background-color: #0A66C2; }

.voltar-link { display: inline-block; margin-top: 40px; font-weight: bold; color: var(--azul); }




/* =================================== */
/* 7. RODAPÉ (FOOTER)                  */
/* =================================== */
footer {
    background-color: var(--azul);
    color: var(--branco);
    text-align: center;
    padding: 20px;
    margin-top: 60px;
}

/* --- SEÇÃO CONTATO --- */
#contato {
    padding: 80px 0;
}

#contato h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-info h3, .contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--azul);
}

.btn-whatsapp {
    display: inline-block;
    background-color: #25D366;
    color: var(--branco);
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin: 10px 0 20px;
    transition: transform 0.3s;
}

.btn-whatsapp:hover {
    transform: scale(1.05);
}

.email-info {
    margin-bottom: 20px;
}

.social-icons a {
    margin-right: 15px;
}
.social-icons img {
    border-radius: 50%;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-poppins);
    font-size: 1rem;
}

.btn-form {
    background-color: var(--azul);
    color: var(--branco);
    padding: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-form:hover {
    background-color: #0b2241;
}

/* Estilo para a caixa de mensagem (textarea) ficar igual aos outros campos */
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-poppins);
    font-size: 1rem;
    resize: vertical; /* Opcional: Permite que o usuário aumente a altura da caixa */
}



/* =================================== */
/* 8. RESPONSIVIDADE (MEDIA QUERIES)   */
/* =================================== */
@media (max-width: 992px) {
    .destaque-grid {
        grid-template-columns: 1fr;
    }
    #header .container {
        gap: 20px; /* Diminui o gap em telas menores */
    }
    #campo-pesquisa-header {
        font-size: 0.85rem; /* Diminui a fonte da pesquisa */
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 0;
    }

    #header {
        position: relative;
        height: auto;
        padding: 15px 0;
    }

    #header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    #form-pesquisa {
        width: 90%; /* Pesquisa ocupa quase toda a largura */
    }

    #header nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }

    .grid-noticias-principais,
    .grid-outras-noticias {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 2.2rem;
    }
}

/* ======================================================== */
/* Estilos da Notificação "Toast" com Barra de Progresso    */
/* ======================================================== */

/* A caixa da notificação */
#toast-notification {
    position: fixed; /* Fica flutuando na tela */
    top: 20px;
    right: 20px;
    background-color: #155724; /* Verde escuro (sucesso) */
    color: #d4edda; /* Texto verde claro */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 9999; /* Garante que fique acima de tudo */
    width: 320px;
    overflow: hidden; /* Esconde a parte da barra de progresso que "sai" da caixa */
    
    /* Animação de entrada e saída */
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Estado escondido */
#toast-notification.toast-hidden {
    opacity: 0;
    transform: translateY(-40px);
}

/* Estado visível */
#toast-notification.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

/* A barra de progresso no rodapé da notificação */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background-color: var(--amarelo); /* Cor da barra */
    animation: shrink 5s linear forwards; /* <-- A MÁGICA ACONTECE AQUI */
}

/* Animação que faz a barra diminuir de 100% para 0% em 5 segundos */
@keyframes shrink {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}