/* ============================================================
   ENQUETE — Design System v2
   Alegre, colorido, fotos em destaque · Mobile-first
   Fontes: Barlow Condensed (display) + DM Sans (corpo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800;900&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Superfícies — fundo claro */
  --bg:          #f4f6fa;
  --surface:     #ffffff;
  --surface-2:   #f0f2f7;
  --surface-3:   #e4e8f0;
  --border:      rgba(0,0,0,.08);
  --border-soft: rgba(0,0,0,.04);

  /* Texto */
  --text:        #1a1a2e;
  --text-muted:  #5a6070;
  --text-dim:    #9098a9;

  /* Tema (sobrescrito por .theme-*) */
  --accent:      #2563EB;
  --accent-dark: #1d4ed8;
  --accent-light:#dbeafe;
  --accent-glow: rgba(37,99,235,.2);
  --accent-text: #1d4ed8;
  --gold:        #f59e0b;

  /* Gradiente do hero */
  --hero-grad:   linear-gradient(135deg, #1a1a2e 0%, #2563EB 100%);

  /* Tipografia */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Espaçamento */
  --gap:   1rem;
  --gap-2: 2rem;
  --r:     .75rem;
  --r-sm:  .4rem;
  --r-lg:  1.25rem;

  /* Sombra */
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

/* Temas por programa */
.theme-blue {
  --accent:#2563EB; --accent-dark:#1d4ed8; --accent-light:#dbeafe;
  --accent-glow:rgba(37,99,235,.2); --accent-text:#1d4ed8;
  --hero-grad: linear-gradient(135deg, #1e3a8a 0%, #2563EB 60%, #3b82f6 100%);
}
.theme-orange {
  --accent:#FF6B00; --accent-dark:#E85D00; --accent-light:#FFF0E0;
  --accent-glow:rgba(255,107,0,.25); --accent-text:#CC4A00;
  --hero-grad: linear-gradient(135deg, #CC2E00 0%, #FF6B00 50%, #FFB347 100%);
}
.theme-green {
  --accent:#16a34a; --accent-dark:#15803d; --accent-light:#dcfce7;
  --accent-glow:rgba(22,163,74,.2); --accent-text:#15803d;
  --hero-grad: linear-gradient(135deg, #14532d 0%, #16a34a 60%, #22c55e 100%);
}
.theme-pink {
  --accent:#c026d3; --accent-dark:#a21caf; --accent-light:#fae8ff;
  --accent-glow:rgba(192,38,211,.2); --accent-text:#a21caf;
  --hero-grad: linear-gradient(135deg, #701a75 0%, #c026d3 60%, #e879f9 100%);
}
.theme-teal {
  --accent:#0891b2; --accent-dark:#0e7490; --accent-light:#cffafe;
  --accent-glow:rgba(8,145,178,.2); --accent-text:#0e7490;
  --hero-grad: linear-gradient(135deg, #164e63 0%, #0891b2 60%, #22d3ee 100%);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:16px; scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}
img { max-width:100%; height:auto; display:block; }
a { color:inherit; text-decoration:none; }
button { cursor:pointer; border:none; background:none; font:inherit; }
ul, ol { list-style:none; }

/* ── Tipografia ───────────────────────────────────────────── */
h1,h2,h3,h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.6rem); }

.eyebrow {
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.grid-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-2);
}

@media (min-width: 900px) {
  .grid-main { grid-template-columns: 1fr 300px; }
}

/* ── Cabeçalho ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: .95rem;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
}

.logo-text span { color: var(--accent); }

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display:none; }

.nav-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .4rem .85rem;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); background: var(--accent-light); }
.nav-link.cta {
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-sm);
  border: 2px solid var(--accent);
}
.nav-link.cta:hover { background: var(--accent-dark); }

/* ── Hero da enquete ──────────────────────────────────────── */
.poll-hero {
  background: var(--hero-grad);
  border-radius: var(--r-lg);
  padding: 2rem 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.poll-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='28'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.poll-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .25rem .75rem;
  border-radius: 99px;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}

.live-dot {
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 1.4s ease infinite;
}

@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.7); }
}

.poll-hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #fff;
  margin-bottom: .5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.poll-hero-sub {
  color: rgba(255,255,255,.85);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Grid de opções (fotos grandes) ──────────────────────── */
.poll-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
  .poll-options-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (min-width: 768px) {
  .poll-options-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.poll-option-card {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3/4;
  background: rgba(255,255,255,.1);
  border: 3px solid transparent;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}

.poll-option-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.poll-option-card.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--gold), 0 8px 24px rgba(0,0,0,.3);
  transform: translateY(-3px) scale(1.02);
}

.poll-option-card.leader {
  border-color: var(--gold);
}

.poll-option-card.eliminated {
  filter: grayscale(.7);
  opacity: .7;
}

/* Foto */
.option-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Overlay gradiente no fundo */
.option-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 50%, transparent 100%);
  pointer-events: none;
}

