/*
 * Common Ground — all site styling lives here, in one place.
 *
 * Design: "Option B (softened)" from the Aug 2026 design canvas — navy and
 * cream bands, brand orange accents, Open Sans/Montserrat type (self-hosted).
 * Brand values come from commongroundorg.co.uk — see brand/brand.md.
 */

/* ---------- Fonts (self-hosted, see public/fonts/) ---------- */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/open-sans-latin.woff2) format("woff2");
}

/* Montserrat ExtraBold, declared at weight 400 so it drops in wherever the
   display face is used (same trick the old Archivo Black setup relied on). */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/montserrat-extrabold-latin.woff2) format("woff2");
}

/* Montserrat Bold — a lighter cut, requested via font-weight: 700. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/montserrat-bold-latin.woff2) format("woff2");
}

/* Montserrat variable file, pinned to 750 — the hero headline's in-between
   weight (bolder than Bold, lighter than ExtraBold). */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 750;
  font-display: swap;
  src: url(/fonts/montserrat-var-latin.woff2) format("woff2");
}

:root {
  /* Brand palette */
  --cg-orange: #FD9800;        /* primary — buttons, highlights */
  --cg-orange-deep: #E98C00;   /* hover state (backgrounds only) */
  --cg-link: #A85400;          /* orange for TEXT on cream/white: passes 4.5:1 contrast */
  --cg-danger: var(--cg-no);   /* red buttons / badges share the "no" red */
  --cg-muted: #5F6873;         /* secondary text on cream/white: passes 4.5:1 */
  --cg-navy: #0B2E31;          /* dark bands, headings */
  --cg-slate: #454F5E;         /* body text on light */
  --cg-white: #FFFFFF;
  --cg-cream: #FEF9E1;         /* light bands / page background */
  --cg-gold: #F9F0C8;          /* alt background / highlights */
  --cg-ink: #141006;           /* near-black text on orange */

  /* Chart colours (three distinguishable answers) */
  --cg-yes: #2d6a4f;
  --cg-unsure: #f9c74f;
  --cg-no: #BD4A2A;            /* deep enough for white text on it (4.5:1) */

  --cg-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --cg-display: "Montserrat", "Open Sans", "Arial Black", sans-serif;
  --cg-radius: 12px;
  --cg-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

  /* Letter spacing ("tracking") — em-based so it scales with text size:
     wide for small uppercase labels, near-neutral for mid-size headings,
     slightly tight for big display headlines. */
  --cg-track-caps: 0.07em;
  --cg-track-heading: 0.02em;
  --cg-track-display: -0.02em;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--cg-font);
  background: var(--cg-cream);
  color: var(--cg-slate);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 { font-weight: 600; color: var(--cg-navy); }

a { color: var(--cg-link); }

.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;
}

/* Keyboard users can jump past the menu; visible only while focused. */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  padding: 0.6rem 1rem; background: var(--cg-navy); color: var(--cg-white);
  font-weight: 700; border-radius: 0 0 8px 8px; text-decoration: none;
}
.skip-link:focus { top: 0; outline: 3px solid var(--cg-orange); }

/* The big number on the 404 page. */
.error-code {
  font-family: var(--cg-display); font-weight: 750; font-size: clamp(3.5rem, 12vw, 6rem);
  line-height: 1; color: var(--cg-orange); letter-spacing: var(--cg-track-display); margin-bottom: 0.5rem;
}

/* Wide tables (admin) scroll sideways on small screens instead of
   stretching the page. */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Header ---------- */

.site-header {
  background: var(--cg-cream);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem 1.4rem;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.site-header .logo { width: 44px; height: 44px; border-radius: 50%; }

.site-header .wordmark {
  font-family: var(--cg-font);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: var(--cg-track-caps);
  text-transform: uppercase;
  color: var(--cg-navy);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.4rem;
}

.site-nav a {
  color: var(--cg-navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  padding: 0.5rem 0.1rem 0.35rem;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--cg-link);
}

.site-nav a[aria-current="page"] {
  color: var(--cg-link);
  border-bottom-color: var(--cg-orange);
}

/* ---------- Bands + layout ---------- */

main { min-height: 50vh; }

/* Full-width colour bands; .band-inner keeps the content centred. */
.band { padding: 2.2rem 1.2rem; }
.band-inner { max-width: 900px; margin: 0 auto; }
.band--navy { background: var(--cg-navy); color: rgba(255, 255, 255, 0.85); }
.band--navy h2 { color: var(--cg-white); }
.band--cream { background: var(--cg-cream); }
.band--orange { background: var(--cg-orange); color: var(--cg-ink); }
.band--orange .section-title { color: var(--cg-navy); }
.band--orange .accent { color: var(--cg-white); }

/* Standard content pages (survey, privacy, admin) */
.inner { max-width: 900px; margin: 0 auto; padding: 1rem 1.2rem 2rem; }

.card {
  background: var(--cg-white);
  border-radius: var(--cg-radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--cg-shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--cg-gold);
}

.section-title {
  font-family: var(--cg-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.45rem;
  letter-spacing: var(--cg-track-heading);
}

.muted { color: var(--cg-muted); }
.band--navy .muted { color: rgba(255, 255, 255, 0.6); }

footer {
  background: var(--cg-cream);
  text-align: center;
  padding: 1.6rem 1.2rem;
  color: var(--cg-slate);
  font-size: 0.85rem;
}

footer a { color: var(--cg-link); font-weight: 700; }
/* The admin sign-in link: a quiet green word rather than a button. */
footer a.footer-admin { color: var(--cg-yes); font-weight: 400; text-decoration: underline; }

/* ---------- Hero (landing) — orange banner, navy text, green CTA ---------- */

.hero { padding: 3.2rem 1.2rem 3rem; }

.hero h1 {
  font-family: var(--cg-display);
  font-weight: 750; /* between Montserrat Bold and the ExtraBold used elsewhere */
  text-transform: uppercase;
  letter-spacing: var(--cg-track-display);
  font-size: clamp(2.4rem, 7.5vw, 3.9rem);
  line-height: 1.04;
  color: var(--cg-navy);
}

.hero h1 .accent { color: var(--cg-white); }

/* Orange highlight inside headings, e.g. the YOU in "What Do YOU Think?" */
.accent { color: var(--cg-orange); }

.hero .hero-sub {
  max-width: 480px;
  margin: 1.2rem 0 1.5rem;
  font-size: 1.05rem;
  color: var(--cg-navy);
}

.hero .btn-hero { background: var(--cg-yes); color: var(--cg-white); }
.hero .btn-hero:hover { background: #245a42; }

/* Big logo beside the hero text — desktop only */
.hero-logo { display: none; }

@media (min-width: 820px) {
  .hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
  }
  .hero-logo {
    display: block;
    width: 340px;
    max-width: 40%;
    height: auto;
    flex-shrink: 0;
  }
}

/* ---------- Buttons + forms ---------- */

.btn {
  display: inline-block;
  background: var(--cg-orange);
  color: var(--cg-ink);
  border: none;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 14px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--cg-orange-deep); }

.btn:focus-visible { outline: 3px solid var(--cg-navy); outline-offset: 2px; }
.band--navy .btn:focus-visible { outline-color: var(--cg-white); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-hero {
  font-family: var(--cg-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  font-size: 1.05rem;
  padding: 17px 32px;
  border-radius: 2px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="url"], textarea, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #c8cdd4;
  border-radius: 6px;
  width: 100%;
  color: var(--cg-slate);
  background: var(--cg-white);
}

input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--cg-orange);
  outline-offset: 1px;
}

label { font-weight: 600; color: var(--cg-navy); display: block; margin-bottom: 0.35rem; }

.field { margin-bottom: 1.25rem; }

.error-box {
  background: #fdecea;
  border: 1px solid var(--cg-no);
  color: #7a2e1d;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.notice-box {
  background: var(--cg-gold);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

/* ---------- Survey ---------- */

.survey-intro { padding-bottom: 1.8rem; }

/* The line under a page title, same on every orange title band (org pages,
   survey, results): navy for contrast on orange, and no width cap so it
   only wraps when the screen is genuinely too narrow. */
.survey-sub,
.page-subtitle {
  margin-top: 0.7rem;
  font-size: 1.1rem;
  color: var(--cg-navy);
}

.survey-form { max-width: 720px; }

.postcode-block {
  background: var(--cg-white);
  border-radius: var(--cg-radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--cg-shadow);
  margin: 0.5rem 0 0.75rem;
}

.question {
  border: none;
  padding: 1.4rem 0 0.35rem;
  margin-bottom: 0.4rem;
  border-top: 2px solid var(--cg-gold);
}

.question:first-of-type { border-top: none; }

/* Floating the legend makes the fieldset's top border draw as one
   unbroken line instead of being interrupted where the legend sits. */
.question legend.qtext { float: left; width: 100%; }
.question .answer-row { clear: both; }

.question .qtext,
.question p.qtext {
  font-weight: 600;
  color: var(--cg-navy);
  margin-bottom: 0.8rem;
  font-size: 1.02rem;
  line-height: 1.45;
}

.question .qtext .q-icon {
  width: 26px;
  height: 26px;
  vertical-align: -7px;
  margin-right: 0.5rem;
}

.question .qtext .q-num { color: var(--cg-link); margin-right: 0.15rem; }

.survey-submit {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1.6rem;
}

/* The Turnstile bot check; the height is reserved so the button doesn't jump when it loads. */
.survey-botcheck { margin-top: 1.6rem; min-height: 65px; }
.survey-botcheck + .survey-submit { margin-top: 1rem; }

.answer-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.answer-row input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.answer-row label.answer {
  flex: 1 1 100px;
  text-align: center;
  padding: 0.85rem 0.5rem;
  border: 2px solid var(--cg-navy);
  border-radius: 4px;
  background: var(--cg-white);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  color: var(--cg-navy);
  margin: 0;
}

.answer-row label.answer:hover { background: var(--cg-gold); }

.answer-row input[type="radio"]:checked + label.answer {
  border-color: var(--cg-navy);
  font-weight: 700;
}

.answer-row input[type="radio"]:focus-visible + label.answer {
  outline: 3px solid var(--cg-orange);
  outline-offset: 1px;
}

.answer-row input[value="yes"]:checked + label.answer { background: #d8f3dc; border-color: var(--cg-yes); }
.answer-row input[value="unsure"]:checked + label.answer { background: #fdf3d0; border-color: #c79a1e; }
.answer-row input[value="no"]:checked + label.answer { background: #fde3d9; border-color: var(--cg-no); }

/* ---------- Results (icon + stacked bar per question) ---------- */

.results-card {
  background: var(--cg-navy);
  color: rgba(255, 255, 255, 0.85);
  border-radius: var(--cg-radius);
  padding: 2rem;
  margin: 2rem 0;
}

/* On the landing page the card sits inside a full-bleed navy band. */
.band--navy .results-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.results-card .results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.1rem;
}

.results-card h2 {
  color: var(--cg-white);
  font-family: var(--cg-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.45rem;
}

.results-card .area-label {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
}

.set-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin: -0.5rem 0 1.1rem;
}

.set-note a { color: var(--cg-orange); font-weight: 700; }

.legend {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  margin-bottom: 1.3rem;
}

.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }

.legend i {
  display: inline-block;
  width: 20px;
  height: 11px;
  border-radius: 2px;
}

.legend .l-yes i { background: var(--cg-yes); }
.legend .l-unsure i { background: var(--cg-unsure); }
.legend .l-no i { background: var(--cg-no); }

.q-rows { display: flex; flex-direction: column; gap: 1.25rem; }

.q-row { display: flex; gap: 0.8rem; align-items: flex-start; }

.q-icon { width: 30px; height: 30px; flex-shrink: 0; margin-top: 0.1rem; }

.q-body { flex: 1; min-width: 0; }

.q-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.45rem;
}

.q-bar {
  display: flex;
  height: 28px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.q-bar .seg-yes { background: var(--cg-yes); }
.q-bar .seg-unsure { background: var(--cg-unsure); }
.q-bar .seg-no { background: var(--cg-no); }

.q-bar span {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
}

.q-bar .seg-unsure { color: rgba(20, 16, 6, 0.85); }

.results-card details { margin-top: 1.4rem; }
.results-card summary { cursor: pointer; color: rgba(255, 255, 255, 0.6); }

.results-card .admin-table th,
.results-card .admin-table td {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
.results-card .admin-table th { color: var(--cg-white); }

/* ---------- Map + area picker ---------- */

.map-wrap { max-width: 420px; margin: 1.2rem auto 0; }

#uk-map { width: 100%; height: auto; display: block; }

#uk-map .region { cursor: pointer; }

#uk-map .region-shape {
  fill: var(--cg-navy);
  stroke: var(--cg-cream);
  stroke-width: 1.2;
  stroke-linejoin: round;
  transition: fill 0.15s;
}

#uk-map .region-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  fill: var(--cg-orange);
  pointer-events: none;
}

#uk-map .region:hover .region-shape,
#uk-map .region:focus .region-shape {
  fill: var(--cg-yes);
}

