/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #FF6B2B;
    --primary-dark: #e55a1a;
    --dark: #111827;
    --gray-800: #1f2937;
    --gray-600: #4b5563;
    --gray-400: #9ca3af;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
    font-size: 16px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

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

/* ===== BARRA DE PROGRESSO ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--primary);
    z-index: 9999;
    transition: width .1s linear;
}

/* ===== HEADER ===== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
}
.logo-caja { color: var(--primary); }
.logo-news { color: var(--dark); }

.nav {
    display: flex;
    gap: 24px;
}
.nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    transition: color .2s;
    white-space: nowrap;
}
.nav a:hover { color: var(--primary); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--dark);
}

.nav-mobile {
    display: none;
    flex-direction: column;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.nav-mobile a {
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}
.nav-mobile.open { display: flex; }

/* ===== ADS ===== */
.ad-placeholder {
    background: var(--gray-100);
    border: 1px dashed var(--gray-400);
    color: var(--gray-400);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.ad-top { padding: 10px 0; }
.ad-top .ad-placeholder { height: 90px; width: 100%; max-width: 728px; margin: 0 auto; }

.ad-inline { margin: 28px 0; }
.ad-inline .ad-placeholder { height: 90px; }

.ad-sidebar-box { height: 250px; width: 100%; }
.ad-sidebar-tall { height: 400px; width: 100%; }
.ad-footer { padding: 10px 0; margin-top: 24px; }
.ad-footer .ad-placeholder { height: 90px; max-width: 728px; margin: 0 auto; }

.sticky-ad { position: sticky; top: 80px; }

/* Banner fixo mobile */
.ad-sticky-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}
.ad-sticky-mobile.visible { display: block; }
.ad-sticky-inner { height: 50px; }
.ad-sticky-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    z-index: 1;
}

/* ===== MAIN LAYOUT ===== */
.main { padding: 32px 0 48px; }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* ===== HERO ===== */
.hero { margin-bottom: 40px; }

.hero-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s;
}
.hero-card:hover { transform: translateY(-3px); }

.hero-img { position: relative; }
.hero-img img { width: 100%; height: 360px; object-fit: cover; }

.hero-content {
    padding: 36px;
    background: var(--dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}
.hero-content h1 { font-size: 22px; line-height: 1.4; }
.hero-content p { font-size: 15px; color: var(--gray-400); line-height: 1.6; }

.leia-mais {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 8px;
}

/* ===== CATEGORIA BADGE ===== */
.categoria-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* ===== ARTICLE GRID ===== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.ad-mid {
    grid-column: 1 / -1;
}

.article-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--white);
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    display: block;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.article-img { position: relative; }
.article-img img { width: 100%; height: 180px; object-fit: cover; }

.article-content {
    padding: 16px;
}
.article-content h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--dark);
}
.article-content p {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 10px;
}

.article-date {
    font-size: 12px;
    color: var(--gray-400);
}

/* ===== SIDEBAR ===== */
.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
}
.sidebar-widget h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.sidebar-article {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    transition: opacity .2s;
}
.sidebar-article:hover { opacity: .7; }
.sidebar-article:last-child { border-bottom: none; }
.sidebar-article img {
    width: 60px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.sidebar-article span {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--dark);
}

/* ===== ARTIGO PAGE ===== */
.artigo-col { min-width: 0; }

.artigo-header {
    margin-bottom: 24px;
}
.artigo-header .categoria-badge {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
}
.artigo-header h1 {
    font-size: 30px;
    line-height: 1.3;
    margin-bottom: 12px;
}
.artigo-meta {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-400);
    flex-wrap: wrap;
    align-items: center;
}
.reading-time {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.artigo-imagem {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.artigo-imagem img { width: 100%; height: 400px; object-fit: cover; }

.artigo-conteudo {
    font-size: 17px;
    line-height: 1.85;
    color: var(--gray-800);
}
.artigo-conteudo h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 36px 0 14px;
    color: var(--dark);
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}
.artigo-conteudo h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--dark);
}
.artigo-conteudo p { margin-bottom: 18px; }
.artigo-conteudo ul, .artigo-conteudo ol {
    margin: 16px 0 20px 24px;
}
.artigo-conteudo li { margin-bottom: 10px; line-height: 1.7; }
.artigo-conteudo strong { color: var(--dark); }
.artigo-conteudo em {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 15px;
    font-style: normal;
}
.artigo-conteudo blockquote {
    border-left: 4px solid var(--primary);
    background: var(--gray-100);
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 16px;
    color: var(--gray-800);
}

/* Ad injetado pelo JS */
.ad-injected { margin: 32px 0; }

/* ===== RELACIONADOS ===== */
.relacionados { margin-top: 48px; }
.relacionados h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}
.relacionados-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ===== PAGES ESTÁTICAS ===== */
.page-content {
    max-width: 780px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.page-content h1 { font-size: 28px; line-height: 1.3; margin-bottom: 16px; }
.page-content h2 { font-size: 20px; margin: 26px 0 10px; }
.page-content p { font-size: 16px; color: var(--gray-800); line-height: 1.75; margin-bottom: 12px; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 48px 0 0;
    margin-top: 40px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-brand .logo { margin-bottom: 12px; font-size: 20px; }
.footer-brand p { font-size: 14px; color: var(--gray-400); line-height: 1.6; }

.footer-links h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
    margin-bottom: 16px;
}
.footer-links a {
    display: block;
    font-size: 14px;
    color: var(--gray-400);
    margin-bottom: 10px;
    transition: color .2s;
}
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .hero-card { grid-template-columns: 1fr; }
    .hero-img img { height: 220px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .relacionados-grid { grid-template-columns: repeat(2, 1fr); }
    /* Compensa o banner sticky mobile */
    body { padding-bottom: 70px; }
}

@media (max-width: 640px) {
    .nav { display: none; }
    .menu-toggle { display: block; }
    .article-grid { grid-template-columns: 1fr; }
    .hero-content { padding: 20px; }
    .hero-content h1 { font-size: 18px; }
    .artigo-header h1 { font-size: 22px; }
    .artigo-imagem img { height: 220px; }
    .relacionados-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .page-content { padding: 20px; }
    .page-content h1 { font-size: 24px; }
    .page-content h2 { font-size: 18px; }
}
