/* =====================================================================
   Stratford Hills Civic Association — Design System (v1 draft)
   Forest greens + James River blues + warm amber, on warm cream.
   Type: Fraunces (headings) + Inter (body/UI).
   All color pairs verified WCAG 2.0 AA (the project target). Build-to-standard (not certified).
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Forest greens (the canopy) */
  --forest-900: #0E2A1F;
  --forest-800: #14392B;
  --forest-700: #1A4936;
  --pine-600:   #1E5C45;
  --pine-500:   #2E7355;
  --sage-100:   #E7EFE9;
  --sage-50:    #F1F6F2;

  /* James River blues (the water) */
  --river-700:  #134E78;
  --river-600:  #1668A0;
  --river-100:  #DCEAF2;

  /* Warm amber (sunlight / autumn) */
  --amber-500:  #E0A437;
  --amber-400:  #E8B863;
  --amber-text: #B9781F;

  /* Neutrals (warm cream) */
  --cream-bg:   #FAF8F5;
  --surface:    #FFFFFF;
  --cream-200:  #EFEAE1;
  --cream-300:  #E2DBCE;

  /* Text */
  --ink:        #1C2B24;
  --ink-muted:  #4A5A52;
  --on-dark:    #FAF8F5;
  --on-dark-muted: #A9BEB2;

  /* Semantic */
  --link:       #1668A0;
  --link-hover: #134E78;
  --success:    #2E7355;
  --danger:     #B23A2E;
  --focus-ring: #E0A437;

  /* Gradients */
  --grad-hero: linear-gradient(160deg, #0E2A1F 0%, #14392B 45%, #134E78 140%);
  --grad-section: linear-gradient(180deg, #FAF8F5 0%, #F1F6F2 100%);
  --grad-amber: linear-gradient(90deg, #E0A437 0%, #E8B863 100%);
  --grad-river: linear-gradient(135deg, #134E78 0%, #1668A0 100%);

  /* Spacing scale (4px base) */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem;
  --space-9: 6rem;  --space-10: 8rem;

  /* Containers */
  --container-max: 1140px;
  --container-narrow: 720px;
  --container-wide: 1280px;

  /* Radius & elevation */
  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(14,42,31,.06), 0 1px 3px rgba(14,42,31,.08);
  --shadow-md: 0 4px 12px rgba(14,42,31,.08), 0 2px 4px rgba(14,42,31,.06);
  --shadow-lg: 0 12px 32px rgba(14,42,31,.12);

  /* Type */
  --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
ul, ol { padding-left: 1.25rem; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; color: var(--forest-800); line-height: 1.15; }
/* Fraunces' ampersand reads poorly at display sizes (roman looks like "@", italic
   like a script glyph). Render heading ampersands in the body font (Inter) for a
   clean, conventional "&" that matches the one used in the footer site-wide. */
.amp { font-family: var(--font-body); font-style: normal; font-weight: inherit; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 2px; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--forest-800); color: var(--on-dark);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: var(--on-dark); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: clamp(1rem, 5vw, 2rem); }
.container-narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section--tint { background: var(--grad-section); }
.section--sage { background: var(--sage-100); }
/* position+overflow so the decorative .hero__bg stays INSIDE this section
   (otherwise it escapes and floats over the section above it). */
.section--dark { position: relative; overflow: hidden; background: var(--grad-hero); color: var(--on-dark); }
.section--dark h2, .section--dark h3 { color: var(--on-dark); }

/* Section heading group */
.eyebrow {
  font-family: var(--font-body); font-size: .8125rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--pine-600);
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: var(--space-3);
}
.section--dark .eyebrow { color: var(--amber-400); }
.eyebrow::before { content: ""; width: 40px; height: 3px; border-radius: 2px; background: var(--grad-amber); }
.section-head { max-width: 680px; margin-bottom: var(--space-7); }
.section-head h2 { font-size: clamp(1.6rem, 2vw + .8rem, 2rem); letter-spacing: -.01em; }
.section-head .lead { margin-top: var(--space-3); }
.lead { font-size: clamp(1.0625rem, 1vw + .9rem, 1.25rem); line-height: 1.6; color: var(--ink-muted); }
.section--dark .lead { color: rgba(250,248,245,.9); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--cream-200);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: var(--space-5); }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand:hover { color: inherit; }
.brand__mark { height: 40px; width: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; color: var(--forest-800); }
.brand__sub { font-size: .625rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); margin-top: 3px; }
/* mobile-first: links + header CTA hidden by default, revealed at desktop width */
.nav__links { display: none; align-items: center; gap: var(--space-6); list-style: none; padding: 0; margin: 0; }
.nav__links a { font-size: .9375rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav__links a:hover { color: var(--pine-600); }
.nav__links a[aria-current="page"] { color: var(--pine-600); border-bottom-color: var(--amber-500); }
.nav .nav__cta { display: none; }
.nav__toggle {
  display: inline-flex; width: 44px; height: 44px; border: 1px solid var(--cream-300);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center; color: var(--forest-800);
}
.nav__toggle svg { width: 22px; height: 22px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body); font-weight: 500; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; min-height: 44px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn-primary { background: var(--pine-600); color: #fff; }
.btn-primary:hover { background: var(--pine-500); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--pine-600); border-color: var(--cream-300); }
.btn-secondary:hover { color: var(--pine-600); border-color: var(--pine-600); background: var(--sage-50); }
.btn-accent { background: var(--amber-500); color: var(--forest-800); font-weight: 600; }
.btn-accent:hover { background: var(--amber-400); color: var(--forest-800); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost-dark { background: rgba(250,248,245,.08); color: var(--on-dark); border-color: rgba(250,248,245,.5); }
.btn-ghost-dark:hover { background: rgba(250,248,245,.16); color: var(--on-dark); border-color: var(--on-dark); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* arrow link */
.arrow-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; color: var(--river-600); }
.arrow-link:hover { color: var(--link-hover); gap: .6rem; }
.arrow-link svg { width: 16px; height: 16px; transition: transform .18s ease; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--grad-hero); color: var(--on-dark); }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__inner { position: relative; z-index: 2; padding-block: clamp(4rem, 10vw, 8rem); max-width: 640px; }
.hero .divider-bar { width: 64px; height: 3px; border-radius: 2px; background: var(--grad-amber); margin-bottom: var(--space-5); }
.hero h1 { color: var(--on-dark); font-size: clamp(2.5rem, 5vw + 1rem, 3.75rem); line-height: 1.05; letter-spacing: -.02em; }
.hero__tagline { font-family: var(--font-head); font-style: italic; font-weight: 400; font-size: clamp(1.1rem, 1.5vw + .8rem, 1.4rem); color: var(--amber-400); margin-bottom: var(--space-4); }
.hero__lead { margin-top: var(--space-5); font-size: clamp(1.0625rem, 1vw + .9rem, 1.25rem); line-height: 1.6; color: rgba(250,248,245,.92); }
.hero .btn-row { margin-top: var(--space-7); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: var(--space-5); }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--cream-200);
  border-radius: var(--radius-md); padding: var(--space-6);
  box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { font-size: 1.375rem; }
