/* Rockland YIMBY — official civic / advocacy look.
   System fonts only. No external fonts or scripts. */
* { box-sizing: border-box; }

:root {
  --navy: #132e4d;
  --navy-dark: #0d2138;
  --navy-light: #1d4266;
  --gold: #c99a2e;
  --gold-dark: #8a6d00;
  --ink: #1e293b;
  --slate: #475569;
  --muted: #64748b;
  --line: #dbe2ea;
  --bg: #eef2f6;
  --card: #ffffff;
  --green: #2e7d4f;
  --amber: #b45309;
  --red: #9b2c2c;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--navy-light); }
a:hover, a:focus { color: var(--navy-dark); }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* --- Sticky navy header / nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 2px 10px rgba(13, 33, 56, 0.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.brand:hover, .brand:focus { color: #fff; text-decoration: underline; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a {
  color: #dbe7f3;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.2rem 0;
}
.site-nav a:hover, .site-nav a:focus { color: #fff; text-decoration: underline; }

/* --- Hero --- */
.hero {
  background: var(--navy-dark);
  color: #fff;
  padding: 2.75rem 0 2.25rem;
}
.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 760px;
}
.hero-text {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #e2eaf4;
  max-width: 760px;
}

/* --- Stats band --- */
.stats-band {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0 1.25rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}
.stats > div {
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: #f8fafc;
}
.stats strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1.1;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.stats span { font-size: 0.9rem; color: var(--slate); }
.stats-note, .note, .muted { color: var(--muted); font-size: 0.9rem; }
.stats-note { margin: 1rem 0 0; }

/* --- Sections --- */
main.wrap { padding-top: 0.5rem; padding-bottom: 2rem; }
.section { padding: 2rem 0 0.5rem; }
.section h2 {
  margin: 0 0 0.9rem;
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--navy);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--gold);
}
.section p { max-width: 820px; }

/* --- Tracker filters --- */
.tracker label {
  display: inline-block;
  margin: 0 1rem 0.75rem 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.tracker input, .tracker select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid #b6c2cf;
  border-radius: 5px;
  background: #fff;
  max-width: 100%;
}
.tracker input[type="search"] { min-width: 260px; }
#count { color: var(--slate); font-size: 0.95rem; }