/* Nome do participante */
.option-card-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .5rem .6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  text-align: center;
  line-height: 1.1;
  z-index: 1;
}

/* Percentual (oculto antes de votar) */
.option-card-pct {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  padding: .2rem .5rem;
  border-radius: var(--r-sm);
  backdrop-filter: blur(4px);
  z-index: 2;
  transition: opacity .3s;
}

/* Barra de progresso na parte de baixo do card */
.option-card-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--gold);
  border-radius: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(.16,1,.3,1);
  z-index: 3;
}

/* Coroa do líder */
.option-card-crown {
  position: absolute;
  top: .4rem;
  left: .4rem;
  font-size: 1.1rem;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
  z-index: 2;
}

/* Radio hidden */
.hidden { display:none; }

/* Placeholder sem foto */
.option-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.05));
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  color: rgba(255,255,255,.6);
}

/* ── Botão de votar ───────────────────────────────────────── */
.btn-vote {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  background: #fff;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--r);
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  transition: transform .15s, box-shadow .2s, background .2s;
  border: none;
  cursor: pointer;
}
.btn-vote:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.btn-vote:active { transform: translateY(0); }
.btn-vote:disabled { opacity:.5; cursor:not-allowed; }
.btn-vote.secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: none;
}
.btn-vote.secondary:hover { background: rgba(255,255,255,.25); }

.poll-total {
  text-align: center;
  margin-top: .75rem;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
}

/* ── Cards de notícias ────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.news-card-img { aspect-ratio:16/9; overflow:hidden; background:var(--surface-2); }
.news-card-img img { width:100%; height:100%; object-fit:cover; transition:transform .4s; }
.news-card:hover .news-card-img img { transform:scale(1.04); }

.news-card-body { padding:1rem; flex:1; display:flex; flex-direction:column; gap:.4rem; }

.news-card-tag {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.news-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  line-height: 1.2;
  flex: 1;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-date { font-size:.72rem; color:var(--text-dim); margin-top:auto; }

.news-card.featured { grid-column:1/-1; flex-direction:row; }
@media (min-width: 640px) {
  .news-card.featured .news-card-img { flex:0 0 55%; aspect-ratio:auto; min-height:220px; }
  .news-card.featured .news-card-body { padding:1.5rem; }
  .news-card.featured .news-card-title { font-size:1.4rem; }
}

/* ── Seção com título ─────────────────────────────────────── */
.section { padding-block: 2rem; }
.section-header { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text);
}
.section-title::before {
  content: '';
  display: inline-block;
  width: .25rem;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
  margin-right: .6rem;
  vertical-align: middle;
}

.section-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-text);
  white-space: nowrap;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar { display:flex; flex-direction:column; gap:var(--gap); }

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.widget-header {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface-2);
}

.widget-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}

.widget-body { padding:1rem; }

/* ── Participantes ────────────────────────────────────────── */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.participant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.participant-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.participant-card.eliminated { opacity:.5; filter:grayscale(.7); }

.participant-photo { aspect-ratio:3/4; overflow:hidden; background:var(--surface-2); }
.participant-photo img { width:100%; height:100%; object-fit:cover; object-position:top; transition:transform .4s; }
.participant-card:hover .participant-photo img { transform:scale(1.06); }

.participant-info { padding:.75rem .5rem; }
.participant-name { font-family:var(--font-display); font-weight:700; font-size:.9rem; text-transform:uppercase; }
.participant-occ { font-size:.7rem; color:var(--text-muted); margin-top:.2rem; }

.participant-badge {
  display:inline-block; font-size:.6rem; font-family:var(--font-display);
  font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  padding:.15rem .5rem; border-radius:99px; margin-top:.4rem;
}
.participant-badge.active { background:var(--accent-light); color:var(--accent-text); }
.participant-badge.eliminated { background:var(--surface-2); color:var(--text-dim); }

