:root {
    --azul: #0c2242;
    --laranja: #ff9900;
    --cinza-fundo: #f4f7f6;
    --card-bg: #ffffff;
    --texto: #333;
    --texto-suave: #666;
    --borda: #eee;
}

:root[data-theme="escuro"] {
    --cinza-fundo: #10182b;
    --card-bg: #182338;
    --texto: #e6e9f0;
    --texto-suave: #a8b0c2;
    --borda: #2a3550;
}

:root[data-theme="escuro"] body { background-color: var(--cinza-fundo); }
:root[data-theme="escuro"] .news-card,
:root[data-theme="escuro"] .destaque,
:root[data-theme="escuro"] .form-box,
:root[data-theme="escuro"] table.lista,
:root[data-theme="escuro"] .newsletter-box { background: var(--card-bg); border-color: var(--borda); }
:root[data-theme="escuro"] .news-card h3,
:root[data-theme="escuro"] .destaque h1,
:root[data-theme="escuro"] .artigo h1,
:root[data-theme="escuro"] .section-title { color: #fff; }
:root[data-theme="escuro"] .news-card p,
:root[data-theme="escuro"] .artigo .conteudo,
:root[data-theme="escuro"] body { color: var(--texto); }
:root[data-theme="escuro"] .section[style*="background: white"],
:root[data-theme="escuro"] section[style*="background: white"] { background: var(--card-bg) !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--cinza-fundo);
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* HEADER */
header {
    background-color: var(--azul);
    padding: 12px 0;
    border-bottom: 4px solid var(--laranja);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    overflow: hidden;
}
.search-box input {
    background: transparent;
    border: none;
    padding: 7px 10px;
    color: white;
    font-size: 13px;
    width: 130px;
}
.search-box input::placeholder { color: #bbb; }
.search-box input:focus { outline: none; }
.search-box button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0 10px;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 820px) {
    .menu-toggle { display: block; order: 1; }
    .logo { order: 0; }
    .header-tools { order: 2; }
    nav#main-nav {
        display: none;
        width: 100%;
        order: 3;
        flex-direction: column;
        gap: 0;
        background: var(--azul);
        border-top: 1px solid rgba(255,255,255,0.15);
        margin-top: 10px;
    }
    nav#main-nav.show { display: flex; }
    nav#main-nav a { padding: 10px 0; }
    .search-box input { width: 100px; }
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-img {
    height: 48px;
    width: auto;
    display: block;
    background: white;
    border-radius: 6px;
    padding: 3px 8px;
}
.logo-footer {
    height: 55px;
    width: auto;
    background: white;
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 15px;
}

nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a {
    color: #ccc;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    text-decoration: none;
    transition: 0.2s;
}
nav a:hover, nav a.active { color: var(--laranja); }

/* HERO */
.hero {
    background: linear-gradient(to right, var(--azul), #003366);
    color: white;
    padding: 60px 0;
    text-align: center;
}
.hero h1 { font-size: 2.2em; margin-bottom: 10px; }

/* GRID DE NOTÍCIAS */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.news-card img { width: 100%; height: 170px; object-fit: cover; display: block; background: #eee; }
.news-card .body { padding: 16px; }
.news-card .categoria { color: var(--laranja); font-size: 0.75em; font-weight: 800; text-transform: uppercase; }
.news-card h3 { color: var(--azul); font-size: 1.1em; margin: 6px 0; line-height: 1.3; }
.news-card p { color: #666; font-size: 0.9em; }
.news-card .meta { color: #999; font-size: 0.78em; margin-top: 10px; }

/* DESTAQUE (home) */
.destaque {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 30px;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
}
.destaque img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; background: #eee; }
.destaque .body { padding: 30px 30px 30px 0; align-self: center; }
.destaque h1 { color: var(--azul); font-size: 1.9em; line-height: 1.25; margin: 10px 0; }

@media (max-width: 750px) {
    .destaque { grid-template-columns: 1fr; }
    .destaque .body { padding: 0 20px 25px 20px; }
}

/* SECTION TITLE */
.section-title {
    color: var(--azul);
    font-size: 1.3em;
    font-weight: 800;
    border-left: 4px solid var(--laranja);
    padding-left: 12px;
    margin: 30px 0 15px;
}

/* ARTIGO */
.artigo { max-width: 760px; margin: 30px auto; padding: 0 20px; }
.artigo .categoria { color: var(--laranja); font-weight: 800; text-transform: uppercase; font-size: 0.8em; }
.artigo h1 { color: var(--azul); font-size: 2em; margin: 10px 0; line-height: 1.3; }
.artigo .meta { color: #888; font-size: 0.9em; margin-bottom: 20px; }
.artigo img.capa { width: 100%; border-radius: 12px; margin-bottom: 25px; max-height: 450px; object-fit: cover; }
.artigo .conteudo { font-size: 1.1em; white-space: pre-wrap; color: #333; }

/* FORMS */
.form-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    max-width: 480px;
    margin: 40px auto;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9em; color: #444; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
}
.btn {
    display: inline-block;
    background: var(--laranja);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9em;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.btn:hover { background: #e08800; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-outline {
    background: transparent;
    color: var(--azul);
    border: 2px solid var(--azul);
}
.erro { color: #d33; font-size: 0.9em; margin-top: 10px; }

/* PAINEL / ADMIN */
.painel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}
table.lista { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; border: 1px solid #eee; }
table.lista th { background: #f8fafc; text-align: left; padding: 12px 15px; font-size: 0.78em; text-transform: uppercase; color: #888; }
table.lista td { padding: 12px 15px; border-top: 1px solid #f1f1f1; font-size: 0.92em; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75em; font-weight: 800; }
.badge-publicado { background: #dcfce7; color: #15803d; }
.badge-rascunho { background: #fef9c3; color: #a16207; }
.acao-link { color: var(--laranja); font-weight: 700; text-decoration: none; margin-right: 12px; cursor: pointer; }
.acao-link.excluir { color: #d33; }

/* FOOTER */
footer {
    background: var(--azul);
    color: white;
    padding: 30px 0;
    border-top: 4px solid var(--laranja);
    margin-top: 50px;
    text-align: center;
}

.vazio { text-align: center; color: #999; padding: 40px 0; }

/* BREADCRUMB */
.breadcrumb { font-size: 0.85em; color: #888; margin-bottom: 15px; }
.breadcrumb a { color: #888; text-decoration: none; }
.breadcrumb a:hover { color: var(--laranja); }

/* COMPARTILHAR */
.share-buttons { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.share-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 700;
    color: white;
}
.share-whatsapp { background: #25D366; }
.share-x { background: #000; }
.share-facebook { background: #1877F2; }
.share-copiar { background: #888; border: none; cursor: pointer; font-family: inherit; }

/* TAGS */
.tags-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin: 15px 0; }
.tag-pill {
    background: #f0f2f5;
    color: var(--azul);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 700;
    text-decoration: none;
}
.tag-pill:hover { background: var(--laranja); color: white; }

/* MAIS LIDAS */
.sidebar-maislidas { background: var(--card-bg); border: 1px solid var(--borda); border-radius: 12px; padding: 20px; }
.sidebar-maislidas ol { padding-left: 20px; }
.sidebar-maislidas li { margin-bottom: 12px; }
.sidebar-maislidas a { color: var(--azul); text-decoration: none; font-weight: 600; font-size: 0.95em; }
.sidebar-maislidas a:hover { color: var(--laranja); }

.home-layout { display: grid; grid-template-columns: 2.2fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 850px) { .home-layout { grid-template-columns: 1fr; } }

/* NEWSLETTER */
.newsletter-box {
    background: white;
    border-top: 1px solid var(--borda);
    border-bottom: 1px solid var(--borda);
    padding: 40px 0;
}