/* --- Project card grid --- */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem 1.3rem;
  box-shadow: 0 1px 3px rgba(13, 33, 56, 0.08);
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; color: var(--navy); overflow-wrap: anywhere; }
.card, .card p { min-width: 0; overflow-wrap: anywhere; }
#grid > * { min-width: 0; }
.project-page h1, .hero h1, .section h2 { overflow-wrap: anywhere; }
.card p { font-size: 0.97rem; }
.chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #e6eef7;
  font-size: 0.85rem;
  font-weight: 700;
}
.chip-approved { background: #dcefe3; color: #1d5c36; }
.chip-approved-conditions { background: #fdf3d7; color: #6b5500; }
.chip-under-construction { background: #fdeeda; color: #7c3f08; }
.chip-in-review { background: #e8edf2; color: #334155; }
.chip-litigation { background: #fbe3e3; color: #7f1d1d; }
.chip-roundups { background: #e2e8f5; color: #1d4266; }

button.toggle {
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--navy);
  background: #eef3f8;
  border: 1px solid #c3d0dd;
  border-radius: 5px;
  padding: 0.45rem 0.85rem;
}
button.toggle:hover, button.toggle:focus { background: #dbe7f3; }
.detail { margin-top: 0.9rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.detail h4 { color: var(--navy); margin: 1rem 0 0.4rem; }
.history { padding-left: 1.2rem; font-size: 0.93rem; color: var(--slate); }
.history li { margin-bottom: 0.35rem; }

/* --- Explainer + contact --- */
.explainer p, .contact-section p { max-width: 820px; }
.contact-form label { display: block; margin: 0.6rem 0; font-weight: 600; }
.contact-form input[type="text"], .contact-form input[type="email"],
.contact-form textarea, .contact-form select {
  display: block;
  width: 100%;
  max-width: 600px;
  margin-top: 0.25rem;
  box-sizing: border-box;
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid #b6c2cf;
  border-radius: 5px;
  background: #fff;
}
.contact-form textarea { resize: vertical; }
.contact-form button {
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 5px;
  padding: 0.55rem 1.2rem;
  margin-top: 0.5rem;
}
.contact-form button:hover, .contact-form button:focus { background: var(--navy-light); }
.contact-form button:disabled { opacity: 0.6; cursor: wait; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#contact-status { font-weight: 600; }

/* --- Footer: official civic tracker footer --- */
.site-footer {
  background: var(--navy);
  color: #fff;
  margin-top: 2rem;
  padding: 2.5rem 0 1.5rem;
  font-size: 0.92rem;
  line-height: 1.6;
  border-top: 3px solid var(--gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  gap: 2rem;
}
.footer-col h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.footer-col p { margin: 0 0 0.5rem; color: #dbe6f2; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.35rem; }
.site-footer a { color: #fff; text-underline-offset: 2px; }
.site-footer a:hover, .site-footer a:focus { color: #f3d27a; }
.footer-note {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.footer-note p { margin: 0; font-size: 0.88rem; color: #dbe6f2; }
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .site-footer { padding: 2rem 0 1.25rem; }
}

/* --- Phone widths: stack, wrap, no horizontal overflow --- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding-left: 1rem; padding-right: 1rem; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 0.25rem 1rem; }
  .hero { padding: 2rem 0 1.75rem; }
  .hero h1 { font-size: 1.9rem; }
  .brand { font-size: 1.1rem; }
  .card { min-width: 0; }
  main.wrap, .wrap { min-width: 0; }
  .hero-text { font-size: 1.05rem; }
  .stats { grid-template-columns: 1fr; }
  .stats strong { font-size: 1.8rem; }
  #grid { grid-template-columns: 1fr; }
  .tracker label { display: block; margin-right: 0; }
  .tracker input[type="search"], .tracker select { width: 100%; min-width: 0; }
  .card { padding: 1rem; }
  .section h2 { font-size: 1.4rem; }
}

/* --- Project pages --- */
.project-page { padding-top: 1.5rem; padding-bottom: 2rem; }
.project-page h1 { color: var(--navy); font-size: 2rem; line-height: 1.2; margin: 0.75rem 0 0.6rem; }
.back-link { font-weight: 700; text-decoration: none; }
.back-link:hover, .back-link:focus { text-decoration: underline; }
.project-link { font-weight: 700; text-decoration: none; }
.project-link:hover, .project-link:focus { text-decoration: underline; }
.full-record p, .infra p, .history-section p { max-width: 820px; }
.infra-list { max-width: 820px; }
.infra-list li { margin-bottom: 0.5rem; }

/* --- Blog --- */
.blog-list { list-style: none; padding: 0; max-width: 820px; }
.blog-list li { border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: 6px; background: #fff; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.blog-list h3 { margin: 0 0 0.25rem; }
.blog-list h3 a { color: var(--navy); text-decoration: none; }
.blog-list h3 a:hover, .blog-list h3 a:focus { text-decoration: underline; }
.post-date { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.post-body p { max-width: 760px; }
.post-meta { color: var(--slate); font-size: 0.95rem; border: 1px solid var(--line); background: #f8fafc; border-radius: 6px; padding: 0.9rem 1.1rem; max-width: 760px; }

/* map + new status chips */
.chip-completed { background: #dcefe3; color: #1d5c36; }
.chip-rejected { background: #e8edf2; color: #1e293b; }
.chip-approval-claimed { background: #fdeeda; color: #7c3f08; }
.chip-proposal-only { background: #e8edf2; color: #334155; }
.chip-unofficial { background: #e8edf2; color: #475569; }
.plan-figure { margin: 1rem 0; }
.plan-figure img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.plan-figure figcaption { font-size: 0.9rem; color: var(--slate); margin-top: 0.4rem; }
.card-thumb { margin: 0.5rem 0 0.75rem; }
.card-thumb img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; display: block; }
.card-thumb figcaption { font-size: 0.85rem; color: var(--slate); margin-top: 0.35rem; }
.blog-thumb { margin: 0.5rem 0 0.75rem; }
.blog-thumb img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; display: block; }
.blog-thumb figcaption { font-size: 0.85rem; color: var(--slate); margin-top: 0.35rem; }
.leaflet-popup-content img { max-width: 220px; height: auto; display: block; margin-top: 0.4rem; border: 1px solid #dbe2ea; }
.leaflet-popup-content small { color: #475569; }