/* ── Artigo ───────────────────────────────────────────────── */
.article-header { padding-bottom:2rem; border-bottom:1px solid var(--border); margin-bottom:2rem; }
.article-title { margin-bottom:1rem; color:var(--text); }
.article-meta { display:flex; align-items:center; gap:1rem; font-size:.8rem; color:var(--text-muted); flex-wrap:wrap; }
.article-cover { margin-bottom:2rem; border-radius:var(--r); overflow:hidden; aspect-ratio:16/9; box-shadow:var(--shadow-lg); }
.article-cover img { width:100%; height:100%; object-fit:cover; }
.article-body { font-size:1.05rem; line-height:1.8; color:var(--text); }
.article-body p { margin-bottom:1.25rem; }
.article-body h2, .article-body h3 { margin:2rem 0 .75rem; }
.article-body a { color:var(--accent-text); text-decoration:underline; text-underline-offset:3px; }
.article-body blockquote { border-left:3px solid var(--accent); padding:.75rem 1.25rem; background:var(--accent-light); border-radius:0 var(--r-sm) var(--r-sm) 0; margin:1.5rem 0; font-style:italic; color:var(--text-muted); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  margin-top: 4rem;
  background: var(--text);
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  padding-block: 2.5rem;
}
.footer-inner { display:flex; flex-wrap:wrap; gap:1.5rem; justify-content:space-between; align-items:center; }
.footer-links { display:flex; flex-wrap:wrap; gap:.5rem 1.5rem; }
.footer-links a { color:rgba(255,255,255,.5); transition:color .2s; }
.footer-links a:hover { color:#fff; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container { position:fixed; bottom:1.5rem; left:50%; transform:translateX(-50%); z-index:999; display:flex; flex-direction:column; gap:.5rem; align-items:center; pointer-events:none; }
.toast { padding:.75rem 1.5rem; border-radius:99px; font-family:var(--font-display); font-weight:700; font-size:.9rem; letter-spacing:.04em; text-transform:uppercase; white-space:nowrap; box-shadow:var(--shadow-lg); animation:toast-in .4s cubic-bezier(.16,1,.3,1) both, toast-out .4s ease 3s both; }
.toast.success { background:#16a34a; color:#fff; }
.toast.error   { background:#dc2626; color:#fff; }
.toast.info    { background:var(--accent); color:#fff; }
@keyframes toast-in  { from { opacity:0; transform:translateY(12px) scale(.95); } }
@keyframes toast-out { to   { opacity:0; transform:translateY(-8px) scale(.95); } }

/* ── Paginação ────────────────────────────────────────────── */
.pagination { display:flex; align-items:center; justify-content:center; gap:.4rem; margin-top:2rem; }
.page-btn { width:36px; height:36px; display:flex; align-items:center; justify-content:center; border-radius:var(--r-sm); font-family:var(--font-display); font-weight:700; font-size:.85rem; background:var(--surface); color:var(--text-muted); border:1px solid var(--border); transition:all .2s; }
.page-btn:hover { border-color:var(--accent); color:var(--accent-text); }
.page-btn.active { background:var(--accent); color:#fff; border-color:transparent; }

/* ── Utilitários ──────────────────────────────────────────── */
.text-center { text-align:center; }
.hidden { display:none !important; }
.mt-1 { margin-top:.5rem; }
.mt-2 { margin-top:1rem; }

/* ── Responsividade ───────────────────────────────────────── */
@media (max-width:480px) {
  .poll-options-grid { grid-template-columns: repeat(3, 1fr); gap:.5rem; }
  .option-card-name { font-size:.75rem; padding:.4rem .4rem; }
  .option-card-pct { font-size:.9rem; }
}

/* ── Acessibilidade ───────────────────────────────────────── */
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:var(--r-sm); }
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ── Mobile-first: enquetes ──────────────────────────────── */

/* Grid de fotos dos participantes nas enquetes
   Regra simples: 4 colunas mobile, 5 tablet, 6 desktop — sempre */
.poll-options-grid {
  display: grid;
  /* Usa --poll-cols se definido (número real de opções, máx 6)
     Senão usa 3 no mobile como padrão */
  grid-template-columns: repeat(var(--poll-cols, 3), 1fr);
  gap: .5rem;
  justify-items: center;
}

/* Mobile: máx 3 colunas (não aumenta se --poll-cols for menor) */
@media (max-width: 479px) {
  .poll-options-grid {
    grid-template-columns: repeat(min(var(--poll-cols, 3), 3), 1fr);
    gap: .4rem;
  }
}

/* Tablet pequeno: máx 4 */
@media (min-width: 480px) and (max-width: 639px) {
  .poll-options-grid {
    grid-template-columns: repeat(min(var(--poll-cols, 4), 4), 1fr);
    gap: .5rem;
  }
}

/* Tablet: máx 5 */
@media (min-width: 640px) and (max-width: 767px) {
  .poll-options-grid {
    grid-template-columns: repeat(min(var(--poll-cols, 5), 5), 1fr);
    gap: .6rem;
  }
}

/* Desktop: usa --poll-cols (já limitado a 6 pelo PHP) */
@media (min-width: 768px) {
  .poll-options-grid {
    grid-template-columns: repeat(var(--poll-cols, 6), 1fr);
    gap: .75rem;
  }
}

/* Card de participante */
.poll-option-card {
  width: 100%;
}

@media (max-width: 479px) {
  .poll-option-card .option-card-name {
    font-size: .6rem !important;
    padding: .25rem .2rem !important;
  }
}
