/* ════════════════════════════════════════════════════════════════════
   theme.css v2 — Modo claro/escuro com overrides de ALTA especificidade.
   Usa body.theme-dark como prefix em TODOS seletores pra vencer cores
   hardcoded nos templates inline.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Variáveis tema CLARO (default) ──────────────────────────────── */
:root {
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --bg-subtle: #f5f5f5;
  --text: #0a0a0a;
  --text-muted: #525252;
  --text-dim: #737373;
  --accent: #dc2626;
  --border: #e5e5e5;
}

/* ─── Tema ESCURO ─── */
body.theme-dark {
  --bg: #0d0d0d;
  --bg-elev: #1a1a1a;
  --bg-subtle: #262626;
  --text: #f5f5f5;
  --text-muted: #d4d4d4;
  --text-dim: #a3a3a3;
  --accent: #f87171;
  --border: #2a2a2a;
  background: #0d0d0d !important;
  color: #f5f5f5 !important;
}

/* Pref do sistema (só se user não escolheu) */
@media (prefers-color-scheme: dark) {
  body:not(.theme-light):not(.theme-dark) {
    background: #0d0d0d; color: #f5f5f5;
  }
}

/* ════════════════════════════════════════════════════════════════
   OVERRIDES com body.theme-dark prefix (alta especificidade)
   ══════════════════════════════════════════════════════════════ */

