/* CitizenTech — design system.
   Palette carried over from the SmartActivism style guide: mostly white and grey,
   forest green reserved for the single primary action on a page. */

:root {
  --canvas: #ffffff;
  --charcoal: #2d3748;
  --forest: #2f855a;
  --forest-dark: #276749;
  --light-grey: #f7fafc;
  --warm-white: #fefae0;
  --orange: #ed8936;
  --soft-grey: #718096;
  --border: #e2e8f0;
  --danger: #c53030;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(45, 55, 72, 0.06), 0 4px 12px rgba(45, 55, 72, 0.05);
  --max: 1080px;
  --font-head: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #16191d;
    --charcoal: #e8eaed;
    --light-grey: #1e2227;
    --warm-white: #23262b;
    --soft-grey: #9aa3af;
    --border: #2c3138;
    --forest: #48bb78;
    --forest-dark: #38a169;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--forest); }
a:hover { color: var(--orange); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 720px; }
.muted { color: var(--soft-grey); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* ---- nav ---- */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  position: sticky; top: 0; z-index: 20;
}
.nav-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
  color: var(--charcoal); text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
}
.brand:hover { color: var(--charcoal); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px; background: var(--forest);
  display: grid; place-items: center; color: #fff; font-size: 0.8rem;
}
.nav-links { margin-left: auto; display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: var(--soft-grey); text-decoration: none; padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm); font-size: 0.925rem;
}
.nav-links a:hover { color: var(--charcoal); background: var(--light-grey); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem;
  padding: 0.65rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--canvas); color: var(--charcoal);
  text-decoration: none; cursor: pointer; transition: all 0.15s ease;
}
.btn:hover { border-color: var(--orange); color: var(--charcoal); }
.btn-primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); border-color: var(--forest-dark); color: #fff; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---- cards ---- */
.card {
  background: var(--canvas); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.card-quiet { background: var(--light-grey); box-shadow: none; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.split { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--light-grey); color: var(--charcoal); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.8rem; font-weight: 600;
}
.badge-green { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---- forms ---- */
label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.925rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; padding: 0.65rem 0.8rem; font: inherit; color: var(--charcoal);
  background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--forest); outline-offset: 1px; border-color: var(--forest); }
textarea { min-height: 220px; resize: vertical; line-height: 1.6; }

.option { display: block; margin-bottom: 0.5rem; }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.option span {
  display: block; padding: 0.75rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--canvas); cursor: pointer; font-weight: 400;
  transition: all 0.12s ease;
}
.option span:hover { border-color: var(--orange); background: var(--light-grey); }
.option input:checked + span { border-color: var(--forest); background: var(--light-grey); box-shadow: inset 3px 0 0 var(--forest); font-weight: 600; }
.option input:focus-visible + span { outline: 2px solid var(--forest); outline-offset: 2px; }

/* ---- flash / alerts ---- */
.flash {
  border: 1px solid var(--border); border-left: 4px solid var(--forest);
  background: var(--light-grey); border-radius: var(--radius-sm);
  padding: 0.8rem 1rem; margin-bottom: 1.25rem;
}
.flash-error { border-left-color: var(--danger); }
.flash-warn { border-left-color: var(--orange); }

/* ---- action cards ---- */
.action { display: flex; flex-direction: column; gap: 0.6rem; height: 100%; }
.action-head { display: flex; justify-content: space-between; align-items: start; gap: 0.5rem; }
.action h3 { margin: 0; font-size: 1.05rem; }
.action .impact { color: var(--soft-grey); font-size: 0.9rem; margin: 0; }
.action-foot { margin-top: auto; padding-top: 0.5rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.hero { padding: 3.5rem 0 2.5rem; }
.hero p.lead { font-size: 1.2rem; color: var(--soft-grey); max-width: 34em; }
.rule { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.stripe { background: var(--light-grey); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 2.5rem 0; margin: 3rem 0; }

.stat { text-align: center; }
.stat .n { font-family: var(--font-head); font-weight: 700; font-size: 2rem; color: var(--forest); display: block; line-height: 1.1; }
.stat .l { color: var(--soft-grey); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-head); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--soft-grey); }
.table-wrap { overflow-x: auto; }

.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chip {
  border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.85rem;
  font-size: 0.85rem; text-decoration: none; color: var(--soft-grey); background: var(--canvas);
}
.chip:hover { border-color: var(--orange); color: var(--charcoal); }
.chip[aria-current="true"] { background: var(--charcoal); border-color: var(--charcoal); color: var(--canvas); font-weight: 600; }

footer.site {
  border-top: 1px solid var(--border); margin-top: 4rem; padding: 2rem 0;
  color: var(--soft-grey); font-size: 0.9rem;
}
footer.site a { color: var(--soft-grey); text-decoration: none; margin-left: 1rem; }
footer.site a:hover { color: var(--forest); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--canvas); padding: 0.5rem 1rem; z-index: 50; border: 1px solid var(--forest); border-radius: var(--radius-sm); }

/* ---- voting record ---- */
.votes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.vote {
  background: var(--canvas); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.vote h3 { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.vote p { margin: 0; }
.vote-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.vote-official { opacity: 0.75; }
.vote-pill {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 0.15rem 0.7rem;
  font-family: var(--font-head); font-size: 0.78rem; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap;
}
/* Aye and No are stated, never scored — the colours separate them, they do not judge them. */
.vote-aye { background: rgba(47, 133, 90, 0.12); color: var(--forest); border-color: rgba(47, 133, 90, 0.3); }
.vote-no  { background: rgba(113, 128, 150, 0.14); color: var(--soft-grey); border-color: var(--border); }

/* ---- reply prompt ---- */
.prompt { border-left: 4px solid var(--orange); }
.prompt-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-quiet { color: var(--soft-grey); border-color: transparent; }
.btn-quiet:hover { border-color: var(--border); }

/* ---- constituency directory ---- */
.const-card {
  display: flex; flex-direction: column; gap: 0.2rem;
  text-decoration: none; color: var(--charcoal); padding: 0.9rem 1rem;
  transition: border-color 0.12s ease;
}
.const-card:hover { border-color: var(--forest); color: var(--charcoal); }
.const-card strong { font-family: var(--font-head); font-size: 0.95rem; line-height: 1.3; }

/* ---- campaigns ---- */
.threshold { margin-top: 0.25rem; }
.threshold-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.threshold-head strong { font-family: var(--font-head); font-size: 1.1rem; }
.bar {
  height: 8px; border-radius: 999px; background: var(--light-grey);
  border: 1px solid var(--border); overflow: hidden;
}
.bar span {
  display: block; height: 100%; background: var(--forest);
  border-radius: 999px; transition: width 0.4s ease;
}
@media (prefers-reduced-motion: reduce) { .bar span { transition: none; } }

.deadline-near { color: var(--orange); font-weight: 600; }
.joined-note { margin: 0.9rem 0 0.6rem; color: var(--forest); }
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { color: var(--forest); }

/* Partner campaigns are labelled everywhere they appear — see docs/ROADMAP.md. */
.partner-label {
  margin: 0 0 0.5rem; color: var(--soft-grey);
  border-left: 3px solid var(--orange); padding-left: 0.6rem;
}

.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.check input { width: auto; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* ---- sister sites ---- */
.elsewhere { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; }
.elsewhere a { color: var(--soft-grey); margin-left: 0; text-decoration: none; }
.elsewhere a:hover { color: var(--forest); }
.campaign-feature { border-left: 4px solid var(--forest); margin-top: 1.25rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.plain-list li { display: flex; flex-direction: column; gap: 0.1rem; }
