/* Referendum widget (v1). Ported from the prototype's referendum section
   (docs/wireframes/referendumi_widget.html). */
:root {
  --bg: #f6f3ec;
  --ink: #111827;
  --muted: #6e695f;
  --line: #d7d0c5;
  --yes: #1f7f86;
  --no: #df654f;
  --dk: #a6adb4;
  --serif: Baskerville, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.ep {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 12px 24px;
}
.ep[hidden] { display: none; }

.ref-title {
  margin: 0 0 10px;
  max-width: 820px;
  font-family: var(--serif);
  font-size: 52px;
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 700;
  overflow-wrap: break-word;
}

.question {
  margin: 16px 0 22px;
  max-width: 900px;
  font-size: 16px;
  line-height: 1.55;
  color: #48433e;
}
.dummy {
  margin: 0 0 18px;
  font-size: 12px;
  color: #746f67;
}

.total { margin: 0 0 18px; }
.total-top {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: 1.2fr .8fr 1.2fr;
  gap: 18px;
  align-items: end;
}
.metric {
  text-align: center;
  padding: 0 10px;
  min-width: 0;
}
.metric + .metric { border-left: 1px solid rgba(0, 0, 0, .12); }
.metric strong {
  display: block;
  font-family: var(--serif);
  font-size: 72px;
  line-height: .9;
  font-weight: 500;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.metric > span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.metric.za { color: var(--yes); }
.metric.proti { color: var(--no); }
.metric.nevem { color: #7e827f; }
.metric.nevem strong { font-size: 48px; line-height: .95; }
.metric.nevem > span { font-size: 11px; letter-spacing: .08em; }

.bar {
  width: 100%;
  height: 26px;
  display: flex;
  overflow: hidden;
  background: rgba(0, 0, 0, .06);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.bar.small { height: 22px; }
.seg {
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}
.seg.nolabel span { visibility: hidden; }
.seg.yes { background: var(--yes); color: #fff; }
.seg.no { background: var(--no); color: #fff; }
.seg.dk { background: var(--dk); color: #18202a; }

.controls { margin: 0 0 16px; }
.controls-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  column-gap: 18px;
  row-gap: 2px;
}
.btn {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #5f5a52;
  padding: 6px 1px 5px;
  font: 500 14px var(--sans);
  cursor: pointer;
}
.btn:hover { color: #111923; border-bottom-color: #aaa398; }
.btn[aria-pressed="true"] {
  color: #111923;
  border-bottom-color: #111923;
  font-weight: 700;
}
.btn:focus-visible { outline: 2px solid #111923; outline-offset: 2px; }

.detail-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: center;
  padding: 7px 0;
}
.detail-label {
  font-size: 14px;
  font-weight: 700;
  color: #1d1b18;
}

.about {
  margin: 22px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: #6f6a62;
}
.about strong { color: #48433e; }

/* Inside the iframe the viewport is the article column (FUN-ELWID-10). */
@media (max-width: 900px) {
  .ref-title { font-size: 38px; }
  /* Headline figures stay in one row (PRD §1.4 decision 12), scaled to the width. */
  .metric strong { font-size: clamp(30px, 8.5vw, 54px); }
  .metric.nevem strong { font-size: clamp(22px, 5.5vw, 36px); }
  /* Label above the bar. */
  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 5px 0;
  }
}

@media (max-width: 560px) {
  .ref-title { font-size: clamp(26px, 8vw, 38px); }
  .total-top { gap: 6px; }
  .metric { padding: 0 4px; }
}
