/* Base comum das páginas no BEDS (claro e escuro). Carregar depois de beds.css e antes do CSS da página.
   <body class="beds site ..."> ativa tudo daqui. Peças: .wrap, .sr-only, .pular, menu (.nav, .nav-fixa,
   .marca, .logo, .site-abas, .ap-sinal, .nav-acoes; .nav-compacta e .menu-pop nas páginas internas), botões (.btn, .botao, .btn-primario, .btn-discreto, .btn-ico),
   .cartao, .rot, .pilula, .urna (número de urna em caixinhas cor de papel, a assinatura da colinha), select,
   .entrada (campo de texto) e .rodape. */
.site {
  --gutter: 16px;
  --papel: #ebe6d8; --tinta: #1c1b18;        /* caixas do número de urna e a folha da colinha */
  --vivo: var(--brand);
  margin: 0;
}
@media (min-width: 720px) { .site { --gutter: 24px; } }
.site *, .site *::before, .site *::after { box-sizing: border-box; }
.site [hidden] { display: none !important; }
.site :where(h1, h2, h3, h4, p) { margin: 0; }
.site :focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--largura, 1120px); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.pular { position: absolute; inset-inline-start: 12px; top: -64px; z-index: 50; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--primary); color: var(--primary-foreground) !important; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.pular:focus { top: 12px; }
main:focus { outline: none; }
.rot { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }

/* ---------- menu do site: as 4 páginas em abas, iguais em todas ---------- */
.nav { border-bottom: 1px solid var(--border-strong); background: var(--background); }
.nav-fixa { position: sticky; top: 0; z-index: 20; background: #191919f2; backdrop-filter: blur(8px); }
.nav-in { display: flex; align-items: stretch; gap: 0 20px; min-height: 56px; padding: 0 var(--gutter); }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); min-height: 44px; align-self: center; }
.marca b { display: block; font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.marca small { display: block; font-size: 12px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; }
/* símbolo da marca (logo.svg): a folha da colinha em papel e tinta, inline para herdar --papel e --tinta. No claro
   ganha o mesmo contorno leve das caixinhas do número de urna para não sumir no branco. */
.logo { width: 32px; height: 32px; flex: none; display: block; overflow: visible; }
.logo .lp { fill: var(--papel); }
.logo .lt { fill: var(--tinta); }
[data-tema=claro] .logo .lp { stroke: #00000029; stroke-width: 1; vector-effect: non-scaling-stroke; }
.site-abas { display: flex; margin-inline-end: auto; }
.site-abas a { display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); text-decoration: none; white-space: nowrap; border-block: 2px solid transparent; }
.site-abas a[aria-current] { color: var(--heading); border-bottom-color: var(--brand); }
.site-abas a:focus-visible { outline-offset: -4px; }
@media (hover: hover) { .site-abas a:hover { color: var(--heading); } }
.ap-sinal { margin-inline-start: 6px; font: 500 10px/1 var(--font-mono); padding: 3px 5px; border-radius: 4px; background: var(--secondary); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border-strong); }
.ap-sinal.vivo { display: inline-flex; align-items: center; gap: 4px; text-transform: uppercase; }
.ap-sinal.vivo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--vivo); }
.nav-acoes { display: flex; align-items: center; gap: 8px; }
/* abas na segunda linha até 1023px: entre 760 e 1023 as abas e as ações não cabiam numa linha só */
@media (max-width: 1023px) {
  .nav-in { flex-wrap: wrap; min-height: 0; }
  .marca { padding: 6px 0; }
  .marca small { display: none; }
  .nav-acoes { margin-inline-start: auto; padding: 6px 0; }
  .site-abas { order: 3; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); padding: 0 4px; height: 44px; border-top: 1px solid var(--border-strong); overflow-x: auto; scrollbar-width: none; }
  .site-abas a { flex: 1 0 auto; justify-content: center; padding: 0 8px; }
}
/* celular estreito: a marca fica só no símbolo (o nome continua para leitor de tela) para caber o botão de tema */
@media (max-width: 479px) {
  .so-largo { display: none; }
  .marca > span:last-child:not(.logo) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- menu compacto das páginas internas (.nav-compacta): o símbolo leva à home, título da página e botão Menu.
   O menu (.menu-pop) lista as páginas, Minha colinha e o tema; nav.js abre, prende o foco e fecha com Esc. A home mantém as abas. */
.nav-compacta .nav-in { flex-wrap: nowrap; align-items: center; gap: 0 12px; min-height: 56px; }
.nav-compacta .marca { flex: none; padding: 0; }
a.marca:focus-visible { border-radius: 10px; }
.nav-titulo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--heading); }
.menu-site { position: relative; flex: none; margin-inline-start: auto; }
.menu-btn[aria-expanded=true] { background: var(--raised); }
.menu-pop { position: absolute; z-index: 30; top: calc(100% + 8px); inset-inline-end: 0; width: 240px; padding: 4px; border-radius: 12px; background: var(--popover); box-shadow: var(--shadow-dialog), inset 0 0 0 1px var(--border-strong); }
.menu-pop nav { display: grid; }
.menu-pop nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--foreground); font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; }
.menu-pop nav a[aria-current] { background: var(--secondary); color: var(--heading); }
.menu-pop nav a[aria-current]::after { content: ''; width: 6px; height: 6px; margin-inline-start: auto; border-radius: 50%; background: var(--brand); }
.menu-pop nav a:focus-visible { outline-offset: -2px; }
@media (hover: hover) { .menu-pop nav a:hover { background: var(--secondary); color: var(--heading); } }
.menu-rodape { display: flex; gap: 4px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.menu-rodape .botao { flex: 1; }
@media (pointer: coarse) { .menu-pop nav a { min-height: 44px; } }
@media (prefers-reduced-motion: no-preference) {
  .menu-pop:not([hidden]) { animation: menu-entra .15s cubic-bezier(.2, 0, 0, 1); transform-origin: top right; }
}
@keyframes menu-entra { from { opacity: 0; scale: .96; } }
@media (max-width: 759px) {
  .menu-rot { display: none; }
  .menu-btn { width: 36px; padding: 0; }
}
@media (max-width: 759px) and (pointer: coarse) { .menu-btn { width: 44px; } }

/* ---------- botões: .btn é o neutro; .btn-primario só na ação principal da tela ---------- */
.botao, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--secondary); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--heading); font: 500 13px/1 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s; }
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .botao:hover, .btn:hover { background: var(--raised); } }
.btn:active { scale: .96; }
.btn-primario { background: var(--primary); color: var(--primary-foreground); box-shadow: none; font-weight: 600; }
@media (hover: hover) { .btn-primario:hover { background: #fff; } }
.btn-discreto { background: transparent; box-shadow: none; color: var(--muted-foreground); }
@media (hover: hover) { .btn-discreto:hover { background: var(--secondary); color: var(--heading); } }
.btn-ico { padding: 0; width: 36px; }
.btn:disabled { opacity: .6; cursor: not-allowed; scale: none; }
@media (pointer: coarse) { .btn, .botao { min-height: 44px; } .btn-ico { width: 44px; } }

/* ---------- campos ---------- */
select { min-height: 36px; max-width: 100%; padding: 0 32px 0 10px; border: 0; border-radius: 8px; background: var(--secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23cecece' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; box-shadow: inset 0 0 0 1px var(--input); color: var(--heading); font: 400 14px var(--font-sans); appearance: none; cursor: pointer; }
.entrada { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--radius); background: var(--background); box-shadow: inset 0 0 0 1px var(--input); color: var(--heading); font: 400 16px/1.4 var(--font-sans); }
.entrada::placeholder { color: var(--muted-foreground); }
@media (pointer: coarse) { select { min-height: 44px; font-size: 16px; } }

/* ---------- superfícies ---------- */
.cartao { background: var(--card); border-radius: 12px; padding: 16px; box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.pilula { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; background: var(--secondary); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--foreground); font-size: 12px; line-height: 16px; white-space: nowrap; }
.pilula.vivo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--vivo); }
.pilula.fim::before { content: ''; width: 10px; height: 6px; margin-top: -3px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; rotate: -45deg; }

/* número de urna: uma caixinha cor de papel por dígito. <span class="urna" role="img" aria-label="número 13"><i>1</i><i>3</i></span>.
   .urna-g aumenta para destaque (cartão do candidato, colinha). */
.urna { display: inline-flex; gap: 2px; }
.urna i { display: grid; place-items: center; width: 15px; height: 19px; border-radius: 3px; background: var(--papel); color: var(--tinta); font: 400 12px/1 var(--font-mono); font-style: normal; box-shadow: inset 0 -1px 0 #0000002e; }
.urna-g { gap: 3px; }
.urna-g i { width: 26px; height: 34px; border-radius: 5px; font-size: 20px; box-shadow: inset 0 -2px 0 #0000002e; }

/* ---------- rodapé ---------- */
.rodape { padding-top: 16px; border-top: 1px solid var(--border-strong); display: grid; gap: 4px; color: var(--muted-foreground); font-size: 13px; }

@media (prefers-reduced-motion: no-preference) {
  .pilula.vivo::before, .ap-sinal.vivo::before { animation: pulso 1.6s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) { .btn, .botao { transition: none; } .btn:active { scale: none; } }
@keyframes pulso { 50% { opacity: .35; } }

/* ---------- tema: botão do menu (.tema-btn mostra o tema para onde vai) e o que no claro não vem dos tokens ---------- */
.nav-acoes .tema-btn { min-height: 36px; }
@media (pointer: coarse) { .nav-acoes .tema-btn { min-height: 44px; } }
.tema-btn .ico-lua, [data-tema=claro] .tema-btn .ico-sol { display: none; }
[data-tema=claro] .tema-btn .ico-lua { display: block; }
[data-tema=claro] .nav-fixa { background: #fffffff2; }
@media (hover: hover) { [data-tema=claro] .btn-primario:hover { background: #000; } }
[data-tema=claro] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2337352e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* caixinhas de papel no fundo branco: um contorno leve para não sumirem */
[data-tema=claro] .urna i { box-shadow: inset 0 0 0 1px #0000001f, inset 0 -1px 0 #0000002e; }
[data-tema=claro] .urna-g i { box-shadow: inset 0 0 0 1px #0000001f, inset 0 -2px 0 #0000002e; }

/* ---------- pessoas no site agora (nav.js): rodapé de todas as páginas ---------- */

/* ---------- aviso e painel de cookies (consent.js) ---------- */
.ck { position: fixed; z-index: 32; left: 16px; bottom: calc(var(--ck-base, 0px) + 16px + env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 32px)); display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--popover); color: var(--foreground); box-shadow: var(--shadow-dialog), inset 0 0 0 1px var(--border-strong); font-size: 13px; line-height: 1.45; }
.ck p { margin: 0; text-wrap: pretty; }
.ck a, .ck-dlg a { color: var(--heading); text-underline-offset: 3px; }
.ck-acoes { display: flex; justify-content: flex-end; gap: 8px; }
.ck-acoes .btn { min-height: 32px; }
@media (max-width: 639px) {
  .ck { left: 8px; right: 8px; width: auto; bottom: calc(var(--ck-base, 0px) + 8px + env(safe-area-inset-bottom)); gap: 8px; padding: 10px 12px; }
}
.ck-dlg { width: min(440px, calc(100vw - 24px)); padding: 20px; border: 0; border-radius: 16px; background: var(--card); color: var(--foreground); box-shadow: var(--shadow-dialog), inset 0 0 0 1px var(--border-strong); font-size: 13px; line-height: 1.5; }
.ck-dlg::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.ck-dlg h2 { margin: 0 0 12px; font-size: 16px; color: var(--heading); }
.ck-dlg p { margin: 0; color: var(--muted-foreground); }
.ck-cat { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-block: 12px; border-top: 1px solid var(--border-strong); }
label.ck-cat { cursor: pointer; }
.ck-dlg .ck-nome { margin-bottom: 2px; font-weight: 600; color: var(--heading); }
.ck-sempre { flex: none; font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.ck-cat input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.ck-dlg .ck-mais { padding-block: 4px 16px; border-top: 1px solid var(--border-strong); padding-top: 12px; }
.ck-rodape { display: inline-flex; gap: 16px; }
@media print { .ck { display: none !important; } }