.card p { color: var(--ink-muted); }
.card .arrow-link { margin-top: auto; }
.card--link { text-decoration: none; color: inherit; }

/* photo slot (swap for Matt's real images) */
.photo-slot {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  background: var(--grad-section); border: 1px dashed var(--cream-300);
  display: grid; place-items: center; min-height: 180px; color: var(--ink-muted);
  aspect-ratio: 16 / 9;
}
.photo-slot--hero { aspect-ratio: 4 / 3; min-height: 280px; border-color: rgba(250,248,245,.35); background: rgba(250,248,245,.06); }
.photo-slot__label { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: 1rem; }
.photo-slot--hero .photo-slot__label { color: rgba(250,248,245,.7); }
.photo-slot svg { width: 40px; height: 40px; opacity: .5; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }

/* info card with icon */
.info-card { display: flex; flex-direction: column; gap: var(--space-3); }
.info-card__icon { width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--sage-100); display: grid; place-items: center; color: var(--pine-600); }
.info-card__icon svg { width: 28px; height: 28px; }

/* date / tag chip */
.chip {
  display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: var(--radius-sm);
  background: var(--sage-100); color: var(--pine-600);
}
.chip--amber { background: var(--amber-400); color: var(--forest-800); }

/* ---------- Stat / feature band ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-6); text-align: center; }
.stat__num { font-family: var(--font-head); font-weight: 600; font-size: 2.5rem; color: var(--pine-600); line-height: 1; }
.section--dark .stat__num { color: var(--amber-400); }
.stat__label { font-size: .875rem; font-weight: 500; letter-spacing: .02em; color: var(--ink-muted); margin-top: var(--space-2); }
.section--dark .stat__label { color: var(--on-dark-muted); }

/* ---------- Two-column intro ---------- */
.split { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 880px) { .split { grid-template-columns: 1.1fr .9fr; } .split--narrow-media { grid-template-columns: 1.3fr .7fr; } }