/* ─── Headers (mantém preto em ambos modos pra coerência da marca) ─── */
body.theme-dark header.brand,
body.theme-dark header.top { background: #000 !important; }
body.theme-dark .topbar { background: #000 !important; }
body.theme-dark .logo,
body.theme-dark .logo a { color: #fff !important; }
body.theme-dark .logo .sub { color: #a3a3a3 !important; }

/* ─── Nav categorias ─── */
body.theme-dark nav.cats { background: #1a1a1a !important; border-bottom-color: #dc2626 !important; }
body.theme-dark nav.cats a,
body.theme-dark .cats-inner a { color: #d4d4d4 !important; border-right-color: #2a2a2a !important; }
body.theme-dark nav.cats a:hover,
body.theme-dark .cats-inner a:hover { background: #262626 !important; color: #f87171 !important; }
body.theme-dark nav.cats a.active,
body.theme-dark .cats-inner a.active { background: #dc2626 !important; color: #fff !important; }

/* ─── Search ─── */
body.theme-dark .brand-search input,
body.theme-dark .search input { background: #1a1a1a !important; color: #f5f5f5 !important; border-color: #2a2a2a !important; }

/* ─── HERO PRINCIPAL ─── */
body.theme-dark .hero { border-bottom-color: #2a2a2a !important; }
body.theme-dark .hero-main h1,
body.theme-dark .hero-main h1 a,
body.theme-dark .hero-main h1 span { color: #f5f5f5 !important; }
body.theme-dark .hero-main p.lead,
body.theme-dark .hero-main .lead { color: #d4d4d4 !important; }
body.theme-dark .hero-main .meta { color: #a3a3a3 !important; }
body.theme-dark .hero-main:hover h1 a { color: #fca5a5 !important; }

/* ─── HERO LATERAIS (secundárias) ─── */
body.theme-dark .hero-side .item { border-bottom-color: #2a2a2a !important; }
body.theme-dark .hero-side .item h3 { color: #f5f5f5 !important; }
body.theme-dark .hero-side .item:hover h3 { color: #fca5a5 !important; }
body.theme-dark .hero-side .item .cat-mini { color: #fca5a5 !important; }
body.theme-dark .hero-side .item .meta { color: #a3a3a3 !important; }

/* ─── CARDS (grid de posts) ─── */
body.theme-dark .card,
body.theme-dark .grid-posts .card,
body.theme-dark a.card { background: #1a1a1a !important; }
body.theme-dark .card h3,
body.theme-dark a.card h3,
body.theme-dark .card h3 a { color: #f5f5f5 !important; }
body.theme-dark .card:hover h3,
body.theme-dark a.card:hover h3 { color: #fca5a5 !important; }
body.theme-dark .card p.resumo,
body.theme-dark .card .resumo,
body.theme-dark a.card p.resumo,
body.theme-dark a.card .resumo { color: #d4d4d4 !important; }
body.theme-dark .card .meta,
body.theme-dark a.card .meta { color: #a3a3a3 !important; }

/* ─── SECTION TITLE ─── */
body.theme-dark .section-title,
body.theme-dark h2.section-title { color: #f5f5f5 !important; border-bottom-color: #f5f5f5 !important; }

/* ─── SIDEBAR (widgets) ─── */
body.theme-dark aside.sidebar,
body.theme-dark .widget { background: #1a1a1a !important; border-color: #2a2a2a !important; color: #f5f5f5 !important; }
body.theme-dark .widget h4 { color: #f5f5f5 !important; border-bottom-color: #dc2626 !important; }

/* Mais lidos */
body.theme-dark .widget .top-list { color: #f5f5f5 !important; }
body.theme-dark .widget .top-list li { border-bottom-color: #2a2a2a !important; }
body.theme-dark .widget .top-list li::before { color: #f87171 !important; }
body.theme-dark .widget .top-list h5,
body.theme-dark .widget .top-list a h5,
body.theme-dark .widget .top-list a { color: #f5f5f5 !important; }
body.theme-dark .widget .top-list h5:hover,
body.theme-dark .widget .top-list a:hover h5 { color: #fca5a5 !important; }
body.theme-dark .widget .top-list .meta { color: #a3a3a3 !important; }

/* Tags */
body.theme-dark .widget.tags a { background: #262626 !important; color: #d4d4d4 !important; }
body.theme-dark .widget.tags a:hover { background: #dc2626 !important; color: #fff !important; }

/* Newsletter widget (PRETO em ambos modos) */
body.theme-dark .widget.newsletter { background: #000 !important; border-color: #1a1a1a !important; }
body.theme-dark .widget.newsletter h4 { color: #fff !important; border-bottom-color: #dc2626 !important; }
body.theme-dark .widget.newsletter p { color: #d4d4d4 !important; }
body.theme-dark .widget.newsletter input { background: #1a1a1a !important; color: #fff !important; border-color: #404040 !important; }
body.theme-dark .widget.newsletter small,
body.theme-dark .widget.newsletter small a { color: #a3a3a3 !important; }

/* ─── PAGINAÇÃO ─── */
body.theme-dark .pagination a { background: #1a1a1a !important; color: #f5f5f5 !important; border-color: #2a2a2a !important; }
body.theme-dark .pagination a:hover { background: #f5f5f5 !important; color: #0a0a0a !important; border-color: #f5f5f5 !important; }
body.theme-dark .pagination .atual { background: #dc2626 !important; color: #fff !important; border-color: #dc2626 !important; }

/* ─── POST INDIVIDUAL — Hero ─── */
body.theme-dark .post-hero h1 { color: #f5f5f5 !important; }
body.theme-dark .post-hero .subtitulo { color: #d4d4d4 !important; }
body.theme-dark .breadcrumb,
body.theme-dark .breadcrumb a { color: #a3a3a3 !important; }
body.theme-dark .breadcrumb a:hover { color: #fca5a5 !important; }
body.theme-dark .meta-bar { color: #d4d4d4 !important; border-color: #2a2a2a !important; }
body.theme-dark .meta-bar .autor { color: #f5f5f5 !important; }
body.theme-dark .meta-bar .dot::before { color: #404040; }
body.theme-dark .post-capa figcaption { color: #a3a3a3 !important; }

/* ─── Conteúdo do post ─── */
body.theme-dark .post-conteudo,
body.theme-dark .conteudo { color: #f5f5f5 !important; }
body.theme-dark .post-conteudo h2,
body.theme-dark .post-conteudo h3,
body.theme-dark .post-conteudo h4,
body.theme-dark .conteudo h1, body.theme-dark .conteudo h2,
body.theme-dark .conteudo h3, body.theme-dark .conteudo h4 { color: #f5f5f5 !important; }
body.theme-dark .post-conteudo p,
body.theme-dark .conteudo p,
body.theme-dark .post-conteudo li,
body.theme-dark .conteudo li { color: #e5e5e5 !important; }
body.theme-dark .post-conteudo strong { color: #fff !important; }
body.theme-dark .post-conteudo em,
body.theme-dark .conteudo em { color: #d4d4d4 !important; }
body.theme-dark .post-conteudo a,
body.theme-dark .conteudo a { color: #fca5a5 !important; }
body.theme-dark .post-conteudo a:hover { background: rgba(248,113,113,0.15) !important; }
body.theme-dark .post-conteudo blockquote { color: #d4d4d4 !important; border-left-color: #f87171 !important; }
body.theme-dark .post-conteudo code { background: #262626 !important; color: #fca5a5 !important; }
body.theme-dark .post-conteudo hr { background: #2a2a2a !important; }
body.theme-dark .post-conteudo hr::after { background: #0d0d0d !important; color: #404040 !important; }
body.theme-dark .post-conteudo p:first-of-type::first-letter { color: #f87171 !important; }

/* Post — boxes laterais */
body.theme-dark .post-tags { border-top-color: #2a2a2a !important; }
body.theme-dark .post-tags-label { color: #a3a3a3 !important; }
body.theme-dark .post-tags a { background: #1a1a1a !important; color: #d4d4d4 !important; border: 1px solid #2a2a2a; }
body.theme-dark .post-tags a:hover { background: #f5f5f5 !important; color: #0a0a0a !important; }
body.theme-dark .share-box { background: #1a1a1a !important; border-color: #2a2a2a !important; }
body.theme-dark .share-box p { color: #a3a3a3 !important; }
body.theme-dark .share-buttons .copy { background: #262626 !important; color: #f5f5f5 !important; border-color: #404040 !important; }
body.theme-dark .autor-box { background: #1a1a1a !important; }
body.theme-dark .autor-box h4 { color: #f5f5f5 !important; }
body.theme-dark .autor-box p { color: #d4d4d4 !important; }
body.theme-dark .relacionados { background: #1a1a1a !important; }
body.theme-dark .relacionados h3 { color: #f5f5f5 !important; border-bottom-color: #f5f5f5 !important; }
body.theme-dark .rel-card { background: #262626 !important; }
body.theme-dark .rel-card h4 { color: #f5f5f5 !important; }
body.theme-dark .rel-card:hover h4 { color: #fca5a5 !important; }
body.theme-dark .rel-card .cat { color: #fca5a5 !important; }

/* ─── EMPTY ─── */
body.theme-dark .empty { background: #1a1a1a !important; color: #d4d4d4 !important; }
body.theme-dark .empty h2,
body.theme-dark .empty h3 { color: #f5f5f5 !important; }

/* ═══════════════ NEWSLETTER LANDING ═══════════════ */
body.theme-dark .form-box { background: #1a1a1a !important; }
body.theme-dark .form-box h2 { color: #f5f5f5 !important; }
body.theme-dark .form-box p { color: #d4d4d4 !important; }
body.theme-dark .form-box label { color: #f5f5f5 !important; }
body.theme-dark .form-box .help { color: #a3a3a3 !important; }
body.theme-dark .form-box input { background: #262626 !important; color: #f5f5f5 !important; border-color: #404040 !important; }
body.theme-dark .consent-box { background: #262626 !important; border-left-color: #f87171 !important; }
body.theme-dark .consent-box label { color: #e5e5e5 !important; }
body.theme-dark .lgpd-info { background: #1a1a1a !important; border-color: #2a2a2a !important; color: #d4d4d4 !important; }
body.theme-dark .lgpd-info h4 { color: #f5f5f5 !important; }
body.theme-dark .lgpd-info p { color: #d4d4d4 !important; }
body.theme-dark .lgpd-info p strong { color: #f5f5f5 !important; }
body.theme-dark .lgpd-info a { color: #fca5a5 !important; }
body.theme-dark .benefit { background: #1a1a1a !important; border-color: #2a2a2a !important; }
body.theme-dark .benefit h5 { color: #f5f5f5 !important; }
body.theme-dark .benefit p { color: #d4d4d4 !important; }

/* ═══════════════ NEWSLETTER CONFIRM/UNSUB ═══════════════ */
body.theme-dark .info { background: #1a1a1a !important; border-left-color: #f87171 !important; }
body.theme-dark .info h4 { color: #f5f5f5 !important; }
body.theme-dark .info p { color: #d4d4d4 !important; }
body.theme-dark .form-cancelar label { color: #f5f5f5 !important; }
body.theme-dark .form-cancelar textarea { background: #262626 !important; color: #f5f5f5 !important; border-color: #404040 !important; }

/* Cards no card.html da newsletter (genérico) */
body.theme-dark .card.simple { background: #1a1a1a !important; color: #f5f5f5 !important; }

/* ═══════════════ MEMBROS — Landing ═══════════════ */
body.theme-dark .beneficio { background: #1a1a1a !important; border-top-color: #f87171 !important; }
body.theme-dark .beneficio h3 { color: #f5f5f5 !important; }
body.theme-dark .beneficio p,
body.theme-dark .beneficio li { color: #d4d4d4 !important; }
body.theme-dark .seguranca { background: #1a1a1a !important; border-left-color: #4ade80 !important; }
body.theme-dark .seguranca h4 { color: #f5f5f5 !important; }
body.theme-dark .seguranca li { color: #d4d4d4 !important; }
body.theme-dark .seguranca strong { color: #f5f5f5 !important; }
body.theme-dark .section-sub { color: #d4d4d4 !important; }
body.theme-dark .section-title { color: #f5f5f5 !important; }

/* ═══════════════ MEMBROS — Base / dashboard / áreas ═══════════════ */
body.theme-dark nav.menu { background: #1a1a1a !important; border-bottom-color: #2a2a2a !important; }
body.theme-dark .menu-inner a { color: #d4d4d4 !important; }
body.theme-dark .menu-inner a:hover { color: #f87171 !important; }
body.theme-dark .menu-inner a.active { color: #f5f5f5 !important; border-bottom-color: #f87171 !important; }

body.theme-dark .page-title,
body.theme-dark h1.page-title { color: #f5f5f5 !important; }
body.theme-dark .page-sub { color: #d4d4d4 !important; }

body.theme-dark .stat { background: #1a1a1a !important; }
body.theme-dark .stat .label { color: #a3a3a3 !important; }
body.theme-dark .stat .v,
body.theme-dark .stat .valor { color: #f5f5f5 !important; }

/* Cards no dashboard membros */
body.theme-dark a.card .meta { color: #a3a3a3 !important; }

/* ═══════════════ POLÍTICA PRIVACIDADE ═══════════════ */
body.theme-dark main { background: transparent !important; }
body.theme-dark main p,
body.theme-dark main li { color: #e5e5e5 !important; }
body.theme-dark main strong { color: #f5f5f5 !important; }
body.theme-dark main h1,
body.theme-dark main h2 { color: #f5f5f5 !important; }
body.theme-dark .destaque { background: #1a1a1a !important; border-left-color: #f87171 !important; }
body.theme-dark .updated { color: #a3a3a3 !important; }

/* ═══════════════ FOOTER ═══════════════ */
body.theme-dark footer.site-footer,
body.theme-dark footer { background: #000 !important; color: #a3a3a3 !important; }
body.theme-dark .footer-grid h5 { color: #fff !important; }
body.theme-dark .footer-grid p,
body.theme-dark .footer-grid li,
body.theme-dark .footer-grid a { color: #a3a3a3 !important; }
body.theme-dark .footer-grid a:hover { color: #fff !important; }
body.theme-dark .footer-bottom { color: #737373 !important; border-top-color: #1a1a1a !important; }

/* ═══════════════ BOTÕES GERAIS ═══════════════ */
body.theme-dark .btn-ghost,
body.theme-dark .btn-secondary { background: #262626 !important; color: #f5f5f5 !important; border-color: #404040 !important; }
body.theme-dark .btn-ghost:hover,
body.theme-dark .btn-secondary:hover { background: #404040 !important; }

/* ═══════════════ INPUTS GLOBAIS ═══════════════ */
body.theme-dark input[type=text],
body.theme-dark input[type=email],
body.theme-dark input[type=tel],
body.theme-dark input[type=search],
body.theme-dark input[type=password],
body.theme-dark input[type=url],
body.theme-dark input[type=datetime-local],
body.theme-dark textarea,
body.theme-dark select { background: #1a1a1a !important; color: #f5f5f5 !important; border-color: #404040 !important; }
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder { color: #737373; }

/* ═══════════════ TOGGLE BUTTON ═══════════════ */
.theme-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s;
  line-height: 1;
  white-space: nowrap;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); }
.theme-toggle .label-dark, .theme-toggle .label-light { font-size: 12px; }

/* Mostra o label correto baseado no tema ATUAL */
body.theme-dark .theme-toggle .label-light { display: inline; }
body.theme-dark .theme-toggle .label-dark { display: none; }
body:not(.theme-dark) .theme-toggle .label-dark { display: inline; }
body:not(.theme-dark) .theme-toggle .label-light { display: none; }

/* ═══════════════ READING PROGRESS BAR ═══════════════ */
body.theme-dark .reading-progress { background: #f87171 !important; }

/* ═══════════════ TRANSIÇÃO SUAVE ═══════════════ */
body, .card, .widget, .form-box, header, nav, footer, input, textarea, select, button,
.hero-main, .hero-side .item, .info, .destaque, .seguranca, .lgpd-info, .benefit, .stat,
.post-conteudo, .post-capa, .share-box, .autor-box, .rel-card, .menu-inner a,
.cats-inner a, .widget .top-list li, a.card {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
