/*
Theme Name: QXX News Mundo
Theme URI: https://qxx.com.br
Author: QXX
Author URI: https://qxx.com.br
Description: Tema profissional estilo G1/Globo para portais de notícias, focado em alta velocidade e SEO.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qxx-news
*/

/* =========================================================================
 * 1. BASE.CSS (Reset, fontes, variáveis e estilos globais)
 * ========================================================================= */

:root {
    /* CORES QXX NEWS (Preto/Neutro) */
    --qxx-primary: #000000; /* Preto Principal */
    --qxx-secondary: #1a1a1a; /* Preto Secundário (para painéis/acento) */
    --qxx-accent: #333333; /* Cinza Escuro (para links/acento Mundo) */

    --bg: #ffffff; /* ATUALIZADO: Fundo agora é branco para unificar o layout */
    --bg-card: #ffffff; 
    --text: #0f1115;
    --muted: #6b7280;
    --shadow: 0 5px 15px rgba(0, 0, 0, .1); /* Sombra mais discreta */
}

/* ... Mantenha o restante da Seção 1 inalterado ... */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    font-family: 'Inter', Arial, sans-serif;
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

.site-title,
.site-description { display: none !important; }

/* REVISÃO: Remove o mast-center global, mas permite que o qxx-mast-center apareça */
body .mast-center {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

/* =========================================================================
 * 2. HEADER.CSS (QXX News Header) - ATUALIZADO (Menu Lateral Estilo BBC)
 * ========================================================================= */

/* REMOVIDO: Seção .brandbar completa, pois o HTML foi limpo */

/* HEADER QXX NEWS (Preto e Fixo) */
.qxx-header {
    background: var(--qxx-primary); /* Preto */
    color: #fff;
    position: sticky; /* Fixo no topo */
    top: 0;
    z-index: 9999 !important;
    overflow: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.qxx-row { /* Substitui .g1-row */
    max-width: 1160px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    height: 64px;
    padding: 0 10px;
    align-items: center;
}

.qxx-left { justify-self: start; } /* Substitui .left */
.qxx-right { justify-self: end; } /* Substitui .right */

.qxx-mast-center { /* Substitui header.g1 .mast-center */
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 18px;
    max-height: 48px;
}

/* LOGOS (QXX News) */
.logo-qxx-link { /* Substitui .logo-center, .logo-g1-link, .logo-mundo-link */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-qxx-site { /* Substitui .logo-g1, .logo-mundo, .custom-logo */
    height: 42px;
    width: auto;
    object-fit: contain;
}

/* 🎯 CORREÇÃO: Remove o texto de fallback para aparecer apenas o logo */
.logo-text-fallback { /* Estilo para o texto 'QXX News' se não houver imagem */
    display: none !important; 
}

@media (min-width: 1024px) {
    .logo-qxx-site { height: 54px; }
}

/* MOBILE HEADER */
@media (max-width: 768px) {
    .qxx-header .qxx-row {
        height: 64px;
        grid-template-columns: auto 1fr auto;
    }
    .logo-qxx-site { height: 38px; }
}

/* BOTÕES MENU/BUSCA (Novas Classes) */
.btn-qxx {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    transition: color 0.2s;
}

.btn-qxx:hover {
    color: #cccccc;
}

.btn-qxx svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
    transition: opacity 0.2s, transform 0.2s; /* Adicionado transição para ícones */
}

@media (max-width: 768px) {
    .btn-qxx span { display: none; }
}

/* Ícone de fechar (X) - Oculto por padrão */
.icon-close { display: none !important; } 

/* ========== MENU (BARRA LATERAL / FULLSCREEN MOBILE) ========== */

/* Menu Desktop (Pop-up) */
.menu-panel {
    position: absolute;
    left: 10px;
    top: 64px;
    width: 280px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 10px;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: .18s;
    z-index: 10000 !important;
}

/* Compatibilidade com seu JS (classe 'show') */
.menu-panel.show,
.menu-panel[aria-hidden="false"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.menu-title {
    font-weight: 900;
    color: var(--qxx-primary); /* Título do menu preto */
    padding: 10px;
    border-bottom: 1px solid #f2f4f7;
    margin-bottom: 5px;
}

.menu-list a {
    display: block; /* Faz o link ocupar a largura toda */
    padding: 10px;
    border-radius: 10px;
    color: #111;
    font-weight: 800;
}
.menu-list a:hover { background: #f2f4f7; }

/* ESTILO DO MENU BARRA LATERAL (MOBILE - Estilo BBC) */
@media (max-width: 768px) {
    /* Menu lateral cobre a tela inteira (Estilo BBC) */
    .menu-panel {
        position: fixed; /* Fixo na tela */
        top: 64px;
        left: 0;
        right: auto;
        bottom: 0;
        width: 100%;
        max-width: 320px; /* Largura lateral do painel */
        height: calc(100vh - 64px); /* Altura da tela menos o header */
        border-radius: 0; /* Tira borda arredondada */
        border: none;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%); /* Esconde à esquerda */
        transition: transform 0.3s ease-out; /* Transição mais suave para lateral */
    }

    .menu-panel.show,
    .menu-panel[aria-hidden="false"] {
        transform: translateX(0); /* Mostra vindo da esquerda */
    }
    
    /* Quando o menu está aberto, troca o ícone no botão (Requer o JS ajustado) */
    #btnMenu.menu-open .icon-menu { display: none !important; }
    #btnMenu.menu-open .icon-close { display: block !important; }
}

/* ========== BUSCA ========== */
.search-wrap {
    position: absolute;
    right: 10px;
    top: 64px;
    width: min(560px, calc(100% - 20px));
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: .18s;
    z-index: 10000 !important;
}

/* Compatibilidade com seu JS (classe 'show') */
.search-wrap.show,
.search-wrap[aria-hidden="false"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    display: flex;
    padding: 10px;
}

.search-box input {
    border: none;
    flex: 1;
    font-size: 16px;
    outline: none;
    padding: 0 10px; /* Adicionado padding para melhor espaçamento interno */
}

.search-box button {
    background: var(--qxx-primary); /* Botão de busca preto */
    border: none;
    color: #fff;
    font-weight: 900;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}

/* =========================================================================
 * 3. HOME.CSS (Feed, Cards QXX News G1-like) - AJUSTE FINAL DE LAYOUT
 * ========================================================================= */

/* CONTAINER EXTERNO (Substitui .container .feed) */
.qxx-pagina-feed-final {
    padding: 0px 0 34px !important; /* REDUZIDO: Tira o padding-top excessivo */
    background: transparent !important;
}

/* CONTAINER PRINCIPAL (Centraliza e limita a largura) */
.qxx-feed-list-container {
    max-width: 680px !important; /* Limita a largura em DESKTOP */
    margin: 0 auto !important; /* Centraliza */
    padding: 0 !important; /* REMOVIDO: Tira o padding lateral que causava o espaço branco extra nas bordas do contêiner */
    box-shadow: 0 0 10px rgba(0,0,0,0.05); /* ADICIONADO: Sombra leve para criar o efeito de "fundo" */
    background: var(--bg-card); /* Garante que o fundo do contêiner do feed é branco */
}

/* CARD (A Unidade da Notícia na Lista) - Classe usada no último HTML */
.qxx-card-final-limpo { 
    display: block !important;
    background: var(--bg-card) !important;
    /* ADICIONADO: Borda inferior como o G1 para separar as notícias */
    border-bottom: 1px solid #e5e7eb !important; 
    padding: 20px 15px !important; /* AJUSTADO: Padding lateral para não colar na borda do container, e padding vertical de 20px */
    margin: 0 !important; /* ESSENCIAL: Garante que não haja margem vertical entre os cards */
    overflow: hidden !important;
}

/* WRAPPER DENTRO DO CARD (Para layout da lista: imagem à direita) */
.qxx-card-final-wrap {
    display: flex !important; 
    flex-direction: row-reverse !important; /* Imagem fica à direita */
    align-items: flex-start !important; 
    gap: 20px !important; /* Espaço entre imagem e texto */
}


/* IMAGEM (Miniatura) */
.qxx-final-thumb-link {
    width: 180px !important; 
    height: 120px !important;
    min-width: 180px !important; 
    overflow: hidden !important;
    flex-shrink: 0 !important; 
    border-radius: 4px !important;
}

.qxx-final-thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
    display: block !important;
}

/* O Conteúdo (título, resumo, meta) */
.qxx-final-info-box {
    flex-grow: 1 !important;
    min-height: 120px !important;
    padding-right: 20px; /* Garante que o texto não fique colado no lado direito da tela (opcional) */
}


/* TÍTULO (Resolvendo a 'repetição' visual com o tamanho correto) */
.qxx-final-title {
    font-size: 1.5rem !important; /* Tamanho de título G1 */
    line-height: 1.2 !important;
    margin: 0 0 8px 0 !important;
    font-weight: 700 !important;
    color: var(--qxx-primary) !important; /* Garante a cor */
}

/* RESUMO/EXCERPT */
.qxx-final-excerpt {
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
}

.qxx-final-meta {
    color: #777 !important;
    font-size: .8em !important;
    text-transform: uppercase !important;
    margin-top: 5px !important;
}
.qxx-final-category { font-weight: 600 !important; color: var(--qxx-accent) !important; }

/* -- MEDIA QUERY (Mobile) -- */
@media (max-width: 768px) {
    /* O container do feed deve ocupar toda a largura */
    .qxx-feed-list-container {
        max-width: 100% !important; 
        padding: 0 !important; /* REMOVIDO: Tira o padding lateral que causava o espaço branco extra nas bordas do contêiner */
        box-shadow: none;
    }

    /* AJUSTE MOBILE: Garante que o CARD tenha padding lateral no mobile */
    .qxx-card-final-limpo {
         padding: 15px 10px !important; /* Padding lateral de 10px no mobile */
    }

    /* O Wrapper do Card deve forçar o empilhamento vertical (imagem sobre o texto) */
    .qxx-card-final-wrap {
        flex-direction: column !important; 
        gap: 0 !important;
    }

    /* A imagem deve ocupar 100% da largura no topo */
    .qxx-final-thumb-link {
        order: 1 !important; /* Imagem no topo */
        width: 100% !important;
        height: auto !important;
        min-width: 100% !important;
        margin-bottom: 10px !important;
    }

    .qxx-final-thumb-img {
        width: 100% !important;
        height: auto !important;
    }

    /* O box de informação (título, resumo) deve vir abaixo da imagem */
    .qxx-final-info-box {
        order: 2 !important; /* Texto abaixo */
        min-height: auto !important;
        padding: 0 !important; /* Remove qualquer padding que force deslocamento */
    }

    /* O Título de mobile fica um pouco menor */
    .qxx-final-title { font-size: 1.2rem !important; }
    .qxx-final-excerpt { font-size: 0.9rem !important; }
}


/* =========================================================================
 * 4. SINGLE.CSS (Página de Matéria QXX News) - REVISADO PARA ANÚNCIOS
 * ========================================================================= */

body.single {
    background: #ffffff !important;
}

.qxx-single-wrap, /* Substitui .single-wrap */
.qxx-single-article { /* Substitui .single-article */
    background: #ffffff !important;
}

.qxx-single-wrap {
    max-width: 960px;
    margin: 0 auto 40px;
    padding: 4px 20px 40px !important;
}

.qxx-single-header { margin-bottom: 16px; }

/* Título Principal */
.qxx-single-title { /* Substitui .single-title */
    font-size: 38px; /* Aumentado um pouco para ser mais impactante (G1-like) */
    line-height: 1.2;
    font-weight: 900;
    color: var(--qxx-primary) !important;
    margin-bottom: 15px;
}

/* Subtítulo */
.qxx-single-subtitle { /* Substitui .single-subtitle */
    font-size: 20px; /* Aumentado para dar mais destaque */
    color: #4b5563 !important;
    margin-bottom: 25px;
}

/* Autor / Meta */
.qxx-single-meta-top { /* Substitui .single-meta-top */
    color: var(--muted);
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
}

.qxx-single-meta-top .qxx-single-author { /* Substitui .single-author */
    font-weight: 700;
    color: var(--qxx-primary) !important; /* Autor em preto para destaque */
}

/* Compartilhamento (Botões) */
.qxx-single-share { /* Substitui .single-share */
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.qxx-btn-share { /* Substitui .btn-share */
    /* Removido width/height fixos para usar padding e texto */
    padding: 8px 12px; 
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.qxx-btn-share svg {
    width: 18px;
    height: 18px;
    margin-right: 5px;
}

.qxx-btn-share--whats {
    background-color: #25d366;
    color: #ffffff;
    border: 1px solid #25d366;
}
.qxx-btn-share--fb {
    background-color: #1877f2;
    color: #ffffff;
    border: 1px solid #1877f2;
}
.qxx-btn-share--copy {
    background-color: #ffffff;
    color: var(--qxx-primary);
    border: 1px solid var(--qxx-primary);
}

/* ⬅️ NOVO: ESTILO PARA BLOCOS DE ANÚNCIO (Solicitação #1 e #3) */
.qxx-ad-block {
    margin: 30px auto; /* Espaço acima/abaixo, centralizado */
    padding: 15px;
    text-align: center;
    min-height: 100px;
    background-color: #f7f7f7;
    border: 1px dashed #ccc;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagem principal */
/* 🎯 CORREÇÃO: Garante que a imagem principal não ultrapasse o contêiner */
.qxx-single-thumb-img { /* Substitui .single-thumb-img */
    width: 100%;
    max-width: 100%; /* Garante que não estoure */
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
    display: block;
}

/* Conteúdo */
.qxx-single-content { /* Substitui .single-content */
    font-size: 1.15rem; /* Aumentado para melhor legibilidade */
    line-height: 1.7;
    color: #111827;
}

.qxx-single-content p { 
    margin-bottom: 1.5em; /* Ajustado para melhor espaçamento G1 */
    text-align: justify; /* Alinhamento justificado para conteúdo */
}

@media (max-width: 768px) {
    .qxx-single-title { font-size: 28px; }
    .qxx-single-subtitle { font-size: 18px; }
    .qxx-single-content { font-size: 1rem; }
    
    /* 🎯 CORREÇÃO DE MOBILE: Botões de compartilhamento (Solicitação #2) */
    .qxx-single-share {
        flex-wrap: wrap; 
        gap: 8px; /* Reduz o espaço */
    }

    .qxx-btn-share {
        padding: 6px 10px; /* Reduz o padding */
        font-size: 0.75rem; /* Reduz a fonte */
        flex-grow: 1; 
    }
    
    .qxx-btn-share svg {
        width: 16px; /* Reduz o ícone */
        height: 16px;
        margin-right: 4px;
    }
}


/* =========================================================================
 * 5. BOTTOM-NAV.CSS (Barra fixa inferior QXX News) - REVISADO (REMOÇÃO)
 * ========================================================================= */

/* 🎯 REMOÇÃO TOTAL DA BARRA DE NAVEGAÇÃO INFERIOR NO MOBILE (Solicitação #4) */
.qxx-bottom-nav { 
    display: none !important;
}

/* CORREÇÃO: Remove o padding extra que era necessário para compensar a barra, já que ela foi removida */
@media (max-width: 768px) {
    /* ANTES: body { padding-bottom: 60px; } */
    body { padding-bottom: 0 !important; }
    
    /* ANTES: .qxx-single-wrap { padding-bottom: 80px; } */
    .qxx-single-wrap { padding-bottom: 40px !important; } /* Mantém um padding padrão */
}

/* Ocultar em Desktop (mantido, mas a regra acima já resolve) */
@media (min-width: 768px) {
    .qxx-bottom-nav { display: none !important; }
}

/* O restante do CSS do seu tema (6. EXTRAS.CSS, 7. FOOTER.CSS, etc.) deve ser mantido inalterado. */


/* =========================================================================
 * 6. EXTRAS.CSS (Correções e Utilidades)
 * ========================================================================= */

/* Correção de espaço extra (MANTIDO) */
main, .site-main, .content-area, #primary, #main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remover botão flutuante de cookies (MANTIDO) */
.cky-btn-revisit {
    display: none !important;
}

/* Ajustes gerais do bloco (Removida a classe .qxx-card antiga, mas deixamos o divisor) */
/* .qxx-card { border-bottom: 8px solid #f2f3f5; } */ 

/* Remover categoria também no single (REVISADO) */
.single-region { display: none !important; }

/* =========================================================================
 * Posts Relacionados (Leia Também)
 * ========================================================================= */
.qxx-related-posts {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.qxx-related-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--qxx-primary);
    margin-bottom: 20px;
}

.qxx-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colunas para mobile/tablet */
    gap: 20px;
}

.qxx-related-card {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
    border-bottom: 1px solid #f2f3f5;
}

.qxx-related-thumb-link {
    display: block;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 4px;
}

.qxx-related-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.qxx-related-card:hover .qxx-related-thumb {
    transform: scale(1.05);
}

.qxx-related-post-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--qxx-primary);
    margin: 0 0 5px 0;
}

.qxx-related-post-title a:hover {
    color: var(--qxx-accent);
}

.qxx-related-meta {
    font-size: 0.75rem;
    color: #999999;
    margin-top: 5px;
}

@media (min-width: 768px) {
    .qxx-related-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 colunas em desktop */
    }
}

