/* ===========================
   Apuração Eleições 2026 — página, faixa e widget
   Carregado só quando a apuração é exibida (tema_enqueue_apuracao)
   =========================== */

.sh-ap-hero,
.sh-ap-faixa,
.sh-ap-live,
#sh-apuracao {
  /* Paleta do Sergipe Hoje: vermelho do menu/chapéus, escuro do rodapé, link do artigo */
  --sh-ap-tinta: #1a1a1a;
  --sh-ap-suave: #666;
  --sh-ap-linha: #e9ecef;
  --sh-ap-fundo: #f8f9fa;
  --sh-ap-destaque: #dc3545;
  --sh-ap-destaque-escuro: #b02a37;
  --sh-ap-link: #b80202;
  --sh-ap-escuro: #212529;
}

/* ---------- Selo (mesmo formato do chapéu .sh-category-badge) ---------- */
.sh-ap-selo {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  background: var(--sh-ap-destaque);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sh-ap-selo[data-situacao="aovivo"]::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: #fff;
  animation: sh-ap-pulso 1.4s ease-in-out infinite;
}
.sh-ap-selo[data-situacao="final"] {
  background: var(--sh-ap-escuro);
}
@keyframes sh-ap-pulso {
  50% { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-ap-selo[data-situacao="aovivo"]::before { animation: none; }
}

/* ---------- Faixa (home e artigos) ---------- */
.sh-ap-faixa {
  margin: 0.75rem 0;
}
.sh-ap-faixa-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--sh-ap-linha);
  border-left: 4px solid var(--sh-ap-destaque);
  border-radius: 6px;
  background: #fff;
  color: var(--sh-ap-tinta);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
}
.sh-ap-faixa-link:hover {
  background: var(--sh-ap-fundo);
  color: var(--sh-ap-tinta);
}
.sh-ap-faixa-texto {
  flex: 1 1 14rem;
  font-weight: 600;
}
.sh-ap-faixa-dados {
  flex: 1 1 18rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}
.sh-ap-faixa-grupo {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.7rem;
}
.sh-ap-faixa-local {
  font-weight: 800;
}
.sh-ap-faixa-cand,
.sh-ap-mun-cand {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sh-ap-faixa-pst {
  color: var(--sh-ap-suave);
  font-size: 0.8rem;
  white-space: nowrap;
}
.sh-ap-faixa-cta {
  margin-left: auto;
  color: var(--sh-ap-link);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.sh-ap-ponto {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--sh-ap-cor, #6c757d);
  flex: none;
}

/* ---------- Página: topo ---------- */
/* Escuro do rodapé (bg-dark) com fio vermelho do menu */
.sh-ap-hero {
  background: var(--sh-ap-escuro);
  border-bottom: 4px solid var(--sh-ap-destaque);
}
.sh-ap-hero .sh-ap-selo[data-situacao="final"] {
  background: #fff;
  color: var(--sh-ap-escuro);
}
.sh-ap-titulo {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: #fff;
}
.sh-ap-subtitulo {
  color: #d0d3d6;
  font-size: 0.95rem;
}
.sh-ap-status {
  color: #b8bcc0;
  font-size: 0.85rem;
}

/* ---------- Abas ---------- */
.sh-ap-abas {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--sh-ap-linha);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.sh-ap-aba {
  border: 0;
  background: none;
  padding: 0.6rem 0.9rem;
  margin-bottom: -2px;
  border-bottom: 3px solid transparent;
  color: var(--sh-ap-suave);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
.sh-ap-aba[aria-selected="true"] {
  color: var(--sh-ap-tinta);
  border-bottom-color: var(--sh-ap-destaque);
}
.sh-ap-aba:focus-visible,
.sh-ap-ordenar:focus-visible {
  outline: 2px solid var(--sh-ap-destaque);
  outline-offset: 2px;
}

/* ---------- Progresso ---------- */
.sh-ap-progresso {
  margin-bottom: 1.25rem;
}
.sh-ap-rotulo {
  color: var(--sh-ap-suave);
  font-size: 0.85rem;
  font-weight: 600;
}
.sh-ap-pst {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.sh-ap-trilho {
  height: 8px;
  margin: 0.35rem 0;
  border-radius: 999px;
  background: var(--sh-ap-linha);
  overflow: hidden;
}
.sh-ap-trilho-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sh-ap-destaque);
  transition: width 0.6s ease;
}
.sh-ap-secoes {
  color: var(--sh-ap-suave);
  font-size: 0.8rem;
}

/* ---------- Duelo (2 candidatos, barra dividida) ---------- */
.sh-ap-duelo {
  display: flex;
  height: 2.5rem;
  margin-bottom: 1.25rem;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--sh-ap-linha);
}
.sh-ap-duelo-lado {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--sh-ap-cor);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  transition: flex-basis 0.6s ease;
  font-variant-numeric: tabular-nums;
}
.sh-ap-duelo-lado:last-child {
  justify-content: flex-end;
}
.sh-ap-duelo-meio {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.85);
}

