/* =========================================
   1. RESET E VARIÁVEIS GLOBAIS
   ========================================= */
:root {
    /* Cores Institucionais */
    --primary-color: #d32f2f;     /* Vermelho um pouco mais escuro para passar no contraste */
    --secondary-color: #004c99;   
    --accent-color: #ff6b35;      
    
    /* Tons de Cinza e Fundo */
    --bg-body: #f9f9f9;           
    --bg-card: #ffffff;           
    --text-primary: #0a0a0a;      /* Preto quase absoluto para Títulos */
    --text-secondary: #444444;    /* AQUI ESTAVA O ERRO: Escureci de #555 para #444 */
    --border-color: #dddddd;
    
    /* Fontes */
    --font-title: 'Merriweather', serif;       
    --font-body: 'Libre Franklin', sans-serif; 
}

/* Adicione isso também no CSS para corrigir o contraste dos metadados */
.post-meta {
    color: #555; /* Antes era #777 (muito claro), agora #555 passa no teste */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.3s ease; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

/* =========================================
   2. BARRA DE TOPO E CABEÇALHO
   ========================================= */
.top-bar {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-size: 0.8rem;
    padding: 8px 0;
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a { margin-left: 15px; font-weight: 600; font-size: 0.75rem; }
.social-links a:hover { color: #fff; }

.header {
    background: var(--bg-card);
    border-bottom: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -1px;
}
.logo span { color: #222; }

.nav-list { display: flex; gap: 25px; }
.nav-list a {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #333;
    position: relative;
    padding-bottom: 5px;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-color);
    transition: 0.3s;
}
.nav-list a:hover::after { width: 100%; }
.nav-list a:hover { color: var(--primary-color); }

/* =========================================
   3. ESTRUTURA PRINCIPAL (GRID)
   ========================================= */
.main-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Títulos de Seção (com a barrinha vermelha do lado) */
.section-title {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: #111;
    border-left: 6px solid var(--primary-color);
    padding-left: 15px;
    margin-bottom: 25px;
    line-height: 1;
}

/* =========================================
   4. HOME: SEÇÃO DE DESTAQUES (Estilo Portal)
   ========================================= */
.featured-section {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Esquerda larga, Direita estreita */
    gap: 25px;
    margin-bottom: 50px;
}

/* Destaque Principal (Esquerda) */
.featured-main {
    position: relative;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.featured-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.featured-main:hover img { transform: scale(1.03); }

.featured-main .featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    padding: 30px;
    color: #fff;
}

.featured-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 10px 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Destaques Secundários (Direita) */
.featured-secondary {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.secondary-item {
    flex: 1;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.3s;
}

.secondary-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.secondary-image {
    width: 130px;
    height: 100%;
    object-fit: cover;
}

.secondary-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.secondary-title {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 5px;
}

/* =========================================
   5. HOME: GRADE DE NOTÍCIAS (News Grid)
   ========================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid transparent;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-color);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content { padding: 20px; }

.news-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
    color: #000;
}

.news-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Tags de Categorias (Etiquetas coloridas) */
.category-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    background: var(--secondary-color);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* Variações de cor por assunto (opcional) */
.tag-ia { background-color: #8e44ad; }       /* Roxo */
.tag-hardware { background-color: #e67e22; } /* Laranja */
.tag-software { background-color: #27ae60; } /* Verde */

/* =========================================
   6. PÁGINA DO ARTIGO (post.php)
   ========================================= */
.post-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Coluna do texto larga, sidebar estreita */
    gap: 50px;
    background: var(--bg-card); /* Fundo branco para leitura */
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.post-header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #eee; }

.post-title {
    font-family: var(--font-title);
    font-size: 2.8rem;
    line-height: 1.15;
    color: #111;
    margin: 15px 0;
}

.post-meta {
    font-size: 0.9rem;
    color: #777;
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-image-container img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 40px;
}

/* O texto da notícia em si */
.post-text {
    font-family: 'Georgia', serif; /* Serifado para leitura longa (como Medium/NYT) */
    font-size: 1.2rem;
    line-height: 1.8;
    color: #2c2c2c;
}

.post-text p { margin-bottom: 25px; }

/* Botão de Voltar */
.btn-voltar {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 25px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.9rem;
}
.btn-voltar:hover { background-color: #003366; }

/* Sidebar simples */
.sidebar-widget {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.widget-title {
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

/* =========================================
   7. RODAPÉ
   ========================================= */
.footer {
    background: #111;
    color: #888;
    text-align: center;
    padding: 50px 20px;
    margin-top: 60px;
    font-size: 0.9rem;
}
.footer p { margin-top: 10px; }

/* =========================================
   8. RESPONSIVIDADE (MOBILE)
   ========================================= */
@media (max-width: 900px) {
    /* Header Empilhado */
    .header-container { flex-direction: column; gap: 15px; }
    .nav-list { gap: 15px; flex-wrap: wrap; justify-content: center; }
    
    /* Home: Coluna única */
    .featured-section { grid-template-columns: 1fr; }
    .featured-main { height: 350px; } /* Menor no celular */
    .featured-title { font-size: 1.6rem; }
    
    .secondary-item { flex-direction: row; height: auto; } /* Mantém lado a lado se couber */
    
    /* Post: Remove sidebar e ajusta fontes */
    .post-layout { grid-template-columns: 1fr; padding: 20px; }
    .sidebar { display: none; } /* Oculta sidebar no mobile para focar no texto */
    .post-title { font-size: 2rem; }
    .post-text { font-size: 1.1rem; }
}

@media (max-width: 600px) {
    /* Ajustes finos para celulares pequenos */
    .secondary-item { flex-direction: column; }
    .secondary-image { width: 100%; height: 180px; }
    .news-grid { grid-template-columns: 1fr; }
}

/* =========================================
   9. ESPAÇOS PUBLICITÁRIOS (ADS)
   ========================================= */
.ad-container {
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
    width: 100%;
}

/* Espaço Quadrado (Sidebar) - Padrão 300x250 */
.ad-sidebar {
    height: 250px;
}

/* Espaço Horizontal (Entre notícias) - Padrão Responsivo */
.ad-horizontal {
    height: 100px; /* Banner fino */
    margin: 40px 0;
}

@media (max-width: 600px) {
    .ad-horizontal { height: 250px; } /* No celular vira um quadrado geralmente */
}