/* =========================================================
   Jefferson County Trails Council — modern static stylesheet
   No build step, no JS required. Works on any static host.
   ========================================================= */

:root {
  /* Green scale recalibrated to match the JCTC logo's actual hill-green
     (#7b9f6f, sampled from images/logo-emblem-large.jpg) — sage/olive hue
     rather than the previous more emerald/forest tone. */
  --green-900: #22361c;
  --green-800: #324b2a;
  --green-700: #47673c;
  --green-600: #55784a;
  --green-500: #7b9f6f;
  --green-100: #edf5eb;
  /* Earth/sky scale matched to the logo's boardwalk tan (#9e9075) and
     sun disc (#bac9dc). */
  --earth-700: #857047;
  --earth-500: #ae9c7a;
  --sky-500:   #7298ca;
  --ink:       #20281f;
  --body:      #3a443a;
  --muted:     #6b766b;
  --line:      #dfe6df;
  --bg:        #ffffff;
  --bg-soft:   #f6f8f5;
  --bg-card:   #ffffff;
  --shadow:    0 1px 2px rgba(20,40,25,.06), 0 8px 24px rgba(20,40,25,.08);
  --shadow-lg: 0 12px 40px rgba(20,40,25,.16);
  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.18;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-900); text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-600);
  margin: 0 0 .6rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .72rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--green-800); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-outline { background: #fff; color: var(--green-800); border-color: var(--line); box-shadow: var(--shadow); }
.btn-outline:hover { border-color: var(--green-500); color: var(--green-900); }

/* ---------- Header / Nav (CSS-only mobile menu) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
}
.brand { display: flex; align-items: center; gap: .65rem; }
.brand img { height: 76px; width: auto; }
.brand b { display: block; color: var(--green-900); font-size: 1.02rem; line-height: 1.1; letter-spacing: -.01em; }
.brand span { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

.nav-toggle, .nav-toggle-label { display: none; }

.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block;
  padding: .5rem .85rem;
  border-radius: 8px;
  color: var(--body);
  font-weight: 600;
  font-size: .95rem;
}
.nav-links a:hover { background: var(--green-100); color: var(--green-900); text-decoration: none; }
.nav-links a.active { color: var(--green-800); background: var(--green-100); }
.nav-links .nav-cta { margin-left: .4rem; }
.nav-links .nav-cta a { background: var(--green-700); color: #fff; }
.nav-links .nav-cta a:hover { background: var(--green-800); }

@media (max-width: 860px) {
  .nav-toggle-label {
    display: inline-flex; flex-direction: column; gap: 5px;
    padding: 10px; cursor: pointer; border-radius: 8px;
  }
  .nav-toggle-label span { width: 24px; height: 2px; background: var(--green-900); border-radius: 2px; transition: .2s; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1rem;
    box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
    transition: max-height .25s ease, opacity .2s ease;
  }
  .nav-links a { padding: .8rem .4rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links .nav-cta { margin: .7rem 0 0; }
  .nav-links .nav-cta a { border-radius: 999px; text-align: center; }
  .nav-toggle:checked ~ .nav-links {
    max-height: 480px; opacity: 1; visibility: visible;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2){ opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background: var(--green-900);
  overflow: hidden;
}
.hero img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .55;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,40,25,.45) 0%, rgba(20,40,25,.78) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto; padding: 5.5rem 1.25rem 5rem;
}
.hero h1 { color: #fff; max-width: 16ch; }
.hero p.lead { font-size: 1.18rem; max-width: 52ch; color: #eef3ec; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero .eyebrow { color: var(--green-500); }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 60ch; margin-bottom: 2.2rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.lead { font-size: 1.1rem; color: var(--body); }

/* ---------- Stat band ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.stat {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.2rem; text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 2rem; color: var(--green-700); line-height: 1; }
.stat span { font-size: .9rem; color: var(--muted); font-weight: 600; }

/* ---------- Card grid ---------- */
.grid { display: grid; gap: 1.3rem; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .media { aspect-ratio: 16/10; overflow: hidden; background: var(--green-100); }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 1.25rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--body); font-size: .96rem; }
.card .more { margin-top: auto; font-weight: 600; color: var(--green-700); }
.card a.cardlink { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.card a.cardlink:hover h3 { color: var(--green-700); }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; align-items: center; }
.split .media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.split.reverse .text { order: 2; }

