/* News. Core — polls (front end + editor preview). Uses the theme's variables with fallbacks. */

.news-poll{
  --np-ink: var(--ink, #141414);
  --np-muted: var(--muted, #6B675E);
  --np-bg: var(--paper-2, #fff);
  --np-soft: var(--paper, #f5f1ea);
  --np-line: var(--border-bottom, #e5e7eb);
  --np-accent: var(--red, #D7141B);
  --np-btn: #C8141B;
  --np-btn-hover: var(--red-deep, #8C0F14);
  --np-fill: rgba(11,11,12,.08);
  --np-fill-lead: rgba(11,11,12,.14);
  --np-fill-mine: rgba(237,28,36,.16);
  position:relative;
  margin:1.8em 0;
  padding:20px 22px 16px;
  background:var(--np-bg);
  color:var(--np-ink);
  border:1px solid var(--np-line);
  border-top:3px solid var(--np-accent);
  border-radius:var(--radius-s, 8px);
  font-family:var(--sans, system-ui, -apple-system, "Segoe UI", sans-serif);
  font-size:15px;
  line-height:1.45;
  text-align:left;
}
html[data-theme="dark"] .news-poll{
  --np-fill: rgba(255,255,255,.08);
  --np-fill-lead: rgba(255,255,255,.14);
  --np-fill-mine: rgba(255,90,95,.22);
  --np-btn: #D3161E;
}
@media (prefers-color-scheme: dark){
  html[data-theme="system"] .news-poll{
    --np-ink:#F2EFE8; --np-muted:#A39D8C; --np-bg:#141416; --np-soft:#0B0B0C; --np-line:#2A2A2E;
    --np-fill: rgba(255,255,255,.08);
    --np-fill-lead: rgba(255,255,255,.14);
    --np-fill-mine: rgba(255,90,95,.22);
    --np-btn: #D3161E;
  }
}

.news-poll [hidden]{ display:none !important; }

/* ---- head ---- */
.news-poll__top{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:0 0 10px;
}
.news-poll__kicker{
  display:inline-flex; align-items:center; gap:7px;
  font-family:var(--display, var(--sans, sans-serif)); font-size:12px; font-weight:800;
  letter-spacing:.08em; text-transform:uppercase; color:var(--np-ink);
}
.news-poll__icon{ color:var(--np-accent); flex:none; }
.news-poll__badge{
  display:inline-flex; align-items:center; min-height:24px; padding:2px 10px;
  border-radius:999px; background:var(--np-ink); color:var(--np-bg);
  font-size:11.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
}

/* ---- question + form ---- */
.news-poll__form{ margin:0; }
.news-poll__fieldset{ margin:0; padding:0; border:0; min-width:0; }
.news-poll__question{
  float:left; width:100%; padding:0; margin:0 0 6px;
  font-family:var(--display, var(--sans, sans-serif)); font-weight:800;
  font-size:clamp(19px, 1.6vw, 22px); line-height:1.22; letter-spacing:-.01em;
  color:var(--np-ink);
}
.news-poll__question + *{ clear:both; }
.news-poll__intro{
  margin:0 0 12px !important; font-family:var(--sans, sans-serif);
  font-size:14.5px; line-height:1.5; color:var(--np-muted);
}
.news-poll__options{ display:grid; gap:8px; margin:12px 0 0; }
.news-poll__intro + .news-poll__options{ margin-top:0; }

.news-poll__option{
  display:flex; align-items:center; gap:12px;
  min-height:48px; margin:0; padding:10px 14px;
  border:1px solid var(--np-line); border-radius:var(--radius-s, 8px);
  background:var(--np-bg); cursor:pointer;
  font-weight:600; font-size:15px; line-height:1.3;
  transition:border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.news-poll__option:hover{ border-color:var(--np-muted); }
.news-poll__option:has(.news-poll__radio:checked){
  border-color:var(--np-accent);
  box-shadow:inset 0 0 0 1px var(--np-accent);
  background:var(--np-fill-mine);
}
.news-poll__radio{
  -webkit-appearance:none; appearance:none;
  flex:none; display:grid; place-content:center;
  width:20px; height:20px; margin:0;
  border:2px solid var(--np-muted); border-radius:50%; background:var(--np-bg);
  cursor:pointer; transition:border-color .15s ease;
}
.news-poll__radio::before{
  content:""; width:10px; height:10px; border-radius:50%;
  background:var(--np-accent); transform:scale(0); transition:transform .15s ease;
}
.news-poll__radio:checked{ border-color:var(--np-accent); }
.news-poll__radio:checked::before{ transform:scale(1); }
.news-poll__radio:focus-visible{ outline:2px solid var(--np-ink); outline-offset:3px; }
.news-poll__option-text{ min-width:0; overflow-wrap:anywhere; }

/* ---- actions ---- */
.news-poll__actions{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; margin:14px 0 0;
}
.news-poll__submit{
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; min-width:120px; padding:10px 24px; margin:0;
  border:0; border-radius:999px; background:var(--np-btn); color:#fff;
  font-family:var(--sans, sans-serif); font-size:15px; font-weight:700; letter-spacing:.01em;
  cursor:pointer; transition:background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.news-poll__submit:hover{ background:var(--np-btn-hover); transform:translateY(-1px); box-shadow:0 8px 18px rgba(200,20,27,.28); }
.news-poll__submit:focus-visible{ outline:2px solid var(--np-ink); outline-offset:3px; }
.news-poll__submit:disabled{ opacity:.6; cursor:progress; transform:none; box-shadow:none; }
.news-poll__link{
  min-height:32px; padding:4px 0; margin:0; border:0; background:none;
  color:var(--np-ink); font-family:var(--sans, sans-serif); font-size:14px; font-weight:600;
  text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1px; cursor:pointer;
}
.news-poll__link:hover{ color:var(--np-accent); }
.news-poll__link:focus-visible{ outline:2px solid var(--np-ink); outline-offset:2px; }

/* ---- results ---- */
.news-poll__results{ margin:12px 0 0; outline:0; }
.news-poll__bars{ display:grid; gap:8px; margin:0 !important; padding:0 !important; list-style:none !important; }
.news-poll__bar{
  position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:48px; margin:0 !important; padding:10px 14px;
  border:1px solid var(--np-line); border-radius:var(--radius-s, 8px);
  font-size:15px; line-height:1.3; list-style:none;
  animation:news-poll-in .35s ease both;
}
.news-poll__bar::before{ content:none !important; }
.news-poll__bar:nth-child(2){ animation-delay:.04s; }
.news-poll__bar:nth-child(3){ animation-delay:.08s; }
.news-poll__bar:nth-child(4){ animation-delay:.12s; }
.news-poll__bar:nth-child(n+5){ animation-delay:.16s; }
.news-poll__fill{
  position:absolute; left:0; top:0; bottom:0; width:0;
  background:var(--np-fill);
  transition:width .9s cubic-bezier(.22,.9,.24,1);
}
.news-poll__bar.is-leader .news-poll__fill{ background:var(--np-fill-lead); }
.news-poll__bar.is-voted{ border-color:var(--np-accent); }
.news-poll__bar.is-voted .news-poll__fill{ background:var(--np-fill-mine); }
.news-poll__bar-label{
  position:relative; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px;
  font-weight:600; overflow-wrap:anywhere;
}
.news-poll__bar.is-leader .news-poll__bar-text{ font-weight:800; }
.news-poll__you{
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 8px; border-radius:999px; background:var(--np-btn); color:#fff;
  font-size:11px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; white-space:nowrap;
}
.news-poll__pct{
  position:relative; flex:none;
  font-family:var(--display, var(--sans, sans-serif)); font-weight:800; font-size:16px;
  font-variant-numeric:tabular-nums;
}
.news-poll__results .news-poll__link{ margin-top:10px; }

.news-poll .sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ---- footer ---- */
.news-poll__status{
  margin:10px 0 0 !important; font-size:14px; font-weight:600; color:var(--np-ink);
}
.news-poll__status:empty{ display:none; }
.news-poll__meta{
  display:flex; flex-wrap:wrap; gap:4px 14px; margin:12px 0 0 !important;
  font-family:var(--sans, sans-serif); font-size:13px; line-height:1.4; color:var(--np-muted);
}
.news-poll__meta span:empty{ display:none; }
.news-poll__meta span + span::before{ content:"·"; margin-right:14px; }
.news-poll__meta span:first-child:empty + span::before{ content:none; }
.news-poll__story{
  margin:10px 0 0 !important; padding-top:10px; border-top:1px solid var(--np-line);
  font-family:var(--sans, sans-serif); font-size:13px; color:var(--np-muted);
}
.news-poll__story a{ color:var(--np-ink); font-weight:700; text-decoration:underline; text-underline-offset:2px; }
.news-poll__story a:hover{ color:var(--np-accent); }

.news-poll[aria-busy="true"] .news-poll__options{ opacity:.7; }

/* ---- compact (sidebar) ---- */
.news-poll--compact{ padding:16px 16px 14px; }
.news-poll--compact .news-poll__question{ font-size:17px; }
.news-poll--compact .news-poll__option,
.news-poll--compact .news-poll__bar{ min-height:42px; padding:8px 12px; font-size:14px; }
.news-poll--compact .news-poll__submit{ width:100%; }
.news-poll--latest{ margin:0 0 24px; }

.news-poll-empty{
  margin:0; padding:16px; border:1px dashed var(--border-bottom, #ccc); border-radius:8px;
  font-family:var(--sans, sans-serif); font-size:14px; color:var(--muted, #6B675E);
}

@media (max-width:600px){
  .news-poll{ padding:16px 16px 14px; margin:1.4em 0; }
  .news-poll__option, .news-poll__bar{ padding:9px 12px; font-size:14.5px; }
  .news-poll__submit{ flex:1 1 100%; }
}

@keyframes news-poll-in{
  from{ opacity:0; transform:translateY(4px); }
  to{ opacity:1; transform:none; }
}
@media (prefers-reduced-motion: reduce){
  .news-poll *, .news-poll *::before{ transition:none !important; animation:none !important; }
}