#uk-map .region.selected .region-shape {
  fill: var(--cg-orange);
  stroke: var(--cg-navy);
  stroke-width: 2;
}

#uk-map .region.selected .region-label { fill: var(--cg-ink); }

#uk-map .region:focus { outline: none; }
#uk-map .region:focus-visible .region-shape { stroke: var(--cg-orange); stroke-width: 3; }

.map-hint {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  color: var(--cg-slate);
  margin-top: 0.8rem;
}

.area-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
  margin: 1rem 0;
}

.area-controls .field { margin-bottom: 0; flex: 1 1 220px; }

.toggle-group { display: inline-flex; }

.toggle-group button {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  padding: 0.55rem 1rem;
  border: 2px solid var(--cg-orange);
  background: transparent;
  color: var(--cg-link);
  cursor: pointer;
}

.toggle-group button[aria-pressed="true"] {
  background: var(--cg-orange);
  color: var(--cg-ink);
}

.toggle-group button:focus-visible { outline: 3px solid var(--cg-navy); outline-offset: 2px; }

/* ---------- Admin ---------- */

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #e3e6ea; }
.admin-table th { color: var(--cg-navy); }
/* Keep headings and the first column (names / ids) on one line; the table
   scrolls sideways on phones instead of squeezing every word onto its own line. */
.admin-table th, .admin-table td:first-child { white-space: nowrap; }

.pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill.published { background: #d8f3dc; color: var(--cg-yes); }
.pill.draft { background: var(--cg-gold); color: var(--cg-slate); }
.pill.archived { background: #e3e6ea; color: var(--cg-muted); }
.pill.held { background: var(--cg-gold); color: var(--cg-slate); }
.pill.counted { background: #d8f3dc; color: var(--cg-yes); }
.badge { display: inline-block; min-width: 1.5em; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--cg-danger); color: var(--cg-white); font-size: 0.8rem; font-weight: 700; text-align: center; margin-left: 0.4rem; }

.btn-small { padding: 8px 14px; font-size: 0.9rem; }

.btn-danger { background: var(--cg-danger); color: var(--cg-white); }
.btn-danger:hover { background: #a33f24; }

.btn-admin { background: var(--cg-yes); color: var(--cg-white); }
.btn-admin:hover { background: #245a42; }

/* A note that pops in below a button without moving anything (same trick
   as .share-note on the results page). */
.note-anchor { position: relative; display: inline-block; }

.pop-note {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.4rem;
  font-weight: 700;
  color: var(--cg-yes);
  white-space: nowrap;
}

/* Duplicate / delete buttons in the surveys table sit side by side. */
.admin-actions { display: flex; gap: 0.4rem; }
.admin-actions form { margin: 0; }

/* Gallery admin: a grid of photos with caption + reorder / remove controls. */
.admin-gallery { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
.admin-photo { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--cg-radius); box-shadow: var(--cg-shadow); }
.admin-photo-caption { display: flex; gap: 0.4rem; margin: 0; }
.admin-photo-caption input { flex: 1; min-width: 0; font: inherit; font-size: 0.9rem; padding: 0.4rem 0.6rem; border: 1px solid #c9ced6; border-radius: 8px; }
.admin-photo .admin-actions { flex-wrap: wrap; }

/* Links admin: one card per organisation. */
.admin-list-heading { margin: 2rem 0 0.25rem; font-size: 1.2rem; }
.partner-admin-list { list-style: none; }
.partner-admin { margin: 1rem 0; }
.partner-admin-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.partner-admin h3 { font-size: 1.05rem; }
.partner-logo-empty { display: flex; align-items: center; justify-content: center; font-size: 0.8rem; background: var(--cg-gold); }
.partner-admin details summary { cursor: pointer; font-weight: 700; color: var(--cg-link); }
.partner-admin textarea { width: 100%; font: inherit; padding: 0.6rem 0.75rem; border: 1px solid #c9ced6; border-radius: 8px; line-height: 1.5; }
.check-inline { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.9rem; }

/* Recent changes: one row per edit, with an optional before/after fold-out. */
.change-list { list-style: none; }
.change-row { padding: 0.9rem 0; border-bottom: 1px solid #e3e6ea; }
.change-row.is-undone .change-summary { text-decoration: line-through; color: var(--cg-muted); }
.change-main { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; }
.change-when { font-size: 0.85rem; white-space: nowrap; }
.change-summary { font-weight: 600; color: var(--cg-navy); }
.change-actions { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: flex-start; margin-top: 0.5rem; }
.change-actions form { margin: 0 0 0 auto; }
.change-actions details { flex: 1 1 260px; font-size: 0.9rem; }
.change-actions summary { cursor: pointer; color: var(--cg-link); font-weight: 600; }
.change-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; margin-top: 0.6rem; }
.change-side pre { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 0.85rem; background: var(--cg-gold); border-radius: 8px; padding: 0.6rem 0.8rem; margin-top: 0.25rem; }

/* Yes / unsure / no chips on the response detail page. */
.answer-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cg-white);
}
.answer-yes { background: var(--cg-yes); }
.answer-unsure { background: var(--cg-unsure); color: var(--cg-ink); }
.answer-no { background: var(--cg-danger); }
.answer-none { background: #9aa2ad; }

.btn-share { background: var(--cg-yes); color: var(--cg-white); }
.btn-share:hover { background: #245a42; }

.results-actions {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Sits below the buttons, out of the layout flow, so appearing
   doesn't shift them. */
.share-note {
  font-weight: 700;
  color: var(--cg-yes);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.4rem;
  white-space: nowrap;
}

/* ---------- Question set picker (results history) ---------- */

/* ---------- "Change over time" trend chart ---------- */

.trend-card .section-title { font-size: 1.25rem; }

.trend-wrap { position: relative; }

.trend-chart { width: 100%; height: auto; display: block; }
.trend-chart .tick { fill: var(--cg-muted); font-size: 12px; }

.trend-legend { margin-bottom: 0.5rem; }

.trend-tip {
  position: absolute;
  background: var(--cg-white);
  border: 1px solid #e5e0cf;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  box-shadow: var(--cg-shadow);
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.trend-tip i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.set-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 -0.75rem;
}

.set-picker label { margin: 0; }

.set-picker select { width: auto; max-width: 100%; }

/* ---------- Org pages (brought over from commongroundorg.co.uk) ---------- */

.page-title-band { padding: 2.6rem 1.2rem; }

.page-title {
  font-family: var(--cg-display);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-display);
  font-size: clamp(1.9rem, 5.5vw, 2.9rem);
  line-height: 1.08;
  color: var(--cg-navy);
}

/* Readable column for long-form copy. */
.org-page { max-width: 760px; }

.org-copy p { margin-bottom: 1rem; }
.org-copy p:last-child { margin-bottom: 0; }
.org-copy ul { margin: 0 0 1rem 1.3rem; }
.org-copy li { margin-bottom: 0.35rem; }
.org-copy strong { color: var(--cg-navy); }

.org-intro { font-size: 1.05rem; }

.org-heading { margin: 2.2rem 0 0.9rem; color: var(--cg-navy); }

.org-quote {
  border-left: 5px solid var(--cg-orange);
  background: var(--cg-gold);
  border-radius: 0 var(--cg-radius) var(--cg-radius) 0;
  padding: 1.1rem 1.4rem;
  margin: 2rem 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--cg-navy);
}

.org-quote .org-quote-credit { font-style: normal; font-weight: 700; margin-top: 0.4rem; font-size: 0.9rem; }

.org-video {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 1.6rem auto;
  border-radius: var(--cg-radius);
  box-shadow: var(--cg-shadow);
  background: var(--cg-navy);
}

.page-cta .cta-buttons {
  margin-top: 1.4rem;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ---------- Home: welcome note + mission ---------- */

.mission { max-width: 900px; }

.welcome-note { padding: 1.1rem 1.4rem; margin-bottom: 2rem; }

.mission-cols { display: grid; gap: 1.8rem; }

.mission-photo {
  width: 100%;
  max-width: 340px;
  justify-self: center;
  border-radius: var(--cg-radius);
  box-shadow: var(--cg-shadow);
}

.mission-collage {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 1.2rem auto 0;
  border-radius: 8px;
  box-shadow: var(--cg-shadow);
}

@media (min-width: 720px) {
  .mission-cols { grid-template-columns: 1.5fr 1fr; align-items: start; }
}

/* ---------- Links page: partner cards ---------- */

.partner-list { display: flex; flex-direction: column; gap: 1rem; max-width: 760px; }

.partner-card {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  background: var(--cg-white);
  border-radius: var(--cg-radius);
  box-shadow: var(--cg-shadow);
  padding: 1.2rem 1.4rem;
  text-decoration: none;
  color: var(--cg-slate);
}

.partner-card:hover { outline: 3px solid var(--cg-orange); }

.partner-card h2 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.partner-card p { font-size: 0.92rem; }

.partner-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--cg-white);
}

@media (max-width: 480px) {
  .partner-card { flex-direction: column; text-align: center; }
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.gallery-item { margin: 0; }

.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: var(--cg-radius);
  overflow: hidden;
  box-shadow: var(--cg-shadow);
}

.gallery-open img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-open:focus-visible { outline: 3px solid var(--cg-orange); outline-offset: 2px; }

.gallery-item figcaption {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cg-slate);
  margin-top: 0.35rem;
  text-align: center;
}

.lightbox {
  margin: auto; /* the global margin reset would otherwise pin the dialog top-left */
  border: none;
  border-radius: var(--cg-radius);
  padding: 0.8rem;
  background: var(--cg-white);
  max-width: min(92vw, 900px);
}

.lightbox::backdrop { background: rgba(11, 46, 49, 0.85); }

.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 8px; }

.lightbox p { text-align: center; font-weight: 600; margin-top: 0.5rem; color: var(--cg-navy); }

.lightbox-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  border: none;
  background: var(--cg-navy);
  color: var(--cg-white);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- Contact ---------- */

.subscribe-card { max-width: 560px; }

.subscribe-choices {
  border: none;
  margin-bottom: 1.25rem;
}

.subscribe-choices legend { font-weight: 600; color: var(--cg-navy); margin-bottom: 0.4rem; }

.subscribe-choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400;
  margin: 0 1.4rem 0.3rem 0;
}

.subscribe-choices input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--cg-orange); }