/* ---------- Map block ---------- */
.mapwrap {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.mapwrap img { border-radius: var(--radius-sm); width: 100%; }

/* ---------- Segment list (trails page) ---------- */
.segment {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.3rem;
  scroll-margin-top: 90px;
}
.segment .seg-head {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, var(--green-100), #fff);
}
.seg-num {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--green-700); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: 1.1rem;
}
.segment .seg-head h3 { margin: 0; }
.segment .seg-head .seg-meta { color: var(--muted); font-size: .88rem; font-weight: 600; }
.segment .seg-body { padding: 1.3rem 1.4rem; }
.segment .seg-body > p:first-child { margin-top: 0; }

.facts {
  list-style: none; margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px dashed var(--line);
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .4rem 1.5rem;
}
.facts li { font-size: .93rem; }
.facts b { color: var(--green-800); }

/* chips / quick nav */
/* Leaflet maps: force a local stacking context so their internal panes/controls
   (z-index up to 1000) never bubble up above the sticky header (z-index: 50). */
.leaflet-container { position: relative; z-index: 0; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 0; }
.chip {
  display: inline-block; flex: none; white-space: nowrap; padding: .42rem .85rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: .88rem; font-weight: 600;
  color: var(--green-800); box-shadow: var(--shadow);
}
.chip:hover { border-color: var(--green-500); text-decoration: none; }

/* ---------- Prose ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }

/* callout */
.callout {
  background: var(--green-100); border: 1px solid #cfe2d2;
  border-left: 5px solid var(--green-600); border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem; margin: 1.4rem 0;
}
.callout p:last-child { margin-bottom: 0; }

.mission-callout { display: flex; align-items: center; gap: 1.6rem; }
.mission-callout img { flex: none; width: 130px; height: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mission-callout p { margin: 0; }
@media (max-width: 640px) {
  .mission-callout { flex-direction: column; align-items: flex-start; }
  .mission-callout img { width: 110px; }
}

/* rules grid */
.rules { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.rules li {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: flex-start;
}
.rules .ic { flex: none; font-size: 1.2rem; line-height: 1.4; }
.rules b { color: var(--ink); display: block; }

/* contact cards */
.contact-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.contact-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow); text-align: center;
}
.contact-card .ic { font-size: 1.6rem; }
.contact-card b { display: block; margin: .4rem 0 .2rem; color: var(--ink); }

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--green-800), var(--green-600));
  color: #fff; border-radius: var(--radius); padding: clamp(2rem,5vw,3.2rem);
  text-align: center; box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #eaf2ea; max-width: 56ch; margin: 0 auto 1.4rem; }
.cta-band .actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #cfe0d2; padding: 3rem 0 1.6rem; }
.site-footer a { color: #eaf3ea; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer .fbrand { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.site-footer .fbrand img { height: 84px; background: #fff; border-radius: 8px; padding: 5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.2rem; font-size: .85rem; color: #a9c2ad; }

/* page header (interior) */
.page-hero {
  position: relative; color: #fff; background: var(--green-800); overflow: hidden;
}
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .4; }
.page-hero::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(20,40,25,.5), rgba(20,40,25,.78)); }
.page-hero .inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 3.6rem 1.25rem; }
.page-hero h1 { color: #fff; margin-bottom: .4rem; }
.page-hero p { color: #e8f0e6; max-width: 56ch; margin: 0; font-size: 1.08rem; }
.breadcrumb { font-size: .85rem; color: #bcd2bf; margin-bottom: .7rem; }
.breadcrumb a { color: #d6e6d8; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split.reverse .text { order: 0; }
  .facts { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
