/* Civraria shared look, served once at civraria.com/static/style.css for the landing page and
   every city edition.

   Themes: dark is the base. theme.js sets <html data-theme="light|dark"> from the reader's
   saved choice, or from their system setting when they haven't chosen. Without JS the
   system setting still applies through the media query below. */

:root {
  color-scheme: dark;
  --bg: #0b0f16;
  --glow-1: rgba(45, 212, 191, 0.10);
  --glow-2: rgba(129, 140, 248, 0.10);
  --surface: #121823;
  --surface-2: #182030;
  --border: #232c3c;
  --border-strong: #33405a;
  --text: #e8ebf1;
  --muted: #9aa5b8;
  --faint: #6c788d;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --on-accent: #042a25;
  --link: #6ee7d8;
  --recap: #a5b4fc;
  --recap-soft: rgba(165, 180, 252, 0.14);
  --alert: #fbbf24;
  --alert-soft: rgba(251, 191, 36, 0.14);
  --header-bg: rgba(11, 15, 22, 0.72);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fa;
  --glow-1: rgba(13, 148, 136, 0.08);
  --glow-2: rgba(99, 102, 241, 0.07);
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --border: #e2e6ed;
  --border-strong: #cbd2de;
  --text: #111827;
  --muted: #535e70;
  --faint: #7a8496;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.10);
  --on-accent: #ffffff;
  --link: #0f766e;
  --recap: #4f46e5;
  --recap-soft: rgba(79, 70, 229, 0.10);
  --alert: #b45309;
  --alert-soft: rgba(217, 119, 6, 0.12);
  --header-bg: rgba(246, 247, 250, 0.78);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 20px rgba(16, 24, 40, 0.05);
}

/* No JS: follow the system setting. Same values as the light block above. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f6f7fa; --glow-1: rgba(13, 148, 136, 0.08); --glow-2: rgba(99, 102, 241, 0.07);
    --surface: #ffffff; --surface-2: #f0f3f7; --border: #e2e6ed; --border-strong: #cbd2de;
    --text: #111827; --muted: #535e70; --faint: #7a8496;
    --accent: #0d9488; --accent-strong: #0f766e; --accent-soft: rgba(13, 148, 136, 0.10);
    --on-accent: #ffffff; --link: #0f766e; --recap: #4f46e5; --recap-soft: rgba(79, 70, 229, 0.10);
    --alert: #b45309; --alert-soft: rgba(217, 119, 6, 0.12); --header-bg: rgba(246, 247, 250, 0.78);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 20px rgba(16, 24, 40, 0.05);
  }
}

/* -- Base ----------------------------------------------------------------------------------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 28rem at 10% -8rem, var(--glow-1), transparent 70%),
    radial-gradient(50rem 26rem at 95% -10rem, var(--glow-2), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.6rem); margin: 0 0 0.6rem; }
h2 { font-size: 1.3rem; margin: 2.6rem 0 0.9rem; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin: 0.3rem 0; }
strong { font-weight: 650; }

.wrap { max-width: 48rem; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 2.5rem; padding-bottom: 1rem; }

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

.masthead {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.masthead .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 750; font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.brand-mark { width: 30px; height: 30px; flex: none; display: block; }
.edition-pill {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--accent); background: var(--accent-soft);
  padding: 2px 9px; border-radius: 999px;
}
.site-nav {
  display: flex; gap: 2px; margin-left: auto; align-items: center;
  font-size: 0.93rem;
}
.site-nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 4px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--muted); cursor: pointer; padding: 0; flex: none;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 640px) {
  .masthead .wrap { padding-bottom: 6px; }
  .theme-toggle { margin-left: auto; }
  /* Nav moves to its own row and scrolls sideways instead of wrapping. */
  .site-nav {
    order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 4px 10px 2px;
    overflow-x: auto; scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
}

/* -- Page pieces ---------------------------------------------------------------------------- */

.eyebrow, .kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 0.8rem; color: var(--muted); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.kicker a { color: var(--accent); text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.meta, .source { color: var(--muted); font-size: 0.9rem; }
.source { margin-top: 0.4rem; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 2.6rem 0 0.9rem;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.92rem; font-weight: 600; text-decoration: none; white-space: nowrap; }

.card, .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow);
}
.panel { padding: 20px 22px; margin: 0 0 1.2rem; }
.panel > :last-child { margin-bottom: 0; }
.panel h2 { margin-top: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 0.8rem; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }

.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 6px; line-height: 1.3;
  color: var(--accent); background: var(--accent-soft); white-space: nowrap;
}
.badge.recap { color: var(--recap); background: var(--recap-soft); }
.badge.alert { color: var(--alert); background: var(--alert-soft); }
.badge.muted { color: var(--muted); background: var(--surface-2); }

.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 10px; font-weight: 600; font-size: 0.95rem; text-decoration: none;
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent;
}
.button:hover { background: var(--accent-strong); }
.button.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.button.ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* Hero on the home page */
.hero { padding: 1rem 0 0.5rem; }
.hero h1 { font-size: clamp(2.1rem, 1.5rem + 3vw, 3.1rem); letter-spacing: -0.035em; }
.hero h1 .accent {
  background: linear-gradient(90deg, var(--accent), var(--recap));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 1.6rem 0 0; }
