/* ============================================================
   styles.css — Eleições 2026
   ============================================================ */

/* ── Base ─────────────────────────────────────────────────── */


/* ── Page wrapper ─────────────────────────────────────────── */
.page-template-page-agregador {
  background-color: #FAFAFA;
}

.page-wrapper {
  max-width: 1120px;
  margin: 20px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: #fafafa;
  padding: 16px 16px;
}

/* ── Header ───────────────────────────────────────────────── */
.page-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.header-eyebrow {
  background: #dcfce7;
  border-radius: 100px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #008732;
  white-space: nowrap;
  display: inline-flex;
  align-self: flex-start;
}

.header-title {
  font-size: 40px;
  font-weight: 600;
  color: #050505;
  line-height: 1.402;
  margin: 0;
}

.header-cargo {
  font-size: 30px;
  font-weight: 400;
  color: #484a48;
  line-height: 1.402;
  margin: 0;
}

.header-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: #484a48;
  line-height: 1.4;
}

.fonte-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 20px;
  width: 100%;
  box-sizing: border-box;
}
.fonte-bar__label {
  font-size: 14px;
  font-weight: 600;
  color: #484a48;
  letter-spacing: 0.04em;
}
.fonte-bar__value {
  font-size: 14px;
  font-weight: 700;
  color: #050505;
  letter-spacing: 0.04em;
  background: #f1f1f1;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  width: 110px;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ── Layout ───────────────────────────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}
.page-layout--single {
  grid-template-columns: 1fr;
}

/* ── Navigation ───────────────────────────────────────────── */
.page-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  display: none;
}
.page-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  padding: 8px 12px;
  border-radius: 4px;
  border: 0.5px solid #050505;
  font-family: 'Figtree', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  background: #fff;
  color: #050505;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 35px;
}
.nav-btn.active,
.nav-btn:hover { background: #050505; color: #fff; }
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Tokens compartilhados ────────────────────────────────── */
.candidate-photo {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e8e8;
}
.candidate-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

.candidate-content { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.candidate-info-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.candidate-name-party { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.candidate-party { font-size: 14px; font-weight: 400; color: #484a48; }

.pct-badge { border-radius: 100px; padding: 4px 6px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* Avatares especiais (Voto branco/Nulo e Indecisos) */
.candidate-photo--blank {
  background: #fff;
  border: 1px solid #050505;
}
.candidate-photo--question {
  background: #fff;
  border: 1px solid #d8dbd8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #484a48;
  font-family: 'Figtree', sans-serif;
}

.progress-wrap { height: 4px; background: #ebebeb; border-radius: 2px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 2px; transform-origin: left center; transform: scaleX(0); }

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.date-badge {
  background: #dcfce7;
  border-radius: 2px;
  padding: 1px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #008732;
  white-space: nowrap;
}

/* ── Card principal ───────────────────────────────────────── */
.card {
  background: #fff;
  border: 0.5px solid #f0eff0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

.badge-title {
  background: rgba(216,216,216,0.4);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 20px;
  font-weight: 600;
}

.header-actions { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.action-label { font-size: 14px; font-weight: 600; color: #484a48; cursor: pointer;}

/* Botão "Exibir gráfico" no card header */
.chart-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Figtree', sans-serif;
  padding: 0;
}
.chart-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #484a48;
  cursor: pointer;
}
.chart-toggle-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(216,216,216,0.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  color: #484a48;
}
.chart-toggle-btn:hover .chart-toggle-icon { background: rgba(200,200,200,0.6); }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(216,216,216,0.4);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(200,200,200,0.6); }
.icon-btn.dark  { background: #050505; }
.icon-btn.dark:hover { background: #333; }

/* Tabs */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid #d8d8d8; }
.tab {
  font-size: 16px; font-weight: 600;
  padding: 0 8px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
  user-select: none;
}
.tab.active { border-bottom-color: #050505; }



/* Lista de candidatos — card principal (60px) */
.card .candidates-list { display: flex; flex-direction: column; gap: 16px; }
.card .candidate-item {
  background: #fff;
  border: 0.5px solid #d8dbd8;
  border-radius: 12px;
  padding: 12px;
  display: flex; gap: 8px; align-items: center;
}
.card .candidate-photo { width: 60px; height: 60px; }
.card .candidate-name  { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .pct-badge       { font-size: 18px; }

/* ── Seção de gráfico ─────────────────────────────────────── */
.chart-section { display: flex; flex-direction: column; gap: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; }
.section-title  { font-size: 18px; font-weight: 600; }

/* Filter panel */
.filter-panel {
  background: #fff;
  border: 0.5px solid #f0eff0;
  border-radius: 12px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.filter-label { font-size: 14px; font-weight: 600; }
.filter-chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chip {
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 700;
  border: 1px solid;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity 0.2s;
  user-select: none;
}
.chip.dim { opacity: 0.25; }

.show-all {
  display: none; /* só aparece no mobile via media query */
  align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none;
}

/* Chart */
.chart-container {
  background: #fafafa;
  border: 0.5px solid #d8d8d8;
  border-radius: 12px;
  padding: 12px 8px 8px;
  overflow: hidden;
}
#voteChart {
  display: block;
  width: 100% !important;
  height: 240px !important;
}

.chart-footer { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }

/* Notes */
.notes { font-size: 12px; font-weight: 400; color: #484a48; line-height: 1.6; }
.notes p { margin-bottom: 2px; }

.header-question {
  font-size:18px;
  width:100%;
  font-weight:600;
}

.share-title {
  font-size: 12px;
  text-transform: uppercase;
}


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .header-title  {
    font-size: 36px;
  }
  .header-cargo {
    font-size: 22px;
  }
  .page-layout-main {
    width: 100%;
    overflow: hidden;
    position: relative;
  }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { max-width: 100%; }
  .header-subtitle { font-size: 18px; }

  /* Filtro de estados */
  .trigger-label { font-size: 16px; }
  .states-wrap { gap: 8px; }
  .state-pill { font-size: 14px; }

  .header-question {font-size: 16px;}
}

@media (max-width: 530px) {
  .share-title {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Esconde abas acima da lista; mostra as do chart section */

  .chart-tabs      { display: flex; }

  /* Chips com wrap normal — sem scroll lateral */
  .filter-chips { flex-wrap: wrap; }

  /* Chips excedentes ocultas até clicar "Exibir todos" */
  .chip-hidden { display: none; }

  /* "Exibir todos" visível no mobile */
  .show-all { display: flex; }
}

@media (max-width: 480px) {
  .header-subtitle { font-size: 18px; }
  .card .candidate-name { font-size: 18px; }
  .card .pct-badge { font-size: 18px; }
  .filter-chips { gap: 6px; }
  .chip { font-size: 10px; padding: 4px 8px; }
  .sidebar .candidate-name { font-size: 18px; }
  .sidebar .pct-badge { font-size: 13px; }
  .sidebar-title { font-size: 20px; }
  .poll-badge { font-size: 15px; }

  /* Filtro de estados */
  .dropdown-trigger { padding: 8px; }
  .trigger-pill { padding: 6px 10px; }
  .trigger-label { font-size: 16px; }
  .state-pill { font-size: 13px; padding: 3px 8px; }
  .dropdown-panel.open { padding: 14px; }

  /* Filtro de fontes */
  .fonte-label { font-size: 16px; }
  .fonte-btn { font-size: 12px; padding: 6px 10px; }
}

