/* Shared visual system for every resident-facing page (index, calendar-view,
   submit, privacy, unsubscribe, flyer). One file so the look stays
   consistent as more sections get added, the same reasoning as nav.js for
   navigation. Internal tools (admin, manage-events, status) are plain and
   intentionally don't use this.

   Design direction: clean and modern, closer to a state tourism board site
   than a startup -- a plain white background, a geometric sans (Montserrat)
   throughout, and one accent color (green) doing all the work that color
   does: buttons, links-within-text, badges, emphasis. No background
   texture, no second decorative accent color. Meant to read as
   "professionally run public infrastructure" to a city official or
   business sponsor, and effortless to a resident. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Pinned to the dark/blue palette for every visitor, regardless of
   their own device's light/dark setting (Kevin's call, 2026-09-15 --
   the site used to follow prefers-color-scheme, which meant it looked
   different on his Mac vs his iPhone depending on each device's own
   system setting; he'd rather everyone see the same look). The former
   light palette and the @media (prefers-color-scheme: dark) block that
   swapped to this one are gone, not just overridden -- if a light mode
   ever comes back, reintroduce it as an explicit toggle rather than
   reading the system preference again. */
:root {
  color-scheme: dark;

  --ink: #f0f0f0;
  --ink-soft: #b0b0b0;
  --ink-faint: #888888;
  --paper: #121212;
  --surface: #1c1c1c;
  --surface-border: #333333;
  --rule: #333333;

  --primary: #7bb0f7;
  --primary-dark: #9dc4f7;
  --primary-tint: #16283d;
  --navy: #90aecf;
  --navy-dark: #b7cbe4;
  --success: #5fb583;
  --success-tint: #16281b;

  /* Category colors for event-type badges only -- not part of the site
     chrome/button system above, which stays on --primary. */
  --cat-red: #f2867c;
  --cat-red-tint: #3d1917;
  --cat-red-text: #f5a89f;
  --cat-yellow: #f2c94c;
  --cat-yellow-tint: #3d3115;
  --cat-yellow-text: #f5d878;

  --shadow-sm: none;
  --shadow-md: none;
  --radius: 10px;
  --radius-sm: 7px;

  --font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body.themed {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
}

/* Not flex -- a nav.js page inserts a plain block spacer div before <main>
   to offset the fixed nav bar, which only stacks correctly above it in
   normal block flow. A row-direction flex body would put them side by
   side instead, so centering is done on main itself, not the body. */
body.themed main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem;
}
body.themed main.wide { max-width: 900px; }

/* Badge (used for the county emblem on index/submit/etc). Border is
   --primary, not --surface-border -- a Kevin-reported catch, 2026-09-16:
   the old --surface-border outline on a --surface fill was only ever
   about 1.1:1 contrast against the page (basically invisible without
   zooming in), which matters more than it might look like it should for
   a resident with limited eyesight. --primary against --surface is
   7.6:1. */
.mo-badge {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .7rem;
  box-shadow: var(--shadow-sm);
}
.mo-badge img { width: 40px; height: auto; display: block; }

.eyebrow {
  display: block;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 .35rem;
}

body.themed h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 .4rem;
  text-align: center;
  color: var(--ink);
}

body.themed p.sub {
  margin: 0 0 .9rem;
  color: var(--ink-soft);
  font-size: .96rem;
  line-height: 1.45;
  text-align: center;
}

body.themed p.stats-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .6rem;
  justify-content: center;
  margin: 0 0 1.6rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* Each text run is its own flex item and stays on one line -- without
   this, bare text between the live-count span becomes anonymous flex
   items that can shrink and wrap mid-phrase instead of the whole line
   wrapping as clean chunks. */
body.themed p.stats-line .stat-seg { white-space: nowrap; }
body.themed p.stats-line::before,
body.themed p.stats-line::after {
  content: "";
  height: 1px;
  flex: 1 1 24px;
  max-width: 3rem;
  background: var(--rule);
}

/* The event count is the one number here that actually moves (the
   scraper adds to it continuously); county/town/calendar counts don't,
   so this is styled to visually pop out from the rest of the line
   instead of blending in as one more static stat. */
body.themed .stats-line .live-count,
.stats-line .live-count {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  color: var(--primary);
  font-weight: 800;
  font-size: 1.15em;
}
body.themed .stats-line .live-dot,
.stats-line .live-dot {
  width: .5em;
  height: .5em;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(1.5); }
}
@media (prefers-reduced-motion: reduce) {
  body.themed .stats-line .live-dot,
  .stats-line .live-dot { animation: none; }
}

body.themed section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  scroll-margin-top: 4rem;
}

body.themed h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 .75rem;
  padding-left: .7rem;
  border-left: 3px solid var(--primary);
  color: var(--ink);
}

body.themed p.hint { margin: 0 0 1rem; color: var(--ink-soft); font-size: .85rem; line-height: 1.45; }
body.themed p.hint a { color: var(--navy); font-weight: 500; }
body.themed p.hint:last-child { margin-bottom: 0; }

body.themed p.callout {
  margin: 0 0 1rem;
  padding: .8rem .9rem;
  background: var(--primary-tint);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1.45;
  color: var(--ink);
}
body.themed p.callout a { color: var(--primary); font-weight: 600; }

