/* Tema custom whitelabel — construído sobre Bootstrap 5.
   Cores vêm de variáveis CSS setadas no <head> a partir da tabela `configuracoes`
   (veja includes/head.php), então trocar a marca é só editar no admin. */

body {
  font-family: var(--brand-font, "Georgia", "Times New Roman", serif);
  color: #212529;
  background: #f7f7f8;
}

.font-sans { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-dark); text-decoration: underline; }

/* Faixa de edição de franquia — avisa que o visitante está numa edição hiperlocal (subdomínio de município) */
.franquia-banner {
  background: var(--brand-primary);
  color: #fff;
  font-size: .85rem;
  letter-spacing: .01em;
}
.franquia-banner i.bi-geo-alt-fill { opacity: .85; }
.franquia-banner-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: #fff !important;
  font-weight: 600;
  padding: .15rem .65rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  text-decoration: none !important;
  transition: background .15s ease;
}
.franquia-banner-link:hover { background: rgba(255,255,255,.28); }
.franquia-banner-link i { font-size: .75rem; }

/* ---------- Header compacto ---------- */
.site-header { background: #fff; }

/* Barra superior colorida: logo + hambúrguer + busca/clima/redes (estilo "O Dia") */
.topbar-brand { background: var(--brand-primary); color: #fff; }
.topbar-brand .btn-link { color: #fff; }
.topbar-link { color: rgba(255,255,255,.9) !important; }
.topbar-link:hover { color: #fff !important; }
.navbar-brand-logo {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
}
.navbar-brand-logo img { max-height: 34px; display: block; }
.offcanvas .navbar-brand-logo { color: var(--brand-secondary) !important; font-size: 1.25rem; }

/* Barra de navegação (editorias): branca por padrão; nas páginas de uma
   editoria específica, herda a cor daquela editoria (--nav-color/--nav-text,
   setadas via inline style quando aplicável). */
.main-nav {
  background: var(--nav-color, #fff);
  border-bottom: 1px solid #e6e6e8;
  transition: background .15s ease;
}
.main-nav .nav { scrollbar-width: none; }
.main-nav .nav::-webkit-scrollbar { display: none; }
.main-nav .nav-link {
  color: var(--nav-text, #222) !important;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: .6rem .75rem !important;
  white-space: nowrap;
}
.main-nav .nav-link:hover,
.main-nav .nav-link:focus { opacity: .7; color: var(--nav-text, #222) !important; }

/* ---------- Menu lateral (offcanvas) ---------- */
.offcanvas { width: 300px; }
.side-menu-heading {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #999;
  padding: 1rem 1.25rem .4rem;
}
.side-menu-list { list-style: none; margin: 0; padding: .4rem 0; }
.side-menu-list a {
  display: flex; align-items: center; gap: .6rem; padding: .6rem 1.25rem;
  color: #222; text-decoration: none; font-weight: 600; font-size: .9rem;
}
.side-menu-list a:hover { background: #f5f5f5; color: var(--cat-color, var(--brand-primary)); }
.side-menu-list .side-menu-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cat-color, var(--brand-primary)); flex-shrink: 0; }

/* ---------- Ticker de cotações ---------- */
.ticker {
  background: #14161a;
  color: #e8e8ea;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .8125rem;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker .ticker-item { display: inline-flex; align-items: baseline; gap: .35rem; padding: .35rem 1rem; }
.ticker .up { color: #35d07f; }
.ticker .down { color: #ff6b6b; }

/* Badge de categoria — reutilizável em qualquer contexto (card, linha, cabeçalho) */
.badge-cat {
  background: var(--cat-color, var(--brand-primary)); color: #fff !important; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .3rem .55rem; border-radius: .25rem; display: inline-block; text-decoration: none;
}
a.badge-cat:hover { color: #fff !important; opacity: .9; text-decoration: none; }

/* Categoria como texto simples (estilo editorial denso) */
.kicker {
  display: block; color: var(--cat-color, var(--brand-primary)); font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-decoration: none;
  margin-bottom: .25rem;
}
a.kicker:hover { color: var(--cat-color, var(--brand-primary)); text-decoration: underline; }

/* ---------- Lead story (topo da home) ---------- */
.lead-story { display: flex; gap: 1.5rem; align-items: stretch; text-decoration: none; color: inherit; margin-bottom: 2rem; }
.lead-story .lead-media { flex: 0 0 46%; max-width: 46%; border-radius: .375rem; overflow: hidden; aspect-ratio: 4/3; }
.lead-story .lead-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-story .lead-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.lead-story h1 { font-weight: 800; font-size: 1.85rem; line-height: 1.15; color: #111; margin: 0 0 .5rem; }
.lead-story:hover h1 { color: var(--cat-color, var(--brand-primary)); }
.lead-story .lead-dek { color: #555; font-size: 1rem; }
@media (max-width: 767.98px) {
  .lead-story { flex-direction: column; }
  .lead-story .lead-media { max-width: 100%; flex-basis: auto; }
}

/* ---------- Grade densa (estilo agência de notícias) ---------- */
.news-grid { column-count: 2; column-gap: 1.75rem; }
@media (max-width: 767.98px) { .news-grid { column-count: 1; } }
.news-block { display: flex; gap: .75rem; padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid #e6e6e8; text-decoration: none; color: inherit; break-inside: avoid; }
.news-block .thumb { flex: 0 0 84px; width: 84px; height: 84px; border-radius: .25rem; overflow: hidden; background: #eee; }
.news-block .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-block h3 { font-size: .95rem; font-weight: 700; line-height: 1.3; margin: 0; color: #171717; }
.news-block:hover h3 { color: var(--cat-color, var(--brand-primary)); }
.news-block .dek { font-size: .8125rem; color: #767676; margin-top: .25rem; }
.news-block.no-thumb h3 { font-size: 1.05rem; }

/* ---------- Seções de editoria (home) ---------- */
.editoria-section { margin: 2.5rem 0; }
.editoria-section-header { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 3px solid var(--cat-color, var(--brand-primary)); padding-bottom: .5rem; margin-bottom: 1.25rem; }
.editoria-section-header a { color: var(--cat-color, var(--brand-primary)); }
.editoria-section-header h2 {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .02em; margin: 0; color: #171717;
}
.editoria-section-header a { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .8125rem; font-weight: 700; text-transform: uppercase; }
.editoria-card { display: block; text-decoration: none; color: inherit; }
.editoria-card .thumb { display: block; aspect-ratio: 3/2; border-radius: .375rem; overflow: hidden; background: #eee; margin-bottom: .6rem; }
.editoria-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.editoria-card:hover .thumb img { transform: scale(1.04); }
.editoria-card h4 { font-size: .95rem; font-weight: 700; line-height: 1.3; color: #171717; margin: 0; }
.editoria-card:hover h4 { color: var(--cat-color, var(--brand-primary)); }

/* Variante "grade com molduras" da seção de editoria: remove o border/spacing
   próprio do .news-block já que a célula da grade já desenha a borda. */
.editoria-section .news-block { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

/* ---------- Carrossel de Colunas (home) ---------- */
.columns-carousel-wrap { position: relative; }
.columns-carousel-nav { display: flex; gap: .5rem; }
.columns-carousel-nav button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #d8d8da; background: #fff;
  display: flex; align-items: center; justify-content: center; color: #444; cursor: pointer;
}
.columns-carousel-nav button:hover { background: #f5f5f5; }
.columns-carousel {
  display: flex; gap: 1.75rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: .5rem; scrollbar-width: none;
}
.columns-carousel::-webkit-scrollbar { display: none; }
.columns-carousel .columnist-item { flex: 0 0 auto; width: 230px; display: flex; gap: .85rem; align-items: flex-start; scroll-snap-align: start; text-decoration: none; color: inherit; }
.columns-carousel .columnist-item .columnist-avatar { width: 64px; height: 64px; flex-shrink: 0; margin: 0; }
.columns-carousel .coluna-nome { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: #999; }
.columns-carousel .colunista-nome { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--brand-primary); margin-top: .1rem; }
.columns-carousel .coluna-titulo { font-weight: 700; font-size: .9rem; line-height: 1.3; color: #171717; margin-top: .1rem; }
.columns-carousel .columnist-item:hover .coluna-titulo { color: var(--brand-primary); }
.columns-carousel-dots { display: flex; gap: 6px; justify-content: center; margin-top: 1rem; }
.columns-carousel-dots span { width: 7px; height: 7px; border-radius: 50%; background: #ddd; display: block; }
.columns-carousel-dots span.active { background: var(--brand-primary); }

/* ---------- Colunistas ---------- */
.columnist-avatar { display: inline-block; width: 100px; height: 100px; border-radius: 50%; overflow: hidden; margin: 0 auto; background: #eee; }
.columnist-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.columnist-card { text-align: center; text-decoration: none; color: inherit; display: block; }
.columnist-card .coluna-nome { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--brand-primary); margin-top: .6rem; }
.columnist-card .nome { font-weight: 700; font-size: 1rem; }
.columnist-card:hover .nome { color: var(--brand-primary); }

/* ---------- Mais Lidas ---------- */
.most-read-header {
  background: var(--brand-secondary); color: #fff; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800; text-transform: uppercase; font-size: .85rem; letter-spacing: .03em;
  padding: .75rem 1rem; margin: 0; border: 0;
}
.most-read-list { list-style: none; margin: 0; padding: .25rem 0; }
.most-read-list li { border-bottom: 1px solid #f0f0f1; }
.most-read-list li:last-child { border-bottom: 0; }
.most-read-list a { display: flex; align-items: baseline; gap: .75rem; padding: .65rem 1rem; text-decoration: none; color: inherit; }
.most-read-list .most-read-num {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800; font-size: 1.35rem; color: #d8d8d8; flex: 0 0 auto; line-height: 1;
}
.most-read-list a:hover .most-read-num,
.most-read-list a:hover .most-read-title { color: var(--cat-color, var(--brand-primary)); }
.most-read-list .most-read-title { font-size: .875rem; font-weight: 600; line-height: 1.3; }

/* ---------- Cards de notícia ---------- */
.news-card { position: relative; display: block; border-radius: .5rem; overflow: hidden; color: #fff; text-decoration: none; background: #222; }
.news-card:hover { color: #fff; text-decoration: none; }
.news-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.news-card:hover img { transform: scale(1.05); }
.news-card .news-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,0) 100%);
}
.news-card .news-card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem; }
.news-card .badge-cat { margin-bottom: .5rem; }
.news-card .news-card-title { font-weight: 700; line-height: 1.25; margin: 0; }
.news-card.news-card-lg { aspect-ratio: 4 / 5; }
.news-card.news-card-sm { aspect-ratio: 16 / 8; }
.news-card.news-card-lg .news-card-title { font-size: 1.5rem; }
.news-card.news-card-sm .news-card-title { font-size: 1.05rem; }

.headline-block { padding: 1.75rem 0 1rem; text-align: center; }
.headline-block h1 { font-weight: 800; font-size: 2.25rem; line-height: 1.15; margin: .75rem 0 .5rem; }
.headline-block p { font-size: 1.1rem; color: #555; max-width: 40rem; margin: 0 auto; }

.section-title {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .02em;
  border-bottom: 3px solid var(--cat-color, var(--brand-primary)); padding-bottom: .5rem; margin: 2rem 0 1.25rem;
}

.article-row { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #e6e6e8; }
.article-row:last-child { border-bottom: 0; }
.article-row .thumb { flex: 0 0 180px; width: 180px; aspect-ratio: 4/3; border-radius: .375rem; overflow: hidden; }
.article-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-row h3 { font-size: 1.15rem; font-weight: 700; margin: .1rem 0 .35rem; }
.article-row .meta { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .8rem; color: #888; }
@media (max-width: 575.98px) {
  .article-row { flex-direction: column; }
  .article-row .thumb { width: 100%; flex-basis: auto; }
}

/* ---------- Anúncios ---------- */
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; margin: 1.5rem auto; padding: .5rem; overflow: hidden; text-align: center; }
.ad-slot-label { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #999; }
.ad-slot-topo, .ad-slot-rodape { width: 100%; background: #f4f5f6; }
.ad-slot-sidebar { background: #f4f5f6; border-radius: .5rem; }
.ad-slot-artigo_meio, .ad-slot-artigo_rodape, .ad-slot-entre_home { margin: 2rem auto; }

/* ---------- Sidebar ---------- */
.sidebar-card { background: #fff; border: 1px solid #e6e6e8; border-radius: .5rem; padding: 1rem; margin-bottom: 1.5rem; }
.sidebar-card h4 { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 800; text-transform: uppercase; font-size: .9rem; border-bottom: 2px solid var(--brand-primary); padding-bottom: .5rem; margin-bottom: .75rem; }
.sidebar-list-item { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid #f0f0f1; text-decoration: none; color: inherit; }
.sidebar-list-item:last-child { border-bottom: 0; }
.sidebar-list-item .thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: .375rem; overflow: hidden; background: #eee; }
.sidebar-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-list-item .cat { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--cat-color, var(--brand-primary)); }
.sidebar-list-item .title { font-size: .875rem; font-weight: 600; line-height: 1.3; color: #222; }
.sidebar-list-item:hover .title { color: var(--cat-color, var(--brand-primary)); }

/* ---------- Artigo ---------- */
.article-title { font-weight: 800; font-size: 2rem; line-height: 1.2; }
.article-subtitle { font-size: 1.2rem; color: #555; font-weight: 400; }
.article-meta { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: .85rem; color: #777; }
.author-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 700; font-size: .8rem;
}
.article-cover { width: 100%; border-radius: .5rem; margin: 1rem 0 .25rem; }
.article-caption { font-size: .8rem; color: #888; margin-bottom: 1.25rem; }
.article-body { font-size: 1.125rem; line-height: 1.75; }
.article-body h3 { font-weight: 700; margin-top: 1.75rem; }
.article-body blockquote { border-left: 4px solid var(--brand-primary); padding-left: 1rem; font-style: italic; color: #444; margin: 1.5rem 0; }
.article-body p { margin-bottom: 1.1rem; }
.article-body a.link-magico { color: var(--brand-primary); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }

/* ---------- Revelar texto completo ---------- */
.article-reveal-wrap.is-collapsed { max-height: 480px; overflow: hidden; position: relative; }
.article-reveal-wrap.is-collapsed::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 130px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 85%);
  pointer-events: none;
}
.btn-reveal-texto {
  display: block; width: 100%; background: var(--brand-primary); color: #fff; border: 0;
  padding: .95rem; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .875rem;
  border-radius: .375rem; margin: -.5rem 0 2rem; cursor: pointer;
}
.btn-reveal-texto:hover { opacity: .92; }

/* ---------- Tags da matéria ---------- */
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.tag-chip {
  display: inline-block; padding: .4rem .8rem; border: 1px solid #d8d8da; border-radius: 999px;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em; color: #444; text-decoration: none;
}
.tag-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); text-decoration: none; }

/* ---------- Enquete ---------- */
.poll-option .progress { height: 1.75rem; }
.poll-option .progress-bar { background: var(--brand-primary); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-secondary); color: #b7bac0; }
.site-footer a { color: #dcdee2; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 800; font-size: 1.25rem; color: #fff; }

/* ---------- Placeholder / util ---------- */
.ratio-cover img, .obj-cover { object-fit: cover; width: 100%; height: 100%; }
.badge-status-publicado { background: #198754; }
.badge-status-rascunho { background: #6c757d; }

/* ---------- Central de Busca ---------- */
.search-hero-box {
  background: #fff;
  border: 1px solid #e3e3e8;
  border-radius: .75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
}
.search-hero-box .form-control:focus,
.search-hero-box .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, 0.15);
}
.search-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #e9ecef;
}
.search-stats-title {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #171717;
  margin: 0;
}
.search-stats-count {
  font-size: .875rem;
  color: #6c757d;
}
mark.search-highlight {
  background-color: #fff3cd;
  color: #664d03;
  padding: 0 .2em;
  border-radius: .2rem;
  font-weight: 700;
}
.search-empty-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: .75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}
.search-empty-card .empty-icon {
  font-size: 3rem;
  color: #adb5bd;
  margin-bottom: 1rem;
}
.search-suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-top: 1rem;
}