/* highlight callout row (boundaries / not an HOA) */
.callouts { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: var(--space-6); }
.callout { background: var(--surface); border: 1px solid var(--cream-200); border-left: 3px solid var(--amber-500); border-radius: var(--radius-sm); padding: var(--space-4) var(--space-5); }
.callout strong { color: var(--forest-800); font-family: var(--font-head); font-weight: 600; }
.callout p { font-size: .9375rem; color: var(--ink-muted); margin-top: .25rem; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-5); }
.form-field { display: grid; gap: .4rem; }
.form-field label { font-size: .875rem; font-weight: 600; color: var(--ink); }
.form-field .req { color: var(--danger); }
.form-field input, .form-field textarea {
  font-family: var(--font-body); font-size: 1.0625rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--cream-300);
  border-radius: var(--radius-sm); padding: .7rem .9rem; min-height: 44px; width: 100%;
}
.form-field textarea { min-height: 130px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--river-600); outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.form-check { display: flex; align-items: flex-start; gap: .65rem; background: var(--sage-50); border: 1px solid var(--cream-200); border-radius: var(--radius-sm); padding: var(--space-4); }
.form-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--pine-600); }
.form-check label { font-weight: 600; color: var(--forest-800); }
.form__note { font-size: .8125rem; color: var(--ink-muted); }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: var(--space-4); border-radius: var(--radius-sm); background: var(--sage-100); color: var(--forest-800); font-weight: 500; border: 1px solid var(--cream-200); }
.form-status.is-error { background: #FBE9E7; color: #8A2B20; border-color: #F3C9C0; }
.form-status[hidden] { display: none; }
.form-card { background: var(--surface); border: 1px solid var(--cream-200); border-radius: var(--radius-md); padding: var(--space-7); box-shadow: var(--shadow-sm); }

/* ---------- Prose / letter ---------- */
.prose { max-width: var(--container-narrow); }
.prose p { margin-bottom: var(--space-5); line-height: 1.75; }
.prose p.first { font-size: 1.25rem; line-height: 1.6; color: var(--ink); }
.prose h2 { font-size: 1.5rem; margin-top: var(--space-8); margin-bottom: var(--space-4); scroll-margin-top: 96px; }
.prose ul { margin-bottom: var(--space-5); }
.prose li { margin-bottom: var(--space-2); line-height: 1.6; }
.prose strong { color: var(--forest-800); }
.pull-quote { font-family: var(--font-head); font-style: italic; font-weight: 400; font-size: 1.5rem; line-height: 1.4; color: var(--forest-700); border-left: 3px solid var(--amber-500); padding: var(--space-2) 0 var(--space-2) var(--space-5); margin: var(--space-7) 0; }
.letter-meta { display: grid; gap: .35rem; padding: var(--space-5); background: var(--sage-50); border: 1px solid var(--cream-200); border-radius: var(--radius-md); margin-bottom: var(--space-7); }
.letter-meta dt { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pine-600); }
.letter-meta dd { color: var(--ink); margin: 0 0 .5rem; }
.toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--space-7); }
.toc a { font-size: .875rem; font-weight: 500; text-decoration: none; color: var(--pine-600); background: var(--sage-100); padding: .4rem .8rem; border-radius: var(--radius-sm); }
.toc a:hover { background: var(--sage-50); color: var(--forest-800); box-shadow: inset 0 0 0 1px var(--cream-300); }
.signature { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--cream-200); color: var(--ink); }