body.themed .btn {
  display: block;
  width: 100%;
  padding: .9rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff9f4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
body.themed .btn:hover { background: var(--primary-dark); }
body.themed .btn.secondary {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--surface-border);
  box-shadow: none;
  margin-top: .6rem;
}
body.themed .btn.secondary:hover { border-color: var(--navy); }

body.themed .or-divider {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: .6rem 0 .15rem;
}

body.themed .share-label { margin: 1.1rem 0 .55rem; font-size: .85rem; font-weight: 600; color: var(--ink-soft); text-align: center; }
body.themed .share-row { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }

/* Recognizable official platform marks/colors, not a uniform site-accent
   pill -- residents scan for the logo they already know, and it reads as
   more legitimate to an outside viewer (city staff, a business owner)
   than five identical buttons would. */
body.themed .share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex: 1 1 auto;
  min-width: 6.5rem;
  padding: .6rem .8rem;
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease;
}
body.themed .share-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
body.themed .share-btn:hover { filter: brightness(1.08); }
body.themed .share-btn.facebook { background: #1877f2; }
body.themed .share-btn.whatsapp { background: #25d366; }
body.themed .share-btn.instagram {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
}
/* Fixed value, not var(--navy) -- that token flips to a pale tint in dark
   mode for text/link contrast, which looks washed out as a solid fill. */
body.themed .share-btn.email { background: #1f3a54; }
body.themed .share-btn.copylink {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--surface-border);
}
body.themed .share-btn.copylink:hover { border-color: var(--navy); filter: none; }
body.themed .share-btn.copied { background: var(--success) !important; color: #fff; border-color: transparent; }

body.themed label { display: block; font-weight: 600; font-size: .9rem; margin: 1rem 0 .4rem; color: var(--ink); }
body.themed label:first-of-type { margin-top: 0; }

body.themed input:not([type="checkbox"]):not([type="radio"]),
body.themed select,
body.themed textarea {
  width: 100%;
  padding: .68rem .75rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: inherit;
  background: var(--surface);
}
body.themed input:not([type="checkbox"]):not([type="radio"]):focus,
body.themed select:focus,
body.themed textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
body.themed select { margin-bottom: .75rem; }
body.themed textarea { resize: vertical; min-height: 5rem; }
body.themed .card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

body.themed .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: .9rem 0;
}
body.themed .checkbox-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .15rem;
  flex-shrink: 0;
  accent-color: var(--primary);
}
body.themed .checkbox-row label {
  margin: 0;
  font-weight: 400;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--ink);
}

body.themed button[type="submit"] {
  width: 100%;
  margin-top: 1rem;
  padding: .9rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
body.themed button[type="submit"]:hover { filter: brightness(1.05); }
body.themed button[type="submit"]:disabled { opacity: .6; }

body.themed .status-msg { margin-top: 1rem; font-size: .9rem; text-align: center; }
body.themed .status-msg.ok { color: var(--success); }

body.themed .town-picker {
  margin-left: 1.75rem;
  padding-left: .75rem;
  border-left: 2px solid var(--surface-border);
}
body.themed .town-picker.hidden { display: none; }
body.themed .town-hint { margin: 0 0 .5rem; font-size: .8rem; }
body.themed .town-picker .checkbox-row { margin: .5rem 0; }

body.themed .footer-link { text-align: center; margin-top: .5rem; }
body.themed .footer-link a { color: var(--navy); font-size: .9rem; font-weight: 500; }

body.themed .submit-qr { text-align: center; margin-top: .6rem; }
body.themed .submit-qr .qr-box {
  display: inline-block;
  background: #fff;
  padding: 8px;
  border-radius: 6px;
  line-height: 0;
  border: 1px solid var(--surface-border);
}
body.themed .submit-qr .qr-box svg { width: 92px; height: 92px; display: block; }
body.themed .submit-qr p { margin: .35rem 0 0; font-size: .75rem; color: var(--ink-faint); }

body.themed .site-credit {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
  font-size: .8rem;
  color: var(--ink-faint);
}
body.themed .site-credit a { color: inherit; text-decoration: underline; }
body.themed .site-credit .powered-by { display: block; margin-top: .3rem; color: var(--ink-faint); font-size: .75rem; }

body.themed details {
  margin: 1rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--surface-border);
  font-size: .85rem;
  color: var(--ink-soft);
}
body.themed details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
body.themed details > :not(summary) { margin-top: .7rem; }
body.themed details p { margin: 0 0 .7rem; line-height: 1.5; }
body.themed details p:last-child { margin-bottom: 0; }
body.themed details strong { color: var(--ink); }
body.themed details a { color: var(--navy); }

/* Responsive 16:9 video embed with a "coming soon" placeholder shown
   until a real video file exists -- see the JS next to the <video> tag
   for how the swap happens. */
body.themed .video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--surface-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
body.themed .video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
body.themed .video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--ink-faint);
  pointer-events: none;
}
body.themed .video-placeholder svg { width: 40px; height: 40px; }
body.themed .video-placeholder span { font-size: .85rem; font-weight: 600; }

/* Small colored pill used for event-type labels (calendar list/detail
   views), kept here so the same look works everywhere it's used. */
.type-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid var(--primary);
}

@media print {
  body.themed { background-image: none; }
}
