/* Ballot contests component */

.ballot-contests {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ballot-contests .contests-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ballot-contests h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
}

.ballot-contests .contests-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ballot-contests .contests-toggle-all {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 650;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ballot-contests .contests-toggle-all .icon {
  width: 16px;
  height: 16px;
}

.ballot-contests .contests-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ballot-contests .contests-filters span {
  font-size: 0.85rem;
  color: var(--muted);
}

.ballot-contests .contests-filter {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 650;
  padding: 6px 12px;
  cursor: pointer;
}

.ballot-contests .contests-filter.on {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  border-color: var(--accent);
}

.ballot-contests .contests-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ballot-contests .contests-group-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  gap: 8px;
}

.ballot-contests .contests-group-head .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.ballot-contests .contests-group-head[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}

.ballot-contests .contests-group-head:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ballot-contests .contest {
  display: flex;
  flex-direction: column;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  gap: 10px;
}

.ballot-contests .contest header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ballot-contests .contest h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.ballot-contests .contest-learn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}

.ballot-contests .contest-learn .icon {
  width: 16px;
  height: 16px;
}

.ballot-contests .contest-learn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ballot-contests .contest-candidates {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
}

.ballot-contests .contest-candidates li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ballot-contests .contest-more {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 650;
  padding: 8px 12px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s ease;
}

.ballot-contests .contest-more:hover {
  background: var(--surface);
}

.ballot-contests .contest-more:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ballot-contests .contests-empty {
  color: var(--muted);
  font-size: 1rem;
  padding: 16px;
  text-align: center;
}

/* Responsive: no sideways scroll at 400px */
@media (max-width: 400px) {
  .ballot-contests {
    padding: 0 4px;
  }
}
/* Group headers: title and count on the left, chevron on the right; the row stays quiet about missing websites. */
.ballot-contests .contests-group-head { justify-content: flex-start; gap: 10px; }
.ballot-contests .contests-group-head > svg { margin-left: auto; }
.ballot-contests .website-unknown { display: none; }
.ballot-contests .suggest-website { background: none; border: 0; padding: 0; font-size: .75rem; color: var(--muted); text-decoration: underline; font-weight: 400; cursor: pointer; }
