/*
 * Poll box (templates/polls/poll.html). Uses the article tokens from
 * article.css; the fallbacks keep it usable on pages without article.css.
 */

.a-poll {
  --poll-accent: var(--a-info, 211 80% 45%);
  margin: var(--a-space, 1.25em) 0;
  padding: 1.1em 1.25em 1.25em;
  border: 1px solid hsl(var(--a-border, 0 0% 88%));
  border-radius: var(--a-radius, 0.5rem);
  background: hsl(var(--a-surface, 0 0% 96%));
}
.a-poll:focus { outline: none; }
.a-poll:focus-visible { outline: 2px solid hsl(var(--poll-accent)); outline-offset: 2px; }

.a-poll__kicker {
  margin: 0 0 0.35em;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--poll-accent));
}
.a-poll__question {
  margin: 0 0 0.8em;
  font-size: 1.2em;
  line-height: 1.3;
}

.a-poll__sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Form */
.a-poll__options { margin: 0; padding: 0; border: 0; display: grid; gap: 0.5em; }
.a-poll__option {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em 0.9em;
  border: 1px solid hsl(var(--a-border, 0 0% 88%));
  border-radius: var(--a-radius, 0.5rem);
  background: hsl(var(--a-bg, 0 0% 100%));
  cursor: pointer;
  line-height: 1.35;
}
.a-poll__option:hover { border-color: hsl(var(--poll-accent) / 0.6); }
.a-poll__option:has(input:checked) {
  border-color: hsl(var(--poll-accent));
  background: hsl(var(--poll-accent) / 0.08);
}
.a-poll__option input { flex: none; width: 1.1em; height: 1.1em; margin: 0; accent-color: hsl(var(--poll-accent)); }

.a-poll__submit {
  margin-top: 0.9em;
  padding: 0.65em 1.4em;
  border: 0;
  border-radius: var(--a-radius, 0.5rem);
  background: hsl(var(--a-fg, 0 0% 8%));
  color: hsl(var(--a-bg, 0 0% 100%));
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.a-poll__submit:disabled { opacity: 0.6; cursor: progress; }

/* Results */
.a-poll__results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75em; }
.a-poll__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.a-poll__pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.a-poll__mine {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.05em 0.5em;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  color: hsl(var(--poll-accent));
  background: hsl(var(--poll-accent) / 0.12);
  white-space: nowrap;
}
.a-poll__bar {
  margin-top: 0.3em;
  height: 0.5em;
  border-radius: 999px;
  background: hsl(var(--a-border, 0 0% 88%));
  overflow: hidden;
}
.a-poll__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: hsl(var(--a-muted, 0 0% 45%));
  transition: width 0.5s ease-out;
}
.a-poll__result.is-chosen .a-poll__bar span { background: hsl(var(--poll-accent)); }
.a-poll__result.is-chosen .a-poll__label { font-weight: 700; }

.a-poll__total { margin: 0.9em 0 0; font-size: 0.85em; color: hsl(var(--a-muted, 0 0% 45%)); }
.a-poll__message { margin: 0.7em 0 0; font-size: 0.9em; }
.a-poll__form .a-poll__message { color: hsl(var(--a-warning, 32 95% 44%)); }
