/* ==========================================================================
   Burlington for Active Transport Coalition — bat-modern theme
   A light, modern, responsive design tailored to active-transport advocacy.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Brand palette: greens for movement & sustainability, warm amber accent */
  --green-900: #0f5132;
  --green-700: #1b7a4b;
  --green-600: #2f9e6b;
  --green-500: #38b27a;
  --green-100: #e3f5ec;
  --green-050: #f1faf5;
  --amber:     #f4b942;
  --amber-dk:  #d99818;

  --ink:       #16241d;   /* near-black with a green cast */
  --body:      #2f3b35;
  --muted:     #5d6b63;
  --line:      #dfe7e2;
  --bg:        #ffffff;
  --bg-alt:    #f5f9f7;

  --maxw:      1120px;
  --maxw-narrow: 720px;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(16, 40, 28, .06), 0 8px 24px rgba(16, 40, 28, .06);
  --shadow-lg: 0 12px 40px rgba(16, 40, 28, .12);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--green-700); text-decoration-color: rgba(47, 158, 107, .35); text-underline-offset: 2px; }
a:hover { color: var(--green-900); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 .5em;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--green-900); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green-500); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout helpers ------------------------------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.container-narrow { max-width: var(--maxw-narrow); }
.section { padding-block: clamp(2.75rem, 7vw, 5rem); }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem;
}
.section-head .section-title { margin: 0; }
.section-link { font-weight: 600; white-space: nowrap; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-sans); font-weight: 600; font-size: .98rem;
  padding: .7rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-900); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--green-900); border-color: var(--green-600); }
.btn-ghost:hover { background: var(--green-100); color: var(--green-900); }
.btn-light { background: #fff; color: var(--green-900); }
.btn-light:hover { background: var(--green-050); color: var(--green-900); box-shadow: var(--shadow); }

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(16, 40, 28, .05); }

.nav {
  max-width: var(--maxw); margin-inline: auto;
  padding: .7rem clamp(1.1rem, 4vw, 2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.nav-brand-mark { width: 52px; height: 52px; }
.nav-brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.08rem;
  color: var(--ink); line-height: 1.1; max-width: 14ch;
}

.nav-menu { display: flex; }
.nav-links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: inline-block; padding: .5rem .8rem; border-radius: 999px;
  color: var(--body); text-decoration: none; font-weight: 500; font-size: .98rem;
}
.nav-link:hover { background: var(--green-050); color: var(--green-900); }
.nav-link.is-active { color: var(--green-900); background: var(--green-100); }
.nav-cta-item { margin-left: .4rem; }
.nav-cta { padding: .5rem 1.1rem; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 44px; height: 44px; padding: 0; background: transparent; border: 0; cursor: pointer;
}
.nav-toggle-bar { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(120% 120% at 90% -10%, var(--green-100) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2rem);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
}
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700;
  color: var(--green-700); margin: 0 0 .9rem;
}
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 600; margin: 0 0 1rem; }
.hero-lede { font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--muted); margin: 0 0 1.75rem; max-width: 40ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-art svg { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- Intro ---------------------------------------------------------------- */
.section-intro { padding-top: clamp(2.25rem, 5vw, 3.5rem); }
.section-intro .prose { font-size: 1.12rem; }
.section-intro h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }

/* ---- Pillars ------------------------------------------------------------- */
.section-pillars { background: var(--bg-alt); }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 1.1rem; }
.pillar {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.35rem; box-shadow: var(--shadow);
}
.pillar-icon { font-size: 1.9rem; margin-bottom: .6rem; }
.pillar h3 { font-size: 1.18rem; margin-bottom: .35rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---- Cards (proposals) --------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green-500); }
.card-title { font-size: 1.3rem; margin: 0; }
.card-desc { color: var(--muted); margin: 0; flex: 1; }
.card-date { color: var(--muted); font-size: .85rem; }
.card-more { color: var(--green-700); font-weight: 600; font-size: .95rem; margin-top: .25rem; }

/* ---- Status badges ------------------------------------------------------- */
.badge {
  align-self: flex-start; display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px; background: #eceff1; color: #455a64;
}
.badge-draft        { background: #eceff1; color: #455a64; }
.badge-submitted    { background: #e3f2fd; color: #1565c0; }
.badge-under-review { background: #fff4dd; color: var(--amber-dk); }
.badge-adopted      { background: var(--green-100); color: var(--green-900); }
.badge-rejected     { background: #fdecea; color: #b3261e; }

/* ---- Post list ----------------------------------------------------------- */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; align-items: baseline;
  padding: 1.25rem 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.post-list > .post-item:first-child { border-top: 0; }
.post-item:hover .post-item-title { color: var(--green-700); }
.post-item-date { color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.post-item-title { font-size: 1.28rem; margin: 0 0 .25rem; }
.post-item-desc { margin: 0; color: var(--muted); }

/* ---- Index list (generic sections) -------------------------------------- */
.index-list { list-style: none; margin: 0; padding: 0; }
.index-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: .85rem; text-decoration: none; color: inherit; background: var(--bg);
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.index-item:hover { border-color: var(--green-500); transform: translateX(2px); box-shadow: var(--shadow); }
.index-item-title { font-size: 1.2rem; margin: 0 0 .2rem; }
.index-item-desc { margin: 0; color: var(--muted); }
.index-item-arrow { color: var(--green-600); font-size: 1.3rem; }

/* ---- Tags ---------------------------------------------------------------- */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: .75rem 0 0; padding: 0; }
.tag {
  font-size: .78rem; font-weight: 600; color: var(--green-900); background: var(--green-100);
  padding: .2rem .6rem; border-radius: 999px;
}

/* ---- Page (single / list headers) ---------------------------------------- */
.page-header {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.25rem, 5.5vw, 3.5rem);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.page-title { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: 0; }
.page-lede { font-size: 1.15rem; color: var(--muted); margin: .75rem 0 0; max-width: 52ch; }
.post-meta { color: var(--muted); font-size: .95rem; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.empty-note { color: var(--muted); font-style: italic; }

.page-actions { margin: 1.25rem 0 0; }
.pdf-download { font-size: .95rem; }
.pdf-download span { font-size: 1.05em; }

.post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.back-link { font-weight: 600; }

/* ---- Prose --------------------------------------------------------------- */
.prose { color: var(--body); }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: 1.6rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.3rem; margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .35rem; }
.prose a { font-weight: 500; }
.prose img { border-radius: var(--radius); margin-block: 1.5rem; box-shadow: var(--shadow); }
.prose blockquote {
  margin: 1.5rem 0; padding: .85rem 1.25rem; border-left: 4px solid var(--green-500);
  background: var(--green-050); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted);
}
.prose blockquote p { margin: 0; }
.prose code {
  background: var(--green-050); border: 1px solid var(--line); border-radius: 6px;
  padding: .1rem .4rem; font-size: .9em;
}
.prose pre { background: var(--ink); color: #e8f1ec; padding: 1.1rem 1.25rem; border-radius: var(--radius); overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }

/* ---- CTA band ------------------------------------------------------------ */
.section-cta { padding-block: clamp(2rem, 5vw, 3.5rem); }
.cta-box {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: #fff; border-radius: calc(var(--radius) + 6px);
  padding: clamp(2rem, 5vw, 3.25rem); text-align: center;
}
.cta-box h2 { color: #fff; font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin-bottom: .5rem; }
.cta-box p { color: rgba(255, 255, 255, .9); margin: 0 auto 1.5rem; max-width: 46ch; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #c8d6ce; margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.footer-inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: clamp(2.25rem, 5vw, 3.5rem) clamp(1.1rem, 4vw, 2rem);
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem;
}
.footer-brand-link { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.footer-brand-mark { width: 44px; height: 44px; }
.footer-brand-text { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.1rem; max-width: 18ch; }
.footer-tagline { color: #9fb3a8; margin: .9rem 0 .5rem; max-width: 42ch; font-size: .95rem; }
.footer-location { color: #9fb3a8; font-size: .9rem; margin: 0; }
.footer-location-link { display: inline-flex; align-items: center; gap: .35rem; color: #9fb3a8; text-decoration: none; }
.footer-location-link:hover { color: #fff; }
.footer-location-pin { font-size: .95em; }
.footer-heading { font-family: var(--font-sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin: 0 0 .9rem; }
.footer-nav ul, .footer-social { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-nav a, .footer-social a { color: #c8d6ce; text-decoration: none; }
.footer-nav a:hover, .footer-social a:hover { color: #fff; }
.footer-social a { display: inline-flex; align-items: center; gap: .55rem; }
.footer-social svg { flex: none; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 1.25rem clamp(1.1rem, 4vw, 2rem); max-width: var(--maxw); margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; justify-content: space-between;
  font-size: .85rem; color: #9fb3a8;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #c8d6ce; text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: #fff; }

/* ---- Image lightbox ------------------------------------------------------ */
/* Content images become click-to-zoom (see main.js) */
main .prose img:not(.no-zoom),
main .pfc img:not(.no-zoom) { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: clamp(1.5rem, 5vw, 3rem);
  background: rgba(11, 20, 16, .9); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
  cursor: zoom-out;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .9rem; max-width: 100%; }
.lightbox-img {
  max-width: min(1100px, 92vw); max-height: 84vh; width: auto; height: auto;
  border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.lightbox-caption { color: #e8f1ec; font-size: .9rem; line-height: 1.5; max-width: 70ch; text-align: center; }
.lightbox-close {
  position: absolute; top: clamp(.75rem, 2vw, 1.25rem); right: clamp(.75rem, 2vw, 1.5rem);
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.5rem; line-height: 1;
  cursor: pointer; transition: background .15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }
@media (prefers-reduced-motion: reduce) { .lightbox { transition: none; } }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 460px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-menu.is-open { max-height: 70vh; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem; }
  .nav-link { padding: .8rem 1rem; border-radius: var(--radius-sm); }
  .nav-cta-item { margin: .4rem 0 .25rem; }
  .nav-cta { width: 100%; }

  .pillars { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .post-item { grid-template-columns: 1fr; gap: .25rem; }
  .post-item-date { order: 2; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