/* 🎯 CORREÇÃO: Força todas as imagens dentro do conteúdo a serem responsivas (Single) */
.qxx-single-content img {
    max-width: 100% !important; 
    height: auto;
    display: block;
}

/* FORÇA TOTAL: Garante que NENHUMA mídia ultrapasse o container */
.qxx-single-content img,
.qxx-single-content video,
.qxx-single-content iframe,
.qxx-single-content figure,
.qxx-single-content .wp-block-embed {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box; /* Garante que padding/border não estoure */
}

/* =========================================================================
 * Divisor de Anúncios no Feed
 * ========================================================================= */

/* Aplicando a classe final do HTML: qxx-ad-divider-final */
.qxx-ad-divider-final {
    grid-column: 1 / -1; /* Ocupa toda a largura da grid (mantido por compatibilidade) */
    padding: 20px 0;
    margin: 10px 0;
    background: #fcfcfc; /* Fundo leve para destaque */
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.qxx-ad-divider-final .ad-content {
    /* Exemplo de estilo para visualização da área do anúncio */
    background: #e0e0e0;
    color: #444;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}

/* Esconde o banner maior no mobile */
.qxx-ad-divider-final .ad-content p:first-child { 
    display: none; 
}

@media (min-width: 768px) {
    /* Mostra o banner maior no desktop */
    .qxx-ad-divider-final .ad-content p:first-child { 
        display: block; 
    }
    .qxx-ad-divider-final .ad-content p:last-child {
        display: none; /* Esconde o banner de mobile no desktop */
    }
}

/* =========================================================================
 * 7. FOOTER.CSS (Rodapé QXX News)
 * ========================================================================= */
.qxx-footer {
    background-color: var(--bg-card); /* Fundo branco/claro na parte principal */
    border-top: 4px solid var(--qxx-primary); /* Linha superior preta (QXX) */
    padding-top: 30px;
}

.qxx-footer-inner {
    display: flex;
    flex-direction: column;
}

/* Estrutura de Seções (Colunas) */
.qxx-footer-sections {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.qxx-footer-col {
    flex: 1;
    min-width: 150px;
}

.qxx-footer-brand {
    font-size: 24px;
    font-weight: 900;
    color: var(--qxx-primary);
    display: block;
    margin-bottom: 10px;
}

.qxx-footer-ultimas {
    font-size: 14px;
    font-weight: 700;
    color: var(--qxx-accent);
    text-transform: uppercase;
}

.qxx-footer-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--qxx-primary);
    margin: 0 0 15px 0;
}

.qxx-footer-nav,
.qxx-footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qxx-footer-nav ul,
.qxx-footer-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qxx-footer-nav a,
.qxx-footer-links a {
    color: #6b7280; /* Links cinza */
    font-size: 14px;
    transition: color 0.2s;
}

.qxx-footer-nav a:hover,
.qxx-footer-links a:hover {
    color: var(--qxx-primary);
}

/* FAIXA PRETA INFERIOR */
.qxx-footer-bar {
    background-color: var(--qxx-primary); /* Preto total */
    color: #ffffff;
    margin-top: 20px;
    padding: 15px 0;
    font-size: 12px;
}

.qxx-footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qxx-footer-copy {
    color: #cccccc;
}

.qxx-footer-credits {
    font-weight: 600;
}

/* Mobile Responsivo */
@media (max-width: 768px) {
    .qxx-footer-sections {
        flex-direction: column;
        gap: 20px;
        padding-bottom: 20px;
    }
    .qxx-footer-brand {
        font-size: 20px;
    }
    .qxx-footer-bar {
        padding: 10px 0;
    }
    .qxx-footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}