/* ═══════════════════════════════════════════════════════════════════════════
   Diário Oficial Eletrônico — Prefeitura de Narandiba/SP
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* ── Variáveis ───────────────────────────────────────────────────────────── */
:root {
  --navy:       #0f2040;
  --navy-dark:  #091530;
  --blue:       #1565c0;
  --blue-hover: #0d47a1;
  --bg:         #eef0f4;
  --white:      #ffffff;
  --text:       #1a1a2e;
  --text-muted: #5a6474;
  --border:     #dde1e7;
  --shadow:     0 1px 4px rgba(0,0,0,.10);
  --radius:     8px;
  --font:       'Roboto', 'Segoe UI', Arial, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--navy); scrollbar-gutter: stable; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Barra superior ──────────────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: #cdd6e8;
  font-size: 13px;
  padding: 8px 0;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.topbar-left { font-weight: 500; letter-spacing: .3px; }
.topbar-right { opacity: .9; display: flex; align-items: center; gap: 0; }
.topbar-sep { opacity: .5; margin: 0 4px; }
#topbar-relogio { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .5px; }

/* ── Cabeçalho / Hero ────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  display: block;
  overflow: hidden;
  line-height: 0; /* evita espaço abaixo da imagem */
}
/* Banner completo (topoDiario.jpg) */
.header-banner-wrap {
  position: relative;
  line-height: 0;
  overflow: hidden;
}
.header-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  object-position: left center;
}
.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,22,54,.18) 0%, transparent 60%),
              linear-gradient(to top, rgba(10,22,54,.55) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 18px 32px;
  pointer-events: none;
}
.header-tagline {
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
/* Fallback quando topoDiario.jpg não existe */
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.header-brasao {
  width: 110px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
.header-text { color: #fff; line-height: 1.4; }
.header-text .label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #93b4d8;
  margin-bottom: 4px;
}
.header-text h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  text-transform: uppercase;
}

/* ── Barra de navegação ──────────────────────────────────────────────────── */
.site-nav {
  background: var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-title {
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 10px;
  align-items: center;
  list-style: none;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-links .btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
}
.nav-links .btn-outline:hover { background: var(--bg); }
.nav-links .btn-primary {
  background: var(--blue);
  color: #fff;
}
.nav-links .btn-primary:hover { background: var(--blue-hover); }

/* ── Container principal ─────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
  flex: 1;
}

/* ── Card de busca ───────────────────────────────────────────────────────── */
.busca-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
}
.busca-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.busca-card .subtitulo {
  font-size: 13px;
  color: #8aadd4;
  margin-bottom: 20px;
}

/* Linha de busca */
.busca-linha {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.busca-select,
.busca-input {
  height: 42px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: background .15s;
}
.busca-select { width: 140px; cursor: pointer; }
.busca-select option { background: var(--navy); color: #fff; }
.busca-input { flex: 1; min-width: 200px; }
.busca-input::placeholder { color: rgba(255,255,255,.45); }
.busca-select:focus,
.busca-input:focus { background: rgba(255,255,255,.2); }

.btn-buscar {
  height: 42px;
  padding: 0 24px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn-buscar:hover { background: var(--blue-hover); }
.btn-limpar {
  height: 42px;
  padding: 0 20px;
  background: transparent;
  color: rgba(255,255,255,.75);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-limpar:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Filtros de período (ano/mês) */
.filtros-periodo {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

/* Botão RSS */
.btn-rss {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255,255,255,.14);
  color: #ffcc5c;
  border: 1px solid rgba(255,204,92,.35);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-rss:hover { background: rgba(255,204,92,.2); color: #ffe08a; }

/* Seções sempre visíveis (como no original donarandiba.com.br) */
.filtros-secoes {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 8px;
}

/* Seções checkboxes */
.secoes-titulo {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #c8d8ef;
}
.secoes-sub {
  font-size: 12px;
  color: #8aadd4;
  margin-bottom: 14px;
}
.secoes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.secao-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.07);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  transition: background .15s;
  border: 1px solid transparent;
}
.secao-label:hover { background: rgba(255,255,255,.12); }
.secao-label input[type=checkbox] { accent-color: var(--blue); width: 15px; height: 15px; flex-shrink: 0; }
.secao-label.selecionada { background: rgba(21,101,192,.25); border-color: rgba(21,101,192,.5); }

/* Filtros de período */
.periodo-linha {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.periodo-select {
  height: 38px;
  padding: 0 12px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  min-width: 130px;
}
.periodo-select option { background: var(--navy); }

/* ── Barra de resultados ─────────────────────────────────────────────────── */
.resultados-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.resultados-info {
  font-size: 14px;
  color: var(--text-muted);
}
.resultados-info strong { color: var(--text); }

/* ── Card de edição ──────────────────────────────────────────────────────── */
.edicao-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: box-shadow .15s;
}
.edicao-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.13); }

.edicao-info { flex: 1; min-width: 0; }
.edicao-titulo {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.edicao-titulo a { color: inherit; }
.edicao-titulo a:hover { color: var(--blue); }
.edicao-titulo mark {
  background: #fff3cd;
  color: #5a3e00;
  border-radius: 3px;
  padding: 0 2px;
}

.edicao-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.edicao-meta span { display: flex; align-items: center; gap: 5px; }
.edicao-meta svg { opacity: .6; }

.edicao-publicado {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.edicao-publicado strong { color: var(--text); font-weight: 500; }

.edicao-secoes {
  font-size: 13px;
  color: var(--text-muted);
}
.edicao-secoes strong { color: var(--text); font-weight: 500; }
.edicao-secoes mark { background: #fff3cd; color: #5a3e00; border-radius: 3px; padding: 0 2px; }

/* Badges de seção */
.secao-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  background: #e8f0fe;
  color: #1a56b0;
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 500;
  margin: 2px 3px 2px 0;
}

/* Meta inline (Data + Hora na mesma linha) */
.edicao-meta-linha {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.edicao-meta-linha strong { color: var(--text); font-weight: 500; }

/* Seções como texto simples (estilo do original) */
.edicao-secoes-txt {
  font-size: 13px;
  color: var(--text-muted);
}
.edicao-secoes-txt strong { color: var(--text); font-weight: 500; }

/* Ações do card — caixa cinza com ícone circular + botão abaixo */
.edicao-acoes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: #f3f4f7;
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 130px;
}
.btn-doc-icon {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  transition: opacity .15s;
}
.btn-doc-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.btn-doc-icon:hover { opacity: .85; }
.btn-visualizar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}
.btn-visualizar:hover { background: var(--blue); }

/* WhatsApp sharing */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 32px;
  padding: 0 14px;
  background: #25d366;
  color: #fff;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}
.btn-whatsapp:hover { background: #1ebe5a; }

/* ── Sem resultados ──────────────────────────────────────────────────────── */
.sem-resultados {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.sem-resultados svg { opacity: .3; margin: 0 auto 16px; }
.sem-resultados h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }

/* ── Sem CSV ─────────────────────────────────────────────────────────────── */
.alerta-csv {
  background: #fff8e1;
  border: 1.5px solid #ffc107;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
}
.alerta-csv h3 { color: #5a3a00; margin-bottom: 8px; }
.alerta-csv p  { color: #7a5000; font-size: 14px; }
.alerta-csv code {
  background: rgba(0,0,0,.07);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}

/* ── Paginação ───────────────────────────────────────────────────────────── */
.paginacao {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.pag-info {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.pag-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  transition: all .15s;
}
.pag-link:hover { border-color: var(--blue); color: var(--blue); }
.pag-link.atual {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.pag-link.desabilitado {
  opacity: .35;
  pointer-events: none;
}
.pag-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: var(--text-muted);
}

/* ── Página de edição individual ─────────────────────────────────────────── */
.edicao-detalhe {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  max-width: 860px;
  margin: 0 auto;
}
.edicao-detalhe .numero-badge {
  display: inline-flex;
  align-items: center;
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: .5px;
}
.edicao-detalhe h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
  color: var(--text);
}
.detalhe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detalhe-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detalhe-item span {
  font-size: 15px;
  color: var(--text);
  font-weight: 400;
}
.secoes-lista {
  margin-bottom: 32px;
}
.secoes-lista label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 28px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: background .15s;
}
.btn-download:hover { background: var(--blue-hover); }
.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  transition: all .15s;
  margin-top: 20px;
}
.btn-voltar:hover { border-color: var(--navy); color: var(--navy); }

/* ── Rodapé ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.65);
  padding: 28px 20px;
  text-align: center;
  margin-top: auto;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-nome {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.footer-sub { font-size: 13px; margin-bottom: 10px; }
.footer-link { color: #8aadd4; font-size: 13px; }
.footer-link:hover { color: #fff; }

/* ── Responsividade ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { height: 160px; }
  .header-photo { display: none; }
  .header-brasao { width: 80px; }
  .header-text h1 { font-size: 28px; }
  .secoes-grid { grid-template-columns: 1fr 1fr; }
  .busca-card { padding: 20px; }
  .edicao-card { flex-direction: column; align-items: flex-start; }
  .edicao-acoes { flex-direction: row; width: 100%; justify-content: flex-start; }
  .edicao-detalhe { padding: 24px 20px; }
  .detalhe-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .secoes-grid { grid-template-columns: 1fr; }
  .busca-linha { flex-direction: column; align-items: stretch; }
  .busca-select, .busca-input, .btn-buscar { width: 100%; }
  .topbar-inner { flex-direction: column; gap: 2px; text-align: center; }
  .nav-links .btn-outline { display: none; }
}

/* ── Acessibilidade ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOVOS ESTILOS — Breadcrumb, Viewer PDF, Botões, Nav Edições,
   Aviso Legal, Print CSS, Dark Mode
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-hidden] { color: var(--text-muted); }
.breadcrumb span[aria-current] { color: var(--text); font-weight: 500; }

/* ── Botões de ação da edição ────────────────────────────────────────────── */
.edicao-botoes-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  align-items: center;
}

.btn-viewer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn-viewer-toggle:hover { background: #e8f0fe; }

.btn-copiar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn-copiar:hover { border-color: var(--navy); color: var(--navy); }
.btn-copiar.copiado { border-color: #2e7d32; color: #2e7d32; background: #e8f5e9; }

.btn-email {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  transition: all .15s;
}
.btn-email:hover { border-color: var(--navy); color: var(--navy); }

/* WhatsApp dentro do container de ações — anula width:100% legado */
.edicao-botoes-acoes .btn-whatsapp { width: auto; height: 48px; font-size: 14px; border-radius: 8px; padding: 0 22px; }

/* ── Visualizador de PDF embutido ────────────────────────────────────────── */
.viewer-pdf-wrap {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.viewer-pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.viewer-fechar {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}
.viewer-fechar:hover { background: rgba(255,255,255,.28); }
.viewer-pdf-inner { height: 650px; background: #525659; }
.viewer-pdf-object { width: 100%; height: 100%; display: block; border: none; }

/* ── Navegação prev/next entre edições ───────────────────────────────────── */
.nav-edicoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1.5px solid var(--border);
  flex-wrap: wrap;
}
.nav-ed-btn {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  max-width: 220px;
  transition: all .15s;
  background: var(--white);
}
.nav-ed-btn:hover { border-color: var(--blue); color: var(--blue); }
.nav-ed-btn span { font-size: 14px; font-weight: 600; }
.nav-ed-btn small { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.nav-ed-prev { text-align: left; }
.nav-ed-next { text-align: right; }

/* ── Página Aviso Legal ──────────────────────────────────────────────────── */
.aviso-legal-wrap {
  background: var(--white);
  border-radius: 12px;
  padding: 40px 48px;
  box-shadow: var(--shadow);
  max-width: 860px;
  margin: 0 auto 40px;
}
.aviso-titulo {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.aviso-subtitulo {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
}
.aviso-secao {
  margin-bottom: 30px;
}
.aviso-secao h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--blue);
}
.aviso-secao p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 10px;
}
.aviso-lista {
  list-style: none;
  padding: 0;
}
.aviso-lista li {
  font-size: 14px;
  line-height: 1.7;
  padding: 6px 0 6px 20px;
  position: relative;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.aviso-lista li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--blue);
}
.aviso-contato {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.aviso-contato-item {
  flex: 1;
  min-width: 220px;
  background: var(--bg);
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
}
.aviso-contato-item a { color: var(--blue); }
.aviso-rodape {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Modo Escuro ─────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #1a1d23;
    --white:      #242830;
    --text:       #e0e6f0;
    --text-muted: #8a95a8;
    --border:     #333844;
    --shadow:     0 1px 4px rgba(0,0,0,.35);
  }
  .aviso-lista li { border-bottom-color: var(--border); }
  .nav-ed-btn:hover { color: #7aadff; border-color: #7aadff; }
  .btn-copiar.copiado { background: #1b3a1e; }
}

/* ── Print CSS ───────────────────────────────────────────────────────────── */
@media print {
  .topbar,
  .site-nav,
  .busca-card,
  .paginacao,
  .pag-info,
  .edicao-botoes-acoes,
  .viewer-pdf-wrap,
  .nav-edicoes,
  .site-footer,
  .btn-voltar,
  .breadcrumb,
  .edicao-acoes { display: none !important; }

  .site-header {
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .header-banner { max-height: 120px; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .edicao-detalhe { box-shadow: none !important; padding: 16px 0 !important; }

  body { font-size: 11pt; color: #000 !important; background: #fff !important; }
  h1 { font-size: 16pt; }
  a { color: #000 !important; text-decoration: none; }

  .numero-badge {
    background: #eee !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .secao-badge {
    border: 1px solid #ccc !important;
    background: #f5f5f5 !important;
    color: #000 !important;
  }
  .detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ── Responsividade novos elementos ─────────────────────────────────────── */
@media (max-width: 768px) {
  .aviso-legal-wrap { padding: 24px 20px; }
  .aviso-contato { flex-direction: column; }
  .viewer-pdf-inner { height: 480px; }
  .nav-edicoes { flex-direction: column; align-items: stretch; }
  .nav-ed-btn { max-width: 100%; }
  .nav-ed-next { text-align: left; }
  .edicao-botoes-acoes { gap: 8px; }
}
@media (max-width: 480px) {
  .aviso-rodape { flex-direction: column; align-items: flex-start; }
  .viewer-pdf-inner { height: 360px; }
}

/* ── Página 404 ──────────────────────────────────────────────────────────── */
.not-found-wrap {
  text-align: center;
  padding: 80px 20px 60px;
  max-width: 480px;
  margin: 0 auto;
}
.not-found-icone {
  color: var(--text-muted);
  opacity: .35;
  margin-bottom: 24px;
}
.not-found-titulo {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.not-found-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}
.not-found-acoes {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 22px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.btn-primary:hover { background: var(--navy); }

/* ── Busca rápida por número ─────────────────────────────────────────────── */
.busca-rapida {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.busca-rapida label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.busca-rapida-input {
  width: 90px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--text);
}
.busca-rapida-input:focus { outline: none; border-color: var(--blue); }
.busca-rapida-btn {
  height: 36px;
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.busca-rapida-btn:hover { background: var(--navy); }

/* ── Página de Estatísticas ──────────────────────────────────────────────── */
.estat-wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.estat-titulo { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.estat-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 36px; }

.estat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.estat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.estat-card-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 6px;
}
.estat-card-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.estat-secao { margin-bottom: 40px; }
.estat-secao-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
}

/* Barras horizontais (por ano / seções) */
.estat-barras { display: flex; flex-direction: column; gap: 10px; }
.estat-barra-linha {
  display: grid;
  grid-template-columns: 52px 1fr 42px 24px;
  align-items: center;
  gap: 10px;
}
.estat-barra-ano { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; }
.estat-barra-track {
  background: var(--bg);
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.estat-barra-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, #5b8fee 100%);
  border-radius: 4px;
  transition: width .4s ease;
}
.estat-barra-qtd { font-size: 13px; color: var(--text-muted); text-align: right; }
.estat-barra-ver { color: var(--blue); font-size: 18px; text-decoration: none; }
.estat-barra-ver:hover { color: var(--navy); }

/* Seções */
.estat-secoes-lista { display: flex; flex-direction: column; gap: 10px; }
.estat-sec-item {
  display: grid;
  grid-template-columns: 220px 1fr 52px;
  align-items: center;
  gap: 12px;
}
.estat-sec-nome { font-size: 13px; color: var(--text); font-weight: 500; }
.estat-sec-fill { background: linear-gradient(90deg, #2e7d32 0%, #4caf50 100%); }

/* Barras verticais (meses) */
.estat-meses {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  align-items: flex-end;
  height: 120px;
}
.estat-mes-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}
.estat-mes-track {
  flex: 1;
  width: 100%;
  background: var(--bg);
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid var(--border);
}
.estat-mes-fill {
  width: 100%;
  background: linear-gradient(180deg, #5b8fee 0%, var(--blue) 100%);
  border-radius: 3px 3px 0 0;
  transition: height .4s ease;
}
.estat-mes-qtd { font-size: 11px; font-weight: 600; color: var(--blue); height: 14px; }
.estat-mes-label { font-size: 10px; color: var(--text-muted); }

/* Info geral */
.estat-dl { display: flex; flex-direction: column; gap: 12px; }
.estat-dl-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.estat-dl-item:last-child { border-bottom: none; }
.estat-dl-item dt { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.estat-dl-item dd { font-size: 14px; color: var(--text); margin: 0; }

@media (max-width: 600px) {
  .estat-sec-item { grid-template-columns: 1fr 80px 40px; }
  .estat-sec-nome { font-size: 12px; }
  .estat-dl-item { grid-template-columns: 1fr; gap: 2px; }
  .estat-mes-label { font-size: 9px; }
}

/* ── Acessos ao portal (estatisticas.php) ──────────────────────────────── */
.estat-acessos { margin-top: 2rem; }
.estat-acessos-nota { font-size: .85rem; color: var(--muted); margin: -.25rem 0 1.25rem; }
.estat-cards-acessos { margin-bottom: 1.5rem; }
.estat-card-acesso { border-top: 3px solid #2a7ae4; }
.estat-sub-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 .75rem;
}
.estat-acesso-fill { background: #2a7ae4; }

/* Sparkline 30 dias */
.estat-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding-bottom: 22px; /* espaço para labels */
  position: relative;
}
.estat-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  cursor: default;
}
.estat-spark-track {
  flex: 1;
  width: 100%;
  background: var(--border);
  border-radius: 2px 2px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 4px;
}
.estat-spark-fill {
  width: 100%;
  background: #2a7ae4;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height .2s;
}
.estat-spark-col:hover .estat-spark-fill { background: #1a5cb8; }
.estat-spark-label {
  font-size: .6rem;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  height: 14px;
  display: block;
  text-align: center;
}

/* ── Scrollbar discreta (Chrome/Edge) ──────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: #0f2040; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1a3560; }

/* ── Acessibilidade ──────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 0;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
}
.acessib-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}
.acessib-btn {
  background: rgba(255,255,255,.12);
  color: #cdd6e8;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.acessib-btn:hover, .acessib-btn.ativo { background: rgba(255,255,255,.25); color: #fff; }

/* Alto contraste */
body.alto-contraste {
  --bg: #000;
  --white: #111;
  --text: #fff;
  --text-muted: #ddd;
  --border: #555;
  --blue: #6af;
  --navy: #000;
  --navy-dark: #000;
  background: #000;
  color: #fff;
}
body.alto-contraste a { color: #6af; }
body.alto-contraste .topbar,
body.alto-contraste .site-nav,
body.alto-contraste .site-header { background: #000; border-bottom: 1px solid #555; }
body.alto-contraste .edicao-card,
body.alto-contraste .busca-card,
body.alto-contraste .estat-card { background: #111; border-color: #555; }

/* ── Newsletter ──────────────────────────────────────────────────────────── */
.footer-newsletter {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.newsletter-label {
  display: block;
  font-size: 13px;
  color: #cdd6e8;
  margin-bottom: 8px;
}
.newsletter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.newsletter-input {
  flex: 1;
  min-width: 180px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.newsletter-input::placeholder { color: #8899bb; }
.newsletter-btn {
  padding: 7px 18px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.newsletter-btn:hover { background: var(--blue-hover); }
.newsletter-msg { font-size: 13px; margin-top: 6px; min-height: 18px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
  margin: 8px 0 4px;
}
.footer-links .footer-link { margin: 0; }

/* ── Política de Privacidade ─────────────────────────────────────────────── */
.privacidade-wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.privacidade-titulo { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.privacidade-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 36px; }
.privacidade-secao { margin-bottom: 32px; }
.privacidade-secao h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.privacidade-secao p, .privacidade-secao li { font-size: 14.5px; color: var(--text); line-height: 1.7; margin-bottom: 8px; }
.privacidade-secao ul { padding-left: 20px; }
.privacidade-rodape { margin-top: 40px; padding-top: 20px; border-top: 1.5px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.privacidade-rodape p { font-size: 13px; color: var(--text-muted); }

/* ── QR Code + compartilhamento extra ───────────────────────────────────── */
.edicao-qr-wrap {
  margin-top: 28px;
  padding: 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.edicao-qr-wrap img { border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.edicao-qr-info { flex: 1; min-width: 180px; }
.edicao-qr-info p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; }
.edicao-qr-info .btn-facebook,
.edicao-qr-info .btn-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  margin-right: 8px;
  margin-bottom: 6px;
}
.btn-facebook { background: #1877f2; }
.btn-facebook:hover { background: #1565d8; }
.btn-linkedin { background: #0a66c2; }
.btn-linkedin:hover { background: #084e96; }
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.btn-print:hover { border-color: var(--blue); color: var(--blue); }

/* ── Recuperação de senha (admin) ────────────────────────────────────────── */
.recuperar-wrap { max-width: 400px; margin: 60px auto; padding: 32px 28px; background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.recuperar-titulo { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.recuperar-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.recuperar-msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.recuperar-msg.ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.recuperar-msg.err { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }

/* ── Impressão ───────────────────────────────────────────────────────────── */
@media print {
  .topbar, .site-nav, .acessib-toolbar, .skip-link,
  .edicao-botoes-acoes, .nav-edicoes, .busca-card,
  .paginacao, .pag-info, .site-footer, .header-banner-wrap { display: none !important; }
  .site-header { background: #fff !important; padding: 0; }
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .edicao-detalhe { box-shadow: none !important; border: none !important; }
  .edicao-qr-wrap { break-inside: avoid; }
  .viewer-pdf-wrap { display: none !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; color: #555; }
  a.btn-download::after, a.btn-whatsapp::after, a.btn-email::after,
  a.btn-facebook::after, a.btn-linkedin::after { content: none; }
}

/* ── Verificação de Integridade e Assinatura Digital ─────────────────────── */
.verificacao-wrap {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-top: 3px solid var(--blue);
}
.verificacao-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 16px;
}
.assinatura-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  line-height: 1.4;
}
.assinatura-badge svg { flex-shrink: 0; margin-top: 1px; }
.assinatura-ok  { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.assinatura-nao { background: #fff8e1; color: #e65100; border: 1px solid #ffe082; }
.assinatura-dica { font-weight: 400; color: inherit; opacity: .85; }
.hash-wrap { margin-bottom: 16px; }
.hash-label-row { margin-bottom: 6px; }
.hash-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; display: block; }
.hash-hint  { font-size: 11px; color: var(--text-muted); opacity: .8; }
.hash-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  overflow-x: auto;
}
.hash-code {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 12px;
  color: var(--navy);
  letter-spacing: .04em;
  word-break: break-all;
  flex: 1;
  user-select: all;
}
.btn-copiar-hash {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-copiar-hash:hover { background: var(--blue); color: #fff; }
.verificacao-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.btn-iti {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--navy);
  color: #fff;
  border-radius: 7px;
  text-decoration: none;
  transition: background .15s;
}
.btn-iti:hover { background: var(--blue); }
.btn-iti-info {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--blue);
  border: 1px solid var(--border);
  border-radius: 7px;
  text-decoration: none;
  transition: background .15s;
}
.btn-iti-info:hover { background: var(--bg); }
.verificacao-rodape {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.verificacao-rodape em { font-style: normal; font-weight: 600; }
@media (max-width: 600px) {
  .hash-code { font-size: 10px; }
  .verificacao-wrap { padding: 14px 14px; }
}
/* Ocultar seção de verificação na impressão */
@media print { .verificacao-wrap { display: none !important; } }