.tile {
  display: block; padding: 16px 18px; text-decoration: none; color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
a.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tile .num { display: block; font-size: 2rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.tile .label { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.tile .go { display: block; color: var(--accent); font-size: 0.88rem; font-weight: 600; margin-top: 10px; }

/* Rows of meetings (home and /meetings/) */
.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rows li { margin: 0; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
a.row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.row.is-canceled { opacity: 0.6; }
.date-tile {
  flex: none; width: 52px; text-align: center; border-radius: 12px; padding: 6px 0 7px;
  background: var(--surface-2); border: 1px solid var(--border); line-height: 1.05;
}
.date-tile .mon { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.date-tile .d { display: block; font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; }
.row-body { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 650; line-height: 1.35; }
.row .meta { display: block; margin-top: 2px; }
.row .badge { flex: none; }
@media (max-width: 480px) {
  .row { align-items: flex-start; flex-wrap: wrap; }
  .row-body { flex-basis: calc(100% - 66px); }
  .row .badge { margin-left: 66px; margin-top: -4px; }
}

/* Meeting page */
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0 1.8rem; padding: 0; list-style: none; }
.facts li {
  margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  font-size: 0.9rem; color: var(--muted);
}
.facts svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

.agenda, .agenda ol { list-style: none; padding: 0; margin: 0; }
.agenda > li { padding: 10px 0; border-top: 1px solid var(--border); margin: 0; }
.agenda > li:first-child { border-top: 0; padding-top: 0; }
.agenda ol { margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--border); }
.agenda ol li { margin: 6px 0 6px 10px; color: var(--muted); }
.agenda .num {
  display: inline-block; min-width: 2rem; margin-right: 6px; font-size: 0.82rem; font-weight: 700;
  color: var(--accent); font-variant-numeric: tabular-nums;
}

.docs { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 8px; }
.docs li { margin: 0; }
.docs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 0.93rem;
}
.docs a:hover { border-color: var(--accent); }
.docs svg { width: 16px; height: 16px; color: var(--accent); }
.docs .meta { font-weight: 400; font-size: 0.82rem; }

/* Tables become stacked cards on phones (cells carry data-label). */
.table-card { padding: 4px 6px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th {
  text-align: left; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint); padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
td .meta { font-size: 0.85rem; }
@media (max-width: 640px) {
  .table-card { padding: 0; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { padding: 3px 0; border: 0; }
  table.stack td[data-label]::before {
    content: attr(data-label); display: block; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-top: 6px;
  }
  table.stack td:first-child::before { display: none; }
  table.stack td:first-child { font-weight: 650; }
}

/* "Generated from the public record" note */
.automation-note {
  display: flex; gap: 12px; align-items: flex-start; margin: 2.6rem 0 0; padding: 14px 16px;
  border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.9rem; line-height: 1.55;
}
.automation-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent); }

/* Long-form pages (About, How this site works, Privacy) */
.prose { max-width: 42rem; }
.prose h2 { padding-top: 0.2rem; }
.prose ul li::marker { color: var(--accent); }

/* Landing page (civraria.com) */
.editions { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.editions li { margin: 0; }
.edition { display: block; height: 100%; padding: 18px 20px; text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
a.edition:hover { border-color: var(--accent); transform: translateY(-1px); }
.edition strong { display: block; font-size: 1.1rem; margin: 8px 0 4px; }
.edition .meta { display: block; }
.edition.soon { border-style: dashed; background: transparent; box-shadow: none; }
.principles { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.principles li { margin: 0; padding: 16px 18px; }
.principles strong { display: block; margin-bottom: 4px; }
.principles span { color: var(--muted); font-size: 0.95rem; }

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

.site-footer { margin-top: 4rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; }
.site-footer .wrap { padding-top: 24px; padding-bottom: 40px; }
.site-footer p { margin: 0 0 0.7rem; max-width: 40rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  a.tile:hover, a.edition:hover { transform: none; }
}

/* Development projects and permits */
.count { color: var(--faint); font-weight: 600; font-size: 0.95rem; margin-left: 4px; }
.project-map { height: 380px; margin: 1.6rem 0 0.6rem; overflow: hidden; z-index: 0; }
.project-map .leaflet-popup-content { font: 600 0.92rem/1.4 inherit; }
.map-key { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 0.88rem; }
.map-key li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.map-key .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--alert-soft); color: var(--text); }
.pairs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1rem; }
.pairs dt { color: var(--muted); }
.pairs dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .pairs { grid-template-columns: 1fr; } .pairs dd { margin-bottom: 8px; } }
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0 0 1rem; border-left: 2px solid var(--border); }
.timeline li { margin: 0 0 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline p { margin: 4px 0 0; }
tr.total td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.street-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.street-list li { margin: 0; padding: 14px 18px; }
.street-list p { margin: 4px 0 0; }
details.more { margin: 1rem 0; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--link); margin-bottom: 0.8rem; }
table.compact td:not(:first-child), table.compact th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  table.compact { font-size: 0.85rem; }
  table.compact td, table.compact th { padding: 8px 10px; }
  table.compact .hide-sm { display: none; }
}
