/* Traktandum. One family, one accent, entries set like agenda items of a protocol. */

:root {
  --paper: #f6f6f2;
  --surface: #fdfdfb;
  --ink: #1b1e1d;
  --muted: #5f6763;
  --rule: #d6d9d1;
  --rule-strong: #b9bdb3;
  --accent: #1f4e5a;
  --accent-ink: #ffffff;
  --approved: #2d6a3c;
  --rejected: #a3312a;
  --postponed: #8d6410;
  --noted: #5f6763;
  --focus: #e07a00;
  --max: 68rem;
  --measure: 62ch;
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151817;
    --surface: #1c201f;
    --ink: #e7e8e2;
    --muted: #a3aaa5;
    --rule: #303532;
    --rule-strong: #454b47;
    --accent: #8cc4d0;
    --accent-ink: #0f2a30;
    --approved: #7fc48f;
    --rejected: #f08a82;
    --postponed: #e0b25a;
    --noted: #a3aaa5;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header.site, main, footer.site { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
header.site {
  display: flex; align-items: baseline; justify-content: space-between; gap: 2rem;
  padding: 1.25rem 0 1rem; border-bottom: 1px solid var(--rule-strong);
}
.wordmark { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
header.site nav { display: flex; gap: 1.5rem; }
header.site nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
header.site nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
header.site nav a:hover { color: var(--ink); }

.lead { padding: 3rem 0 2rem; }
.lead h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 700; letter-spacing: -0.025em; max-width: 22ch; }
.lead-text { margin-top: 1rem; max-width: var(--measure); color: var(--muted); font-size: 1.05rem; }
.lead-text, .lead-text a { text-wrap: pretty; }

form.search { display: flex; gap: 0.5rem; margin-top: 1.75rem; max-width: 44rem; }
form.search input[type="search"] {
  flex: 1; font: inherit; font-size: 1.15rem; padding: 0.75rem 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--rule-strong); border-radius: 4px;
}
form.search input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
button, .filter-actions button {
  font: inherit; font-weight: 600; padding: 0.75rem 1.25rem; border-radius: 4px; cursor: pointer;
  color: var(--accent-ink); background: var(--accent); border: 1.5px solid var(--accent);
}
button:hover { filter: brightness(1.08); }
.examples { margin-top: 0.75rem; color: var(--muted); font-size: 0.95rem; }

.results-layout { display: grid; grid-template-columns: 14rem 1fr; gap: 3rem; padding: 1.5rem 0 4rem; border-top: 1px solid var(--rule); }
.filters { position: sticky; top: 1rem; align-self: start; }
.filters .field { display: grid; gap: 0.3rem; margin-bottom: 1rem; }
.filters label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.filters select, .filters input[type="date"] {
  font: inherit; font-size: 0.95rem; padding: 0.45rem 0.6rem; width: 100%; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px;
}
.date-pair { display: grid; gap: 0.35rem; }
.filter-actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.filter-actions button { padding: 0.55rem 1rem; font-size: 0.95rem; }
.filter-actions .reset { font-size: 0.9rem; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule-strong); }
.results-summary { color: var(--muted); }
form.sort { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
form.sort select { font: inherit; font-size: 0.9rem; padding: 0.3rem 0.5rem; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; padding: 0 0.1em; border-radius: 2px; }
.votebar { display: inline-block; width: 4.5rem; height: 0.5rem; border-radius: 2px; background: var(--rejected); overflow: hidden; vertical-align: middle; opacity: 0.85; }
.votebar span { display: block; height: 100%; background: var(--approved); }

ol.decisions { list-style: none; margin: 0; padding: 0; }
.decision {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 1rem;
  padding: 1.35rem 0; border-bottom: 1px solid var(--rule);
}
.agenda-no {
  font-size: 1.6rem; font-weight: 600; line-height: 1; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: 0.25rem; letter-spacing: -0.02em;
}
.decision-body { min-width: 0; max-width: var(--measure); }
.provenance { display: flex; flex-wrap: wrap; gap: 0 0.9rem; font-size: 0.9rem; color: var(--muted); }
.provenance .commune { color: var(--ink); font-weight: 600; }
.provenance a { color: inherit; }
.canton { color: var(--muted); font-weight: 500; }
.decision h2 { font-size: 1.2rem; margin-top: 0.3rem; }
.decision h2 a { color: var(--ink); text-decoration: none; }
.decision h2 a:hover { color: var(--accent); text-decoration: underline; }
.summary { margin-top: 0.45rem; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.7rem; font-size: 0.9rem; }
.facts .category { color: var(--muted); }
.facts .amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.facts .source { margin-left: auto; color: var(--muted); }

/* Outcome stamps: outlined, in the ink of the verdict, in the record's own language. */
.stamp {
  display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.15rem 0.55rem;
  border: 1.5px solid currentColor; border-radius: 3px; font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.01em; color: var(--noted);
}
.stamp .votes { font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.85; }
.stamp-approved { color: var(--approved); }
.stamp-rejected { color: var(--rejected); }
.stamp-postponed { color: var(--postponed); }
.stamp-noted { color: var(--noted); }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; color: var(--muted); }

