/*
 * Referendo do beta no site cascabel.com.br (scripts/marketing/referendo-site.mjs, 28/10/2026): a janela que dá para fechar
 * e o selo discreto que reabre. Couro, madeira e latão do site. Sem fonte nem imagem de fora (a CSP só aceita 'self').
 * Cores próprias com recuo, para valer também nas páginas que não carregam a folha da home.
 */
.ref-selo[hidden], .ref-pop[hidden] { display: none !important; }

.ref-selo {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  min-height: 44px; padding: 8px 16px 8px 10px; border: 1px solid #8a6e50; border-radius: 999px; background: #16110d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); color: #f3ead9 !important; font: 600 14px/1.25 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  text-decoration: none; transition: border-color .18s, transform .18s;
}
.ref-selo:hover { border-color: #dfb36a; transform: translateY(-1px); color: #f3ead9 !important; }
.ref-selo:focus-visible { outline: 3px solid #f6d38a; outline-offset: 3px; }
/* Urna em traço: a caixa e a cédula entrando pela fenda. */
.ref-selo-marca { position: relative; flex: none; width: 20px; height: 20px; }
.ref-selo-marca::before { content: ""; position: absolute; left: 6px; top: 0; width: 8px; height: 9px; border: 2px solid #f0cd8a; border-bottom: 0; border-radius: 1px 1px 0 0; }
.ref-selo-marca::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; border: 2px solid #f0cd8a; border-radius: 2px; }
html.ref-selo-espaco body::after { content: ""; display: block; height: 72px; background: #100c09; }
.ref-selo-texto b { color: #f0cd8a; font-weight: 700; }
.ref-selo-texto span { color: #d6c8ae; font-weight: 400; }
html.ref-pop-aberta { overflow: hidden; }
/* Ao fechar a janela que abriu sozinha, o foco volta ao conteúdo: sem contorno em volta da página inteira. */
#conteudo[tabindex="-1"]:focus { outline: none; }
.ref-calendario { margin: 14px 0 0 !important; padding: 14px 16px 14px 18px; border: 1px solid rgba(43, 33, 24, .35); border-left: 4px solid #b88a45; border-radius: 4px; background: rgba(255, 250, 235, .6); color: #2b2118; font: 15px/1.5 "Segoe UI", system-ui, sans-serif; }
.ref-calendario a { display: flex; width: max-content; align-items: center; min-height: 40px; margin-top: 6px; padding: 0 14px; border: 1px solid #6b4a14; border-radius: 4px; color: #2b2118 !important; font-weight: 700; text-decoration: none; }
.ref-calendario a:hover { background: rgba(107, 74, 20, .12); }

.ref-pop { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ref-pop-fundo { position: absolute; inset: 0; background: rgba(10, 7, 5, .74); }
@supports (backdrop-filter: blur(4px)) { .ref-pop-fundo { background: rgba(10, 7, 5, .6); backdrop-filter: blur(4px); } }
.ref-pop-caixa {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 620px; max-height: calc(100vh - 48px); overflow: hidden;
  border: 1px solid #8a6e50; border-radius: 10px; background: linear-gradient(180deg, #241c15, #1b1510); color: #f3ead9;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  animation: ref-pop-entra .22s ease-out;
}
.ref-pop-caixa:focus { outline: none; }
.ref-pop-caixa:focus-visible { outline: none; }
@keyframes ref-pop-entra { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ref-pop-caixa { animation: none; } .ref-selo { transition: none; } }

.ref-pop-x {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(243, 234, 217, .35); border-radius: 50%; background: rgba(16, 12, 9, .78); color: #f3ead9; font: 400 28px/1 Georgia, serif; cursor: pointer;
}
.ref-pop-x:hover { border-color: #dfb36a; color: #f0cd8a; }
.ref-pop-x:focus-visible { outline: 3px solid #f6d38a; outline-offset: 2px; }

.ref-pop-arte { position: relative; flex: none; margin: 0; }
.ref-pop-arte img { display: block; width: 100%; height: auto; aspect-ratio: 1120 / 270; object-fit: cover; object-position: 50% 62%; border-bottom: 1px solid #45372a; }
.ref-pop-arte::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(0deg, #241c15, rgba(36, 28, 21, 0)); pointer-events: none; }
.ref-pop-tag { position: absolute; left: 12px; bottom: 12px; z-index: 1; padding: 3px 9px; border-radius: 999px; background: rgba(20, 15, 11, .72); color: #d6c8ae; font: 600 11px/1.4 "Segoe UI", system-ui, sans-serif; letter-spacing: .04em; }

.ref-pop-corpo { overflow-y: auto; padding: 6px 28px 24px; overscroll-behavior: contain; }
.ref-pop .ref-pop-orn { margin: 0 0 8px; color: #dfb36a; font: 700 12px/1.4 "Segoe UI", system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.ref-pop h2 { text-wrap: balance; margin: 0 0 10px; color: #f3ead9; font: 400 clamp(26px, 4.2vw, 32px)/1.12 "Rye", Georgia, "Times New Roman", serif; letter-spacing: .01em; }
.ref-pop p { text-wrap: pretty; margin: 0 0 12px; color: #d6c8ae; font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
.ref-pop-rotulo { margin: 16px 0 6px !important; color: #a89a82 !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: .12em; text-transform: uppercase; }
.ref-pop .ref-pop-opcoes { margin: 0 0 22px; padding: 0; list-style: none; border-top: 1px solid #45372a; }
.ref-pop-opcoes li { display: flex; align-items: baseline; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #45372a; color: #f3ead9; font: 400 15px/1.4 "Segoe UI", system-ui, sans-serif; }
.ref-pop-opcoes li span { flex: none; width: 18px; color: #dfb36a; font: 700 15px/1.4 "Segoe UI", system-ui, sans-serif; font-variant-numeric: lining-nums tabular-nums; }
.ref-pop-prazo { margin-top: 4px !important; color: #f3ead9 !important; }
.ref-pop-prazo strong { color: #f0cd8a; }
.ref-pop-nota { margin: 14px 0 0 !important; font-size: 14px !important; color: #d6c8ae !important; }
.ref-pop-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.ref-pop-botao {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 4px;
  background: linear-gradient(180deg, #f0cd8a, #dfb36a); color: #1a1511 !important; font: 700 17px/1.2 "Segoe UI", system-ui, sans-serif; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 #0006;
}
.ref-pop-botao:hover { background: #f0cd8a; color: #1a1511 !important; }
.ref-pop-botao:focus-visible, .ref-pop-depois:focus-visible { outline: 3px solid #f6d38a; outline-offset: 3px; }
.ref-pop-depois { min-height: 44px; padding: 0 6px; border: 0; background: none; color: #d6c8ae; font: 600 15px/1.2 "Segoe UI", system-ui, sans-serif; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.ref-pop-depois:hover { color: #f3ead9; }

/* Celular: a janela sobe de baixo e ocupa quase a tela toda, com o botão sempre à mão. */
@media (max-width: 600px) {
  .ref-pop { align-items: flex-end; padding: 0; }
  .ref-pop-caixa { max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 14px 14px 0 0; border-bottom: 0; animation-name: ref-pop-sobe; }
  @keyframes ref-pop-sobe { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .ref-pop-arte img { aspect-ratio: 4 / 1; }
  .ref-pop h2 { font-size: 22px; }
  .ref-pop .ref-pop-opcoes li { padding: 4px 2px; }
  .ref-pop-orn { margin-bottom: 4px !important; }
  .ref-pop p { font-size: 15px; }
  .ref-pop-corpo { padding: 2px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .ref-pop-opcoes li { padding: 6px 2px; font-size: 14px; }
  .ref-pop-opcoes { margin-bottom: 14px; }
  .ref-pop-acoes { flex-wrap: nowrap; gap: 12px; margin-top: 14px; }
  .ref-pop-botao { flex: 1 1 auto; min-height: 50px; padding: 0 16px; font-size: 16px; }
  .ref-pop-depois { flex: none; }
  .ref-selo { right: 12px; bottom: 12px; min-height: 44px; padding: 6px 12px 6px 10px; font-size: 13px; }
  .ref-selo-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ref-selo::after { content: "Votar"; color: #f0cd8a; font-weight: 700; }
}
