/* Melhorias dos widgets de resultado 2022 — R2.
   Replica a linguagem visual do resultado detalhado, sem duplicar
   comparecimento/abstenção em todos os cargos estaduais. */

.home-electorate-wrap{
  margin:8px 0 13px;
}

.home-electorate-stats{
  display:grid;
  gap:9px;
}


.home-state-participation{
  margin:10px 0 12px;
  padding:12px;
  border:1px solid #dce4ec;
  border-radius:13px;
  background:#f7f9fb;
}
.home-state-participation-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;
  color:#607080;font-size:10px;
}
.home-state-participation-head strong{color:var(--blue-deep);font-size:11px;}
.home-state-participation .home-electorate-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
.home-state-participation .home-stat{min-height:72px;}

/* Indicadores gerais de participação aparecem uma única vez no quadro estadual. */
.home-electorate-stats.has-participation{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* Cada cargo mantém apenas brancos e nulos, que variam por disputa. */
.home-electorate-stats.is-vote-only{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* Presidência ocupa toda a largura e mantém os quatro indicadores. */
.home-electorate-stats.is-president{
  grid-template-columns:repeat(4,minmax(0,1fr));
  padding:14px 24px 6px;
  gap:11px;
}

.home-stat{
  min-width:0;
  min-height:82px;
  padding:12px 13px;
  border:1px solid #dce4ec;
  border-radius:12px;
  background:#fff;
  box-shadow:0 2px 7px rgba(18,52,86,.025);
}

.home-stat span{
  display:block;
  color:#687580;
  font-size:9px;
  font-weight:850;
  letter-spacing:.045em;
  text-transform:uppercase;
}

.home-stat strong{
  display:block;
  margin-top:4px;
  color:var(--blue-deep);
  font-size:clamp(18px,1.55vw,24px);
  line-height:1.05;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.025em;
}

.home-stat small{
  display:block;
  margin-top:5px;
  color:#707a84;
  font-size:9px;
  line-height:1.25;
}

.home-stat-turnout strong{
  color:#177245;
}

/* Os quadros menores (Senado/deputados) usam duas colunas e ficam
   visualmente mais compactos que Governador. */
.home-electorate-wrap.is-office-vote-metrics .home-stat{
  min-height:72px;
  padding:10px 12px;
}

.home-electorate-wrap.is-office-vote-metrics .home-stat strong{
  font-size:clamp(17px,1.4vw,21px);
}

.home-deputy-filter-wrap{
  margin:2px 0 10px;
}

.home-deputy-filters{
  padding:9px;
  border:1px solid #e2e9ef;
  border-radius:10px;
  background:#f7f9fb;
}

.home-deputy-view-tabs{
  display:flex;
  gap:6px;
  margin-bottom:8px;
  padding-bottom:8px;
  border-bottom:1px solid #e0e8ee;
}

.home-deputy-view-tabs button{
  min-height:32px;
  border:1px solid #cbd8e2;
  border-radius:8px;
  background:#fff;
  color:#526c82;
  padding:6px 10px;
  font:850 8px/1.2 inherit;
  cursor:pointer;
}

.home-deputy-view-tabs button.is-active{
  border-color:#0f4f83;
  background:#0f4f83;
  color:#fff;
}

.home-filter-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;
  gap:7px;
  align-items:end;
}

.home-filter-field{
  min-width:0;
}

.home-filter-field label{
  display:block;
  margin-bottom:3px;
  color:var(--muted);
  font-size:7px;
  font-weight:850;
  letter-spacing:.045em;
  text-transform:uppercase;
}

.home-filter-field select{
  width:100%;
  min-height:34px;
  padding:5px 7px;
  border:1px solid #cbd7e1;
  border-radius:7px;
  background:#fff;
  color:var(--blue-deep);
  font:inherit;
  font-size:8px;
}

.home-filter-controls .featured-link-button{
  min-height:34px;
  padding:6px 9px;
  font-size:8px;
}

.home-legend-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:7px;
  padding:7px 8px;
  border-radius:7px;
  background:#fff;
  border:1px solid #e3eaf0;
}

.home-legend-summary span{
  color:var(--muted);
  font-size:7px;
  font-weight:800;
  text-transform:uppercase;
}

.home-legend-table{
  display:grid;
  width:100%;
  border:1px solid #e0e8ef;
  border-radius:10px;
  overflow:hidden;
  background:#fff;
}

.home-legend-table-head,.home-legend-table-row{
  display:grid;
  grid-template-columns:minmax(120px,1.25fr) minmax(95px,.85fr) minmax(92px,.7fr) minmax(72px,.5fr);
  gap:8px;
  align-items:center;
  padding:9px 10px;
}

.home-legend-table-head{
  background:#f2f6f9;
  color:#607487;
  font-size:7px;
  font-weight:900;
  letter-spacing:.045em;
  text-transform:uppercase;
}

.home-legend-table-row{border-top:1px solid #e7edf2;color:#486176;font-size:8px}
.home-legend-table-row>span:nth-child(n+3){text-align:right;font-variant-numeric:tabular-nums}
.home-legend-table-row b,.home-legend-table-row small{display:block}
.home-legend-table-row b{color:#173653;font-size:9px}.home-legend-table-row small{margin-top:2px;color:#788897;font-size:7px}

@media(max-width:620px){
  .home-filter-controls{grid-template-columns:1fr}
  .home-legend-table{overflow-x:auto}
  .home-legend-table-head,.home-legend-table-row{min-width:520px}
}

.home-legend-summary strong{
  color:var(--blue-deep);
  font-size:12px;
  white-space:nowrap;
}

@media(max-width:760px){
  .home-electorate-stats.is-president{
    grid-template-columns:repeat(2,minmax(0,1fr));
    padding-left:14px;
    padding-right:14px;
  }
  .home-filter-controls{
    grid-template-columns:1fr;
  }
  .home-filter-controls .featured-link-button{
    width:100%;
  }
}


@media(max-width:760px){
  .home-electorate-stats.is-president{
    grid-template-columns:repeat(2,minmax(0,1fr));
    padding-left:14px;
    padding-right:14px;
  }
  .home-electorate-stats.has-participation,
  .home-electorate-stats.is-vote-only{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:440px){
  .home-electorate-stats.has-participation{
    grid-template-columns:1fr 1fr;
  }
  .home-stat{
    min-height:74px;
    padding:10px;
  }
  .home-stat strong{
    font-size:18px;
  }
  .home-stat small{
    font-size:8px;
  }
}
