/* =============================
   Tema Escuro — Versão Final: Alinhamento Corrigido e Fonte Suavizada
   ============================= */

:root {
    /* 🎨 Paleta Suavizada V4 - Idêntica à Produção (#212529) */
    --bg-dark: #212529;
    /* Cinza padrão Bootstrap/Produção */
    --bg-secondary: #2b3035;
    /* Áreas de fundo secundário */
    --card-bg: #272c31;
    /* Cards com leve destaque */
    --border-color: #3d4248;
    /* Bordas suaves */
    --primary: #3a8dff;
    /* Azul elétrico premium */
    --primary-hover: #5ea1ff;
    /* Hover mais vibrante */
    --primary-strong: #2a7df0;
    /* Acento forte */
    --text-light: #f0f0f5;
    /* Texto principal quase branco */
    --text-muted: #8e8e9e;
    /* Texto secundário equilibrado */
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
    --focus-ring: #7ec5ff;
    --accent-gradient: linear-gradient(135deg, #5eb3ff, #7ec5ff);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    padding-top: 60px;
    transition: background-color 0.3s ease;
}

/* =============================
   1. NAVBAR
   ============================= */
#main-navbar {
    background-color: var(--bg-dark) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

#main-navbar .navbar-brand img {
    filter: invert(1);
}

#main-navbar .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s;
}

#main-navbar .nav-link:hover,
#main-navbar .nav-link.active {
    background-color: var(--bg-secondary);
    color: var(--primary) !important;
}

/* Ajuste para Notebooks (14" / 1366px - 1440px) */
@media (min-width: 992px) and (max-width: 1400px) {
    #main-navbar .nav-link {
        padding: 8px 10px !important;
        font-size: 0.95rem;
    }

    #main-navbar .navbar-brand img {
        height: 35px;
        /* Reduz levemente a logo se necessário */
    }
}


.navbar-toggler {
    border-color: var(--border-color) !important;
}

.navbar-toggler-icon {
    filter: invert(1);
}

/* =============================
   2. CARDS e PRINCIPAL
   ============================= */
.news-card {
    background-color: var(--card-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.news-card-link {
    text-decoration: none;
    display: block;
    height: 100%;
}

.news-card-link:hover .news-card {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.news-card-body {
    padding: 16px;
}

/* === STANDARD CARD IMAGES (NON-OVERLAY) === */
.news-card-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-img img {
    transform: scale(1.05);
}

/* === NEW: OVERLAY CARDS (PREMIUM) - DARK THEME OPTIMIZED === */
.news-card-overlay {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    min-height: 280px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.news-card-overlay .news-card-img {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Ensure wrapper is full width */
}

.news-card-overlay .news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}

/* 🎨 ELEGANT TRANSPARENT GRADIENT - PROFESSIONAL LOOK */
.news-card-overlay .card-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.25rem 1rem 1.25rem;
    z-index: 2;
    /* Modern, softer gradient for better readability */
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.92) 0%,
            rgba(0, 0, 0, 0.75) 30%,
            rgba(0, 0, 0, 0.45) 60%,
            rgba(0, 0, 0, 0.15) 85%,
            transparent 100%) !important;
    color: white !important;
}

/* 🔥 ULTRA-SPECIFIC SELECTORS - FORCE TRANSPARENT GRADIENT ON ALL CARD SIZES 🔥 */
.col-md-4 .news-card-overlay .card-overlay-content,
.col-md-6 .news-card-overlay .card-overlay-content,
.col-md-8 .news-card-overlay .card-overlay-content,
.col-md-12 .news-card-overlay .card-overlay-content,
.col-lg-4 .news-card-overlay .card-overlay-content,
.col-lg-6 .news-card-overlay .card-overlay-content,
.col-lg-8 .news-card-overlay .card-overlay-content,
div[class*="col-"] .news-card-overlay .card-overlay-content,
.row .col-md-4 .news-card-overlay .card-overlay-content,
.row .col-md-6 .news-card-overlay .card-overlay-content {
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.92) 0%,
            rgba(0, 0, 0, 0.75) 30%,
            rgba(0, 0, 0, 0.45) 60%,
            rgba(0, 0, 0, 0.15) 85%,
            transparent 100%) !important;
    background-color: transparent !important;
    background-image: none;
    background-image: linear-gradient(to top,
            rgba(0, 0, 0, 0.92) 0%,
            rgba(0, 0, 0, 0.75) 30%,
            rgba(0, 0, 0, 0.45) 60%,
            rgba(0, 0, 0, 0.15) 85%,
            transparent 100%) !important;
}

/* Extra specificity for small cards */
.news-card-link .news-card-overlay .card-overlay-content {
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.92) 0%,
            rgba(0, 0, 0, 0.75) 30%,
            rgba(0, 0, 0, 0.45) 60%,
            rgba(0, 0, 0, 0.15) 85%,
            transparent 100%) !important;
}