.follow-links { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.subscribe-privacy { font-size: 0.85rem; color: var(--cg-muted); margin-top: 0.8rem; }

/* Shown in place of the form once the signup has gone through. */
.subscribe-done p { margin-bottom: 1rem; }
.subscribe-done .subscribe-thanks { font-size: 1.25rem; font-weight: 600; color: var(--cg-navy); }
.subscribe-done:focus { outline: none; }

/* ---------- Resources (hidden downloads page) ---------- */

.resource-list { list-style: none; margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.7rem; }

.resource-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--cg-white);
  border-radius: var(--cg-radius);
  box-shadow: var(--cg-shadow);
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  color: var(--cg-navy);
}

/* The written-out resources link on the admin page. */
.resource-link { margin: 0.5rem 0 1rem; }
.resource-link code {
  display: inline-block;
  background: var(--cg-gold);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  word-break: break-all;
  user-select: all;
}

/* ---------- Footer extras ---------- */

.footer-tagline {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  color: var(--cg-navy);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.footer-social {
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
}

.footer-social .social-icon {
  display: inline-flex;
  color: var(--cg-navy);
}

.footer-social .social-icon:hover,
.footer-social .social-icon:focus-visible { color: var(--cg-link); }

.footer-social .social-icon svg { width: 22px; height: 22px; }

/* ---------- Mobile ---------- */

/* Menu button — hidden on wide screens, shown once the nav can't fit. */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--cg-track-caps);
  color: var(--cg-navy);
  background: none;
  border: 2px solid var(--cg-navy);
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  content: "";
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; top: -5px; }
.nav-toggle-bars::after { position: absolute; top: 5px; }

@media (max-width: 1120px) {
  .nav-toggle { display: inline-flex; flex-shrink: 0; }
  /* Brand left, Menu button right, always on one row; the nav (when open)
     drops to its own full-width row below them. */
  .site-header { gap: 0.5rem; }
  .site-header .brand { flex: 1; min-width: 0; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; gap: 0; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--cg-gold); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--cg-orange); }
}

@media (max-width: 600px) {
  .site-header { justify-content: space-between; text-align: left; }
  .site-header .wordmark { font-size: 0.92rem; }
  .card { padding: 1.25rem 0.9rem; }
  .band { padding: 1.6rem 1rem; }
  .hero { padding: 2.4rem 1.2rem; }
  .btn-hero { display: block; text-align: center; }
  .q-icon { width: 26px; height: 26px; }
  .q-bar { height: 24px; }
  .q-text { font-size: 0.88rem; }
}

@media (max-width: 480px) {
  #uk-map .region-label { display: none; }
}
