/* POLL BLOCK (ADR-041): the paper card of the featured call, only
   tokens already measured AA in tokens.css. Kept short on purpose: the
   home is at the edge of its 500 KB budget (media.spec.mjs). */
.block-poll { scroll-margin-top: var(--spacing-lg); }

.block-poll__card {
  background: var(--paper-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-md);
  box-shadow: var(--shadow-sm);
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* The kicker in the slate of the labels, like the featured call's (4.8:1
   on the paper). */
.block-poll__kicker {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--label-color);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.block-poll__icon { width: 1.25rem; height: 1.25rem; flex: none; }

/* A card title (ADR-034's serious serif) in sentence case: a question in
   capitals shouts. body:not(.admin) beats main.css's h2, as in
   featured.css. */
body:not(.admin) .block-poll__question {
  margin: 0;
  font-family: var(--font-title-serious);
  font-weight: 600;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
}

.block-poll__description,
.block-poll__intro,
.block-poll__deadline,
.poll-area__notice,
.poll-results__thanks,
.poll-results__total { margin: 0; }

.block-poll__deadline { color: var(--text-secondary); font-size: 0.95rem; }
.block-poll__privacy { margin: var(--spacing-sm) 0 0; color: var(--text-muted); font-size: 0.85rem; }

/* The area htmx swaps; it takes focus after a vote (poll.js) as a
   region, so it draws no ring. */
.poll-area,
.poll-form,
.poll-results {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.poll-area { margin-top: var(--spacing-sm); }
.poll-area:focus { outline: none; }
.poll-form,
.poll-results { align-items: flex-start; }

.poll-form__options {
  border: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* One full-width row per option, easy to hit with a finger. */
.poll-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--page-bg);
  cursor: pointer;
}

.poll-option:has(input:checked) { border-color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--text-primary); }
.poll-option input { flex: none; width: 1.15rem; height: 1.15rem; accent-color: var(--text-primary); }

.poll-results__thanks { font-weight: 600; }

/* «Cambiar mi voto»: the outlined second button of the featured call,
   with its slate edge. */
.btn.poll-results__change {
  border: 2px solid var(--label-color);
  background: transparent;
  color: var(--text-primary);
  padding: calc(var(--spacing-sm) - 2px) calc(var(--spacing-md) - 2px);
}

.btn.poll-results__change:hover { background: var(--button-bg-hover); }

.poll-results__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.poll-result__head {
  margin: 0 0 var(--spacing-xs);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--spacing-xs) var(--spacing-md);
}

.poll-result.is-chosen .poll-result__label { font-weight: 700; }
.poll-result__mine,
.poll-result__votes { color: var(--text-muted); font-weight: 400; }
.poll-result__figure { font-variant-numeric: tabular-nums; font-weight: 600; }

/* The bar: the slate of the labels, --label-color, on the darker paper;
   the browser's own answer in the violet of the text. */
.poll-bar {
  display: block;
  height: 0.75rem;
  border-radius: var(--radius-full);
  background: var(--paper-secondary-bg);
  overflow: hidden;
}

.poll-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--label-color); }
.poll-result.is-chosen .poll-bar__fill { background: var(--text-primary); }

/* Widths in 5 % steps (PollOptionView.Step): the CSP's style-src 'self'
   refuses style="width:…". The exact figure is printed beside the bar. */
.poll-bar__fill--0{width:0%}
.poll-bar__fill--5{width:5%}
.poll-bar__fill--10{width:10%}
.poll-bar__fill--15{width:15%}
.poll-bar__fill--20{width:20%}
.poll-bar__fill--25{width:25%}
.poll-bar__fill--30{width:30%}
.poll-bar__fill--35{width:35%}
.poll-bar__fill--40{width:40%}
.poll-bar__fill--45{width:45%}
.poll-bar__fill--50{width:50%}
.poll-bar__fill--55{width:55%}
.poll-bar__fill--60{width:60%}
.poll-bar__fill--65{width:65%}
.poll-bar__fill--70{width:70%}
.poll-bar__fill--75{width:75%}
.poll-bar__fill--80{width:80%}
.poll-bar__fill--85{width:85%}
.poll-bar__fill--90{width:90%}
.poll-bar__fill--95{width:95%}
.poll-bar__fill--100{width:100%}

@media (min-width: 768px) {
  .block-poll__card { padding: var(--spacing-xl); }
}