.news-card-overlay .news-card-title {
    color: white !important;
    font-size: 1.25rem;
    margin-bottom: 0;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.news-card-overlay .news-card-excerpt {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.9rem;
    margin-bottom: 0;
    min-height: unset;
}

.news-card-overlay:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.news-card-overlay:hover .news-card-img img {
    transform: scale(1.1);
}

/* === SOCIAL SHARE BUTTONS === */
.btn-social {
    color: white !important;
    font-weight: 600;
    border: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 50px;
}

.btn-social:hover {
    transform: translateY(-2px);
    opacity: 1;
    color: white !important;
}

.btn-whatsapp {
    background-color: #25D366;
}

.btn-whatsapp:hover {
    background-color: #20b858;
    color: white !important;
}

.btn-twitter {
    background-color: #000000;
    /* X brand color - stays black even in dark mode usually, or white? Black bg with white X is standard branding, but strictly speaking on dark mode a white button with black icon might pop more. Keeping brand colors for recognition. */
    border: 1px solid #333;
    /* Slight border for visibility on dark bg */
}

.btn-twitter:hover {
    background-color: #333333;
    color: white !important;
    border-color: #555;
}

.btn-facebook {
    background-color: #1877F2;
}

.btn-facebook:hover {
    background-color: #1464cc;
    color: white !important;
}

.btn-instagram {
    background: #f09433;
    background: -moz-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    background: -webkit-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.btn-instagram:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-copy {
    background-color: #6c757d;
}

.btn-copy:hover {
    background-color: #5a6268;
    color: white !important;
}

.news-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.3;
    /* Ajuda a manter o alinhamento de 2 linhas */
    min-height: 3.0rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    /* Ajuda a manter o alinhamento de 3 linhas */
    min-height: 3.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.news-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Visibilidade de Texto Muted e Local News */
.text-muted {
    color: var(--text-muted) !important;
}

#regional-news-container h6,
#regional-news-container p,
#regional-news-container small {
    color: var(--text-light);
}

#regional-news-container .text-muted {
    color: var(--text-muted) !important;
}

/* Títulos das Seções (Mais profissional) */
.section-title {
    color: var(--text-light);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    position: relative;
    border-left: 5px solid var(--primary-strong);
    padding-left: 15px;
}

/* Título de Categoria */
.category-title {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    border-left: 4px solid var(--primary-strong);
    padding-left: 15px;
}

.category-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.category-title a:hover {
    color: var(--primary-hover);
}

/* =============================
   3. CARROSSEL DE DESTAQUE
   ============================= */
.hero-carousel .carousel-item {
    height: 500px;
    background-size: cover;
    background-position: center center;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.hero-carousel .carousel-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 3rem 3rem 3rem;
    color: white;
    z-index: 2;
}

.hero-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.1rem;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

/* =============================
   4. SIDEBAR - MAIS LIDAS (Correção de Comprimido)
   ============================= */
.sidebar-section {
    background-color: #15151a;
    /* Mais escuro que --bg-secondary (#222228), quase preto/pagina */
    /* Fundo sutil para destacar a sidebar */
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    /* Maintain border for definition */
}

.sidebar-list {
    margin-top: 0;
    padding-left: 0;
    background-color: #15151a;
    /* Darker background */
    border: 1px solid var(--border-color);
}

/* Separador discreto para os itens */
.sidebar-article-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px !important;
    /* Aumenta o espaço entre os itens */
}

.sidebar-article-item:last-child {
    margin-bottom: 0 !important;
}

.sidebar-article-item h6,
.sidebar-trend-item h6,
.small-title-regional {
    color: var(--text-light) !important;
}

/* Ajuste fino para os containers da sidebar no modo escuro */
.dark-mode-adjust {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Thumbnails da Sidebar */
.sidebar-article-thumb {
    width: 66px;
    height: 66px;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.dark-mode-adjust h5,
.dark-mode-adjust p,
.dark-mode-adjust span,
.dark-mode-adjust .text-muted {
    color: var(--text-light) !important;
}

.trend-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-strong);
    line-height: 1;
    min-width: 25px;
    text-align: center;
}

/* Força cor branca nos links do widget regional no modo escuro */
.compact-regional-list .list-group-item h6,
.compact-regional-list .list-group-item small,
.compact-regional-list .list-group-item .text-muted {
    color: var(--text-light) !important;
}

.compact-regional-list .list-group-item:hover h6 {
    color: var(--primary-hover) !important;
}

.sidebar-article-item:hover h6,
.sidebar-trend-item:hover h6 {
    color: var(--primary-hover);
}

/* Estilo para a imagem lateral na sidebar (Se sidebar_list_item a tiver) */
.sidebar-article-thumb {
    width: 60px;
    /* Reduced to align with user screenshot reference if needed, or keeping small */
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    margin-right: 15px;
}

.sponsor-banner-img {
    max-height: 150px;
    width: 100%;
    object-fit: cover;
}

/* Estilo para a numeração (1, 2, 3...) */
.sidebar-rank-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-strong);
    margin-right: 10px;
    flex-shrink: 0;
    line-height: 1;
}