/* page header band */
.page-header { background: var(--grad-hero); color: var(--on-dark); position: relative; overflow: hidden; }
.page-header__inner { position: relative; z-index: 2; padding-block: clamp(3rem, 7vw, 5rem); }
.page-header h1 { color: var(--on-dark); font-size: clamp(2rem, 3vw + 1rem, 2.75rem); letter-spacing: -.015em; }
.page-header .lead { color: rgba(250,248,245,.9); margin-top: var(--space-3); max-width: 640px; }
.page-header .eyebrow { color: var(--amber-400); }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-900); color: var(--on-dark); border-top: 3px solid transparent; border-image: var(--grad-amber) 1; }
.footer-grid { display: grid; gap: var(--space-7); padding-block: var(--space-9); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.footer-col h2 { color: var(--on-dark); font-size: .8125rem; font-family: var(--font-body); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: var(--space-4); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .6rem; }
.footer-col a { color: var(--on-dark); text-decoration: none; }
.footer-col a:hover { color: var(--amber-400); }
.footer-brand .brand__name { color: var(--on-dark); }
.footer-brand .brand__sub { color: var(--on-dark-muted); }
.footer-mission { color: var(--on-dark-muted); margin-top: var(--space-4); max-width: 30ch; font-size: .9375rem; }
.footer-bottom { border-top: 1px solid rgba(250,248,245,.12); padding-block: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; }
.footer-bottom p { color: var(--on-dark-muted); font-size: .8125rem; }
.footer-social { display: flex; gap: .75rem; }
.footer-social a { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; background: rgba(250,248,245,.08); color: var(--on-dark); }
.footer-social a:hover { background: rgba(250,248,245,.16); color: var(--amber-400); }
.footer-social svg { width: 18px; height: 18px; }
.footer-disclaimer { font-size: .8125rem; color: var(--on-dark-muted); line-height: 1.6; margin-top: var(--space-5); max-width: 60ch; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-6 { margin-top: var(--space-6); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Responsive nav (mobile-first) ---------- */
/* Desktop (≥861px): reveal inline links + header CTA, hide the menu button */
@media (min-width: 861px) {
  .nav__links { display: flex; }
  .nav .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
}
/* Mobile (≤860px): the toggled-open menu panel */
@media (max-width: 860px) {
  .nav.is-open .nav__links {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; left: 0; right: 0; top: 72px;
    background: var(--cream-bg); border-bottom: 1px solid var(--cream-200);
    box-shadow: var(--shadow-md); padding: var(--space-3) clamp(1rem,5vw,2rem) var(--space-5);
  }
  .nav.is-open .nav__links a { padding: var(--space-4) 0; font-size: 1.125rem; border-bottom: 1px solid var(--cream-200); }
  .nav.is-open .nav__cta { display: flex; margin-top: var(--space-4); }
  .nav.is-open .nav__cta .btn { width: 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .card:hover, .btn:hover { transform: none; }
}