/* Detail page, with the archived protocol beside the record */
.detail-layout { padding: 2.5rem 0 4rem; }
.detail-layout.with-viewer { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 3rem; align-items: start; }
.detail { max-width: 46rem; }
.viewer { position: sticky; top: 1rem; }
.viewer-head { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.viewer iframe { width: 100%; height: min(78vh, 60rem); border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); }
.detail h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-top: 0.5rem; }
.summary-large { font-size: 1.15rem; margin-top: 1rem; }
.detail .facts { margin-top: 1.25rem; font-size: 0.95rem; }
.facts-list { display: grid; grid-template-columns: 10rem 1fr; gap: 0.7rem 1.5rem; margin: 2rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule-strong); }
.facts-list dt { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.api-hint { margin-top: 2rem; color: var(--muted); font-size: 0.9rem; }

/* Coverage page */
.coverage { padding-bottom: 4rem; max-width: 52rem; }
.muted { color: var(--muted); }
figure.map { margin: 0.5rem 0 1rem; display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 1.5rem; align-items: start; }
.chmap { width: 100%; height: auto; display: block; }
.chmap .canton { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 0.8; }
.chmap .canton-covered { fill: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.chmap .lake { fill: color-mix(in srgb, var(--accent) 18%, var(--paper)); stroke: none; }
.chmap .canton-label { font-size: 13px; font-weight: 600; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.chmap .commune-covered { fill: var(--accent); stroke: var(--paper); stroke-width: 0.6; }
.chmap .marker circle { fill: var(--accent); stroke: var(--paper); stroke-width: 1.5; }
.chmap .marker:hover circle, .chmap .commune-covered:hover { fill: var(--focus); }
figure.map figcaption { font-size: 0.9rem; }
.map-legend { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.25rem; }
@media (max-width: 720px) { figure.map { grid-template-columns: 1fr; } .chmap .canton-label { font-size: 16px; } }
.coverage h2 { font-size: 1.1rem; margin: 2.25rem 0 0.75rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; border-bottom-color: var(--rule-strong); }
.num { text-align: right; padding-right: 0; }
ol.bars { list-style: none; margin: 0; padding: 0; }
ol.bars li { display: grid; grid-template-columns: 11rem 1fr 3rem; align-items: center; gap: 1rem; padding: 0.3rem 0; }
.bar { display: block; height: 0.6rem; background: var(--rule); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.coverage p { max-width: var(--measure); margin-top: 0.5rem; }

footer.site { padding: 1.5rem 0 3rem; border-top: 1px solid var(--rule-strong); color: var(--muted); font-size: 0.9rem; }
footer.site p { max-width: var(--measure); }
footer.site p + p { margin-top: 0.5rem; }

@media (max-width: 720px) {
  .results-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .filters { position: static; }
  .filters form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
  .filters .filter-actions { grid-column: 1 / -1; }
  .decision { grid-template-columns: 3rem 1fr; }
  .agenda-no { font-size: 1.25rem; }
  .facts .source { margin-left: 0; }
  .facts-list { grid-template-columns: 1fr; gap: 0.2rem 0; }
  .facts-list dd { margin-bottom: 0.6rem; }
  .two-col { grid-template-columns: 1fr; }
  .detail-layout.with-viewer { grid-template-columns: 1fr; }
  .viewer { position: static; }
  .viewer iframe { height: 70vh; }
  .results-head { flex-direction: column; align-items: flex-start; }
  header.site { flex-direction: column; gap: 0.5rem; }
  header.site nav { gap: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  form.search input[type="search"], button { transition: border-color 120ms, box-shadow 120ms, filter 120ms; }
}
