/*
 * The Voice of ADA Holders — one stylesheet for the whole site.
 * One typeface (Chivo, the Cardano brand face), self-hosted: no runtime
 * font CDN, so a visitor's browser talks to this server only.
 * Colours are the Cardano brand palette (cardano.org/brand-assets).
 * SIL Open Font License 1.1 (Chivo upstream license).
 */
@font-face {
  font-family: 'Chivo';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/chivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Cardano brand: core */
  --blue: #0033AD;
  --ink: #000000;
  --paper: #F8F8F5;
  --white: #FFFFFF;
  /* Cardano brand: secondary */
  --red: #FF5553;
  --green: #3B7982;
  /* Derived tints of the above, nothing new */
  --blue-soft: rgba(0, 51, 173, 0.08);
  --ink-muted: rgba(0, 0, 0, 0.58);
  --ink-faint: rgba(0, 0, 0, 0.38);
  --line: rgba(0, 0, 0, 0.10);
  --neutral: rgba(0, 0, 0, 0.22);

  --radius: 8px;
  --bar-h: 56px;
  --nav-w: 240px;
  --gap: 24px;
}

* { box-sizing: border-box; font-family: 'Chivo', Arial, sans-serif; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-size: 15px; line-height: 1.55; font-weight: 400; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0 0 0.75rem 0; }
h1 { font-size: 1.6rem; color: var(--blue); }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
p { margin: 0 0 0.9rem 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h);
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 var(--gap);
  background: var(--white); border-bottom: 1px solid var(--line); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }
.brand-name { font-weight: 700; letter-spacing: 0.01em; }
.brand-sub {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint);
}
.spacer { flex: 1; }
.tally-stamp { font-size: 0.8rem; color: var(--ink-muted); }

/* ---------- Language switch ---------- */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang button {
  border: 0; background: var(--white); color: var(--ink-muted); padding: 0.4rem 0.6rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; cursor: pointer;
}
.lang button.on { background: var(--blue); color: var(--white); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--blue); background: var(--blue); color: var(--white);
  font-size: 0.875rem; font-weight: 700; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: none; }

/* ---------- Layout ---------- */
.nav {
  position: fixed; top: calc(var(--bar-h) + var(--gap)); left: var(--gap);
  width: var(--nav-w); padding: 0.5rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.nav a {
  display: block; padding: 0.55rem 0.8rem; border-radius: 6px;
  color: var(--ink); font-size: 0.9rem;
}
.nav a:hover { background: var(--blue-soft); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }

main {
  margin-left: calc(var(--nav-w) + 2 * var(--gap));
  padding: calc(var(--bar-h) + var(--gap)) var(--gap) var(--gap) var(--gap);
  max-width: 1080px;
}
.lead { color: var(--ink-muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: var(--gap);
}
.card-head { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.9rem; }
.card-head h2 { margin: 0; }
.meta { font-size: 0.8rem; color: var(--ink-muted); }
.tag {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px;
  background: var(--blue-soft); color: var(--blue);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.notice {
  border-left: 3px solid var(--blue); background: var(--white);
  padding: 0.75rem 1rem; margin-bottom: var(--gap); font-size: 0.875rem; color: var(--ink-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------- Result: holders decide (large); ADA is a check (small) ---------- */
.bar { display: flex; border-radius: 3px; overflow: hidden; background: var(--line); }
.bar span { display: block; height: 100%; }
.bar.main { height: 22px; }
.bar.thin { height: 6px; }
.yes { background: var(--green); }
.no { background: var(--red); }
.none { background: var(--neutral); }
.figs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin-top: 0.7rem; }
.fig { font-size: 0.95rem; }
.fig b { font-size: 1.15rem; margin-left: 0.2rem; }
.fig .num:last-child { color: var(--ink-muted); margin-left: 0.2rem; }
.fig i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.4rem; }
.check { display: grid; grid-template-columns: 1fr 220px; gap: 0.3rem 0.9rem; align-items: center; margin-top: 1.1rem; }
.check-label { grid-column: 1 / -1; font-size: 0.75rem; color: var(--ink-faint); }
.check .bar { opacity: 0.55; }
.check-figs { font-size: 0.75rem; color: var(--ink-faint); text-align: right; }
.faint { color: var(--ink-faint); }

/* ---------- Totals ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: 0.5rem; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--blue); margin-top: 0.2rem; }
.stats + .fine { margin-bottom: var(--gap); }
.turnout { margin: 0.8rem 0 0 0; font-size: 0.8rem; color: var(--ink-muted); }

h2.section { margin: 1.6rem 0 0.9rem 0; }
.empty { color: var(--ink-muted); font-size: 0.9rem; margin: 0.2rem 0 0 0; }
.proposer { white-space: pre-line; }
.mono { word-break: break-all; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); }
th { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: none; }

/* ---------- Posting ---------- */
.choices { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.choice {
  flex: 1; min-width: 140px; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 0.55rem; background: var(--white);
}
.choice input { accent-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.fine { font-size: 0.8rem; color: var(--ink-muted); }
dl.rules { margin: 0; }
dl.rules dt { font-weight: 700; margin-top: 0.8rem; }
dl.rules dd { margin: 0.2rem 0 0 0; color: var(--ink-muted); }

footer { margin-top: 2rem; font-size: 0.78rem; color: var(--ink-faint); }

/* ---------- Narrow screens: nav becomes a row under the bar ---------- */
@media (max-width: 860px) {
  .tally-stamp, .brand-sub { display: none; }
  .nav {
    position: static; width: auto; margin: calc(var(--bar-h) + 16px) 16px 0 16px;
    display: flex; gap: 0.25rem; overflow-x: auto;
  }
  .nav a { white-space: nowrap; }
  main { margin-left: 0; padding: 16px; }
  .check { grid-template-columns: 1fr; }
  .check-figs { text-align: left; }
  .grid-2, .stats { grid-template-columns: 1fr; }
}