/* Estilo para o título da notícia na sidebar */
.sidebar-list-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 5px;
    color: var(--text-light);
}

/* =============================
   5. FOOTER
   ============================= */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* =============================
   8. AJUSTES PARA PÁGINAS ESTÁTICAS (About, Privacy, etc.)
   ============================= */

/* Sobrescrever fundos claros forçados nos templates no tema escuro */
body.theme-dark .bg-white,
body.theme-dark .bg-light {
    background-color: var(--bg-secondary) !important;
    color: var(--text-light) !important;
}

/* Ajuste específico para section-card no tema escuro */
body.theme-dark .section-card {
    background-color: var(--card-bg) !important;
    color: var(--text-light) !important;
    border: 1px solid var(--border-color) !important;
}

/* Forçar cores de texto nessas seções */
body.theme-dark .section-card h1,
body.theme-dark .section-card h2,
body.theme-dark .section-card h3,
body.theme-dark .section-card p,
body.theme-dark .section-card li,
body.theme-dark .section-card span {
    color: var(--text-light) !important;
}

body.theme-dark .section-card .text-secondary,
body.theme-dark .section-card .text-muted {
    color: var(--text-muted) !important;
}

/* Corrigir códigos no modo escuro (ex: email no contato) */
body.theme-dark code,
body.theme-dark .section-card code,
body.theme-dark code.text-dark {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Forçar qualquer texto-dark a ficar claro dentro dos cards escuros */
body.theme-dark .section-card .text-dark {
    color: var(--text-light) !important;
}

/* Ajustes de bordas sucess/danger em cards de política/termos */
body.theme-dark .border-success {
    border-color: #28a745 !important;
}

body.theme-dark .border-danger {
    border-color: #dc3545 !important;
}

/* Ícones dentro de círculos no tema escuro */
body.theme-dark .icon-circle {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color);
}

body.theme-dark .icon-circle i {
    color: var(--primary) !important;
}

.footer h5 {
    color: var(--text-light);
    font-weight: 700;
}

.footer a {
    color: var(--text-muted) !important;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--primary) !important;
}

.social-icons a {
    font-size: 1.2rem;
    margin-right: 15px;
}

/* =============================
   6. RESPONSIVIDADE
   ============================= */
@media (min-width: 992px) {
    .category-carousel-container {
        max-width: 600px;
    }
}

@media (max-width: 1200px) {
    .hero-content {
        padding: 1rem 2rem 2.5rem 2rem;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 991px) {
    .hero-carousel .carousel-item {
        height: 320px !important;
    }

    .hero-content {
        padding: 0.5rem 1rem 2rem 1rem;
    }

    .hero-content h2 {
        font-size: 1.7rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .news-card-img {
        height: 160px;
    }

    .sidebar-section {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-carousel .carousel-item {
        height: 280px !important;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        display: none;
    }
}

/* =============================
   7. OFFCANVAS MENU (DARK MODE)
   ============================= */
.offcanvas {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
}

.offcanvas-header {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-title {
    color: var(--text-light) !important;
}

.offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.offcanvas-body {
    background-color: var(--bg-dark) !important;
}

/* Corrigir o fundo claro do cabeçalho da lista */
.offcanvas .bg-light {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.offcanvas .list-group-item {
    background-color: transparent !important;
    color: var(--text-light) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.offcanvas .list-group-item:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--primary) !important;
}

.offcanvas .list-group-item .text-primary {
    color: var(--primary) !important;
}

.offcanvas .list-group-item .text-secondary {
    color: var(--text-muted) !important;
}


/* =============================
   9. ANÚNCIOS (Propagandas)
   ============================= */
.ad-unit,
.ad-unit-sidebar {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-left: auto;
    margin-right: auto;
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    display: block;
    clear: both;
}

.ad-unit,
.ad-unit-sidebar {
    background: transparent !important;
}

ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}


/* =============================
   10. PADRONIZAÇÃO DE IMAGENS
   ============================= */
/* =============================
   11. ESTILOS PREMIUM (V1)
   ============================= */


/* Card Premium para Conteúdo */
.premium-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .premium-card {
        padding: 1.5rem;
        border-radius: 0;
        /* No mobile fica flat para ganhar espaço */
        border-left: none;
        border-right: none;
    }
}

/* Tipografia Aprimorada */
.article-content-body {
    font-size: 1.15rem;
    line-height: 1.85;
    letter-spacing: 0.015em;
    color: rgba(255, 255, 255, 0.95);
}

.article-content-body p {
    margin-bottom: 1.8rem;
}

/* Padronização de Títulos de Seção */
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    padding-left: 15px;
    border-left: 5px solid var(--primary);
    position: relative;
    display: flex;
    align-items: center;
}

/* Badges Premium */
.badge-premium {
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--accent-gradient);
    color: var(--bg-dark) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(58, 141, 255, 0.3);
}

/* Estilo para Itens de Sidebar Premium */
.sidebar-list.premium {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.sidebar-list.premium h5 {
    background: rgba(255, 255, 255, 0.03);
    margin: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 700;
}