/* ---------- Candidatos ---------- */
.sh-ap-cands {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.sh-ap-cand {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--sh-ap-linha);
}
.sh-ap-foto {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sh-ap-fundo);
  border: 3px solid var(--sh-ap-cor, var(--sh-ap-linha));
}
.sh-ap-cand-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
}
.sh-ap-cand-nome {
  font-weight: 800;
  font-size: 1rem;
}
.sh-ap-cand-partido {
  color: var(--sh-ap-suave);
  font-size: 0.8rem;
}
.sh-ap-cand-situacao {
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  background: var(--sh-ap-escuro);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.sh-ap-barra {
  height: 8px;
  border-radius: 999px;
  background: var(--sh-ap-fundo);
  overflow: hidden;
}
.sh-ap-barra-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sh-ap-cor, #6c757d);
  transition: width 0.6s ease;
}
.sh-ap-cand-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sh-ap-cand-pct {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}
.sh-ap-cand-votos {
  color: var(--sh-ap-suave);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ---------- Brancos, nulos, abstenção ---------- */
.sh-ap-numeros {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0;
}
@media (min-width: 768px) {
  .sh-ap-numeros {
    grid-template-columns: repeat(4, 1fr);
  }
}
.sh-ap-numeros > div {
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--sh-ap-fundo);
}
.sh-ap-numeros dt {
  color: var(--sh-ap-suave);
  font-size: 0.78rem;
  font-weight: 600;
}
.sh-ap-numeros dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Municípios ---------- */
.sh-ap-mun-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.sh-ap-mun-topo .form-control {
  flex: 1 1 16rem;
  max-width: 24rem;
}
.sh-ap-mun-status {
  color: var(--sh-ap-suave);
  font-size: 0.8rem;
}
.sh-ap-tabela {
  font-size: 0.9rem;
}
.sh-ap-tabela th {
  white-space: nowrap;
}
.sh-ap-mun-nome {
  font-weight: 600;
  white-space: normal !important;
}
.sh-ap-mun-pst {
  font-variant-numeric: tabular-nums;
}
.sh-ap-ordenar {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 700;
  color: var(--sh-ap-link);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* ---------- Mapa dos estados ---------- */
.sh-ap-mapa {
  max-width: 560px;
  margin: 0 auto;
}
.sh-ap-mapa-svg {
  display: block;
  width: 100%;
  height: auto;
}
.sh-ap-uf {
  fill: #dee2e6; /* sem votos apurados */
  stroke: #fff;
  stroke-width: 1;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.4s ease;
}
.sh-ap-uf.is-empate {
  fill: #adb5bd;
}
.sh-ap-uf:hover {
  opacity: 0.85;
}
.sh-ap-uf:focus {
  outline: none;
}
.sh-ap-uf:focus-visible,
.sh-ap-uf.is-selecionado {
  stroke: var(--sh-ap-escuro);
  stroke-width: 2.5;
}
.sh-ap-credito {
  display: block;
  margin-top: 0.5rem;
  color: var(--sh-ap-suave);
  font-size: 0.75rem;
  text-align: center;
}
.sh-ap-credito a {
  color: var(--sh-ap-suave);
}

.sh-ap-legenda {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.sh-ap-legenda li {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.sh-ap-legenda-cor {
  width: 0.95em;
  height: 0.95em;
  border-radius: 3px;
  background: var(--sh-ap-cor, #dee2e6);
}
.sh-ap-legenda .is-empate .sh-ap-legenda-cor {
  background: #adb5bd;
}

/* Quadro do estado selecionado */
.sh-ap-uf-info {
  padding: 1rem;
  border: 1px solid var(--sh-ap-linha);
  border-top: 4px solid var(--sh-ap-destaque);
  border-radius: 6px;
}
.sh-ap-uf-nome {
  font-size: 1.25rem;
  margin: 0 0 0.15rem;
}
.sh-ap-uf-pst {
  color: var(--sh-ap-suave);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}
.sh-ap-uf-cands {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sh-ap-uf-cands li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--sh-ap-linha);
}
.sh-ap-uf-cands .sh-ap-mun-cand {
  white-space: normal;
}
.sh-ap-uf-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sh-ap-uf-num strong {
  display: block;
  font-size: 1.05rem;
}
.sh-ap-uf-num small {
  color: var(--sh-ap-suave);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Linhas da tabela de estados selecionam no mapa */
.sh-ap-tabela tr[data-uf] {
  cursor: pointer;
}
.sh-ap-tabela tr.is-selecionado > * {
  --bs-table-accent-bg: #fdecee;
  --bs-table-bg-state: #fdecee;
  background-color: #fdecee;
}

/* ---------- Compartilhar (complementa .sh-share-btn do style.css) ---------- */
button.sh-share-btn {
  background: none;
  font-family: inherit;
  line-height: inherit;
}
.sh-share-telegram {
  color: #229ed9;
  border-color: #229ed9;
}
.sh-share-telegram:hover {
  background-color: #229ed9;
  color: #fff !important;
}
.sh-share-copiar {
  color: #555;
  border-color: #ced4da;
}
.sh-share-copiar:hover {
  background-color: var(--sh-ap-escuro);
  border-color: var(--sh-ap-escuro);
  color: #fff;
}

/* ---------- Publicidade (banners 4:1 que se alternam) ---------- */
.sh-ap-publicidade {
  position: relative;
  aspect-ratio: 4 / 1;
  overflow: hidden;
  background: #f8f9fa;
  border-radius: 6px;
}
.sh-ap-pub-item {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.sh-ap-pub-item.is-ativo {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.sh-ap-pub-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sh-ap-pub-rotulo {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ===========================
   Modo live (?modo=live) — tela 9:16 para o OBS
   Tudo em "em" a partir de --sh-ap-u (1/27 da largura): em 1080×1920, 1em = 40px
   =========================== */
.sh-ap-live-body {
  margin: 0;
  background: #16191c;
  overflow: hidden;
}
.sh-ap-live {
  --sh-ap-u: min(calc(100vw / 27), calc(100vh / 48));
  --sh-ap-painel: #2b3035;
  --sh-ap-trilho-escuro: #3a4047;
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(var(--sh-ap-u) * 27);
  height: calc(var(--sh-ap-u) * 48);
  margin: 0 auto;
  overflow: hidden;
  background: var(--sh-ap-escuro);
  color: #fff;
  font-size: var(--sh-ap-u);
  line-height: 1.3;
}
.sh-ap-live .sh-ap-publicidade {
  flex: none;
  border-radius: 0;
}
.sh-ap-live .sh-ap-pub-rotulo {
  top: 0.3em;
  right: 0.4em;
  font-size: 0.35em;
}

.sh-ap-live-topo {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.55em 0.9em;
  border-bottom: 0.12em solid var(--sh-ap-destaque);
}
.sh-ap-live-logo {
  height: 1.1em;
  width: auto;
}
.sh-ap-live .sh-ap-selo {
  font-size: 0.5em;
  padding: 0.35em 0.75em;
}
.sh-ap-live-relogio {
  margin-left: auto;
  font-size: 0.95em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Palco: as cenas ficam empilhadas e só a ativa aparece */
.sh-ap-live-palco {
  position: relative;
  flex: 1;
  min-height: 0;
}
.sh-ap-cena {
  position: absolute;
  inset: 0 0.9em;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.sh-ap-cena.is-ativa {
  opacity: 1;
}
.sh-ap-live-titulo {
  margin: 0.8em 0 0.6em;
  padding-left: 0.45em;
  border-left: 0.2em solid var(--sh-ap-destaque);
  color: #fff;
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sh-ap-live-pst {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.7em;
  color: #ced4da;
}
.sh-ap-live-pst strong {
  color: #fff;
  font-size: 1.6em;
  font-variant-numeric: tabular-nums;
}
.sh-ap-live-trilho {
  height: 0.4em;
  margin: 0.25em 0 0.8em;
  border-radius: 999px;
  background: var(--sh-ap-trilho-escuro);
  overflow: hidden;
}
.sh-ap-live-trilho span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sh-ap-destaque);
  transition: width 0.8s ease;
}

.sh-ap-live-cands {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: 0.6em;
}
.sh-ap-live-cand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45em;
  padding: 1.4em 0.6em;
  border-top: 0.3em solid var(--sh-ap-cor);
  border-radius: 0.35em;
  background: var(--sh-ap-painel);
  text-align: center;
}
.sh-ap-live-foto {
  width: 10em;
  height: 10em;
  border-radius: 50%;
  border: 0.22em solid var(--sh-ap-cor);
  object-fit: cover;
  background: var(--sh-ap-trilho-escuro);
}
.sh-ap-live-nome {
  font-size: 1.05em;
  font-weight: 800;
  text-transform: uppercase;
}
.sh-ap-live-pct {
  font-size: 2.9em;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sh-ap-live-barra {
  width: 100%;
  height: 0.45em;
  border-radius: 999px;
  background: var(--sh-ap-trilho-escuro);
  overflow: hidden;
}
.sh-ap-live-barra span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sh-ap-cor);
  transition: width 0.8s ease;
}
.sh-ap-live-votos {
  font-size: 0.7em;
  color: #adb5bd;
  font-variant-numeric: tabular-nums;
}
.sh-ap-live-eleito {
  padding: 0.25em 0.7em;
  border-radius: 3px;
  background: #fff;
  color: var(--sh-ap-escuro);
  font-size: 0.55em;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.sh-ap-live-diferenca {
  margin: 0.7em 0 1em;
  text-align: center;
  font-size: 0.9em;
  font-weight: 700;
  color: #dee2e6;
}

/* Cena do mapa */
.sh-ap-live .sh-ap-legenda {
  font-size: 0.6em;
  margin-bottom: 0.4em;
}
.sh-ap-live .sh-ap-legenda .is-vazio .sh-ap-legenda-cor {
  background: #495057;
}
.sh-ap-live-mapa {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
}
.sh-ap-live-mapa .sh-ap-mapa-svg {
  width: auto;
  max-width: 100%;
  height: 100%;
}
.sh-ap-live .sh-ap-uf {
  fill: #495057;
  stroke: var(--sh-ap-escuro);
  cursor: default;
}
.sh-ap-live-contagem {
  margin: 0.5em 0 1em;
  text-align: center;
  font-size: 0.7em;
  font-weight: 700;
}

/* Cena dos municípios */
.sh-ap-live-mun {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  list-style: none;
  padding: 0;
  margin: 0 0 0.6em;
  font-size: 0.85em;
}
.sh-ap-live-mun li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.8em;
  padding: 0.5em 0.2em;
  border-bottom: 1px solid var(--sh-ap-trilho-escuro);
}
.sh-ap-live-mun-nome {
  font-weight: 700;
}
.sh-ap-live-mun-pst {
  min-width: 7.5em;
  text-align: right;
  color: #adb5bd;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
.sh-ap-live-vazio {
  display: block !important;
  color: #adb5bd;
}

/* Indicadores das cenas: a barra da cena ativa enche no tempo da troca */
.sh-ap-live-indicadores {
  flex: none;
  display: flex;
  gap: 0.4em;
  padding: 0 0.9em 0.6em;
}
.sh-ap-live-marca {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  color: #868e96;
  font-size: 0.45em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sh-ap-live-marca::after {
  content: "";
  height: 0.6em;
  border-radius: 999px;
  background: linear-gradient(var(--sh-ap-destaque), var(--sh-ap-destaque)) left / 0% 100% no-repeat,
    var(--sh-ap-trilho-escuro);
}
.sh-ap-live-marca.is-ativa {
  color: #fff;
}
.sh-ap-live-marca.is-ativa::after {
  animation: sh-ap-tempo var(--sh-ap-duracao, 15s) linear forwards;
}
.is-cena-fixa .sh-ap-live-marca.is-ativa::after {
  animation: none;
  background-size: 100% 100%, auto;
}
@keyframes sh-ap-tempo {
  to { background-size: 100% 100%, auto; }
}

.sh-ap-live-rodape {
  flex: none;
  padding: 0.55em 0.9em 0.65em;
  background: var(--sh-ap-destaque);
  text-align: center;
  line-height: 1.25;
}
.sh-ap-live-rodape span {
  display: block;
  font-size: 0.6em;
  font-weight: 600;
}
.sh-ap-live-rodape strong {
  display: block;
  font-size: 1em;
  font-weight: 900;
}
.sh-ap-live-rodape small {
  display: block;
  font-size: 0.42em;
  opacity: 0.9;
}

/* ---------- Fonte ---------- */
.sh-ap-fonte {
  color: var(--sh-ap-suave);
  font-size: 0.8rem;
  line-height: 1.5;
  border-top: 1px solid var(--sh-ap-linha);
  padding-top: 0.75rem;
}

@media (max-width: 576px) {
  .sh-ap-cand {
    grid-template-columns: 44px 1fr auto;
    gap: 0.6rem;
  }
  .sh-ap-foto {
    width: 44px;
    height: 44px;
  }
  .sh-ap-cand-pct {
    font-size: 1.15rem;
  }
  .sh-ap-faixa-cta {
    margin-left: 0;
  }
  .sh-ap-aba {
    padding: 0.6rem 0.55rem;
    font-size: 0.9rem;
  }
}
