/* ==========================================================================
   Brentwood Fairfax — shared styles
   Tokens from stitch DESIGN.md (Eclectic Minimalism with Organic Warmth)
   ========================================================================== */

:root {
  /* Color */
  --cream: #fdfcf0;
  --surface: #fbfaee;
  --surface-low: #f5f4e8;
  --surface-container: #efeee3;
  --surface-high: #e9e9dd;
  --surface-dim: #dbdbcf;
  --ink: #1a1c1e;
  --on-surface-variant: #42474e;
  --primary: #00375a;
  --primary-container: #184e77;
  --gem-deep: #0c3f6b;
  --gem-mid: #168aad;
  --green: #416920;
  --green-bright: #b5e48c;
  --green-container: #c1f197;
  --orange: #f4a261;
  --tertiary: #753b00;
  --outline: #c2c7cf;
  --card-shadow: 0 8px 24px rgba(24, 78, 119, 0.08);

  /* Type — Option 5: Bricolage Grotesque + Source Sans 3 */
  --font-head: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  /* Layout */
  --container: 1280px;
  --section-pad: 120px;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

/* Dark mode */
[data-theme='dark'] {
  --cream: #23251c;
  --surface: #1b1c15;
  --surface-low: #20221a;
  --surface-container: #282a20;
  --surface-high: #32342a;
  --surface-dim: #3c3e33;
  --ink: #f2f1e5;
  --on-surface-variant: #b8bdaa;
  --primary: #9ccbfb;
  --gem-deep: #0c2c48;
  --outline: #5a5f55;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme='dark'] body { color-scheme: dark; }
[data-theme='dark'] a { color: #9ccbfb; }
[data-theme='dark'] .chip.blue { background: #124a73; color: #cfe5ff; }
[data-theme='dark'] .chip { background: #2a5007; color: #c1f197; }
[data-theme='dark'] .chip.orange { background: #6f3800; color: #ffdcc4; }
[data-theme='dark'] .site-header .bar { background: rgba(27, 28, 21, 0.92); }
[data-theme='dark'] .btn-light { background: #f2f1e5; color: #00375a; }
[data-theme='dark'] .form-field input,
[data-theme='dark'] .form-field textarea { background: #2e3026; color: var(--ink); }
[data-theme='dark'] .event-date .day { color: #9ccbfb; }
[data-theme='dark'] .filter-btn.active { background: var(--green); color: #fff; }
[data-theme='dark'] .img-placeholder { color: #9aa08d; }

/* 508/WCAG AA contrast: brand green is too dark on dark surfaces — use the light green */
[data-theme='dark'] .eyebrow,
[data-theme='dark'] .site-footer .col-title,
[data-theme='dark'] .event-date .mon,
[data-theme='dark'] .trail-key .len { color: #a6d47e; }

[data-theme='dark'] details.faq summary::after { color: #ffb780; }
[data-theme='dark'] .map-frame iframe { filter: brightness(0.9); }

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--surface-dim);
  border-radius: 9999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.theme-toggle svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; }
.theme-toggle .icon-moon { display: none; }
[data-theme='dark'] .theme-toggle .icon-sun { display: none; }
[data-theme='dark'] .theme-toggle .icon-moon { display: block; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  color: var(--ink);
  background: var(--surface);
}

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

a { color: var(--primary-container); }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--primary); }

h1 { font-size: 48px; line-height: 56px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 32px; line-height: 40px; font-weight: 700; }
h3 { font-size: 24px; line-height: 32px; font-weight: 600; }
h4 { font-size: 20px; line-height: 28px; font-weight: 600; }

/* Sans headlines: accent words go orange instead of italic.
   On light surfaces use the darker burnt orange for WCAG AA contrast;
   the bright sunset orange passes on dark/blue backgrounds. */
h1 em, h2 em, .accent-italic { font-style: normal; }
.accent-italic { color: #9a4a00; }
[data-theme='dark'] .accent-italic { color: var(--orange); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 64px; }

section { padding: var(--section-pad) 0; }

.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.accent-italic { font-style: italic; color: var(--orange); }

/* Hand-drawn underline accent */
.underline-accent { position: relative; white-space: nowrap; }
.underline-accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M1 6 C 20 2, 45 7, 65 4 S 95 3, 99 5' stroke='%23f4a261' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding: 0 24px;
}

.site-header .bar {
  max-width: var(--container);
  margin: 0 auto;
  background: rgba(253, 252, 240, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--surface-high);
  border-radius: 9999px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand svg { width: 34px; height: 34px; }

.brand img { height: 44px; width: auto; display: block; }
.brand .logo-reverse { display: none; }
[data-theme='dark'] .brand .logo-color { display: none; }
[data-theme='dark'] .brand .logo-reverse { display: block; }

.brand span {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
}

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.nav-links a:hover { color: var(--primary-container); }
.nav-links a.active { color: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary-container); color: #fff; }
.btn-primary:hover { background: var(--primary); }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #2a5007; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--orange);
}
.btn-outline:hover { background: rgba(244, 162, 97, 0.12); }

.btn-light { background: var(--cream); color: var(--primary); }

.bar-actions { display: flex; align-items: center; gap: 16px; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle svg { width: 28px; height: 28px; stroke: var(--primary); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  margin: 24px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
  background: linear-gradient(160deg, var(--gem-deep) 0%, var(--primary-container) 55%, var(--gem-mid) 130%);
}

/* Hero photos are real <img> elements (reliable across browsers) */
.hero .hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .photo-night { display: none; }
[data-theme='dark'] .hero .photo-day { display: none; }
[data-theme='dark'] .hero .photo-night { display: block; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(12, 63, 107, 0.82) 0%, rgba(12, 63, 107, 0.45) 55%, rgba(12, 63, 107, 0.15) 100%);
}

/* When a photo is present, keep it dominant — just a light scrim behind the text */
.hero.has-photo::after {
  background: linear-gradient(100deg, rgba(10, 30, 50, 0.62) 0%, rgba(10, 30, 50, 0.28) 55%, rgba(10, 30, 50, 0) 100%);
}

.hero .container { position: relative; z-index: 2; width: 100%; }

.hero h1 { color: #fff; max-width: 640px; }
.hero h1 em { font-style: normal; color: var(--orange); }

.hero p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 480px;
  margin: 24px 0 36px;
}

.hero .actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.section-head p { color: var(--on-surface-variant); margin-top: 8px; }

.card {
  background: var(--cream);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.card:hover { transform: rotate(-1deg) translateY(-4px); }

.card .pad { padding: 28px; }

.card-grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--green-container);
  color: var(--green);
}

.chip.blue { background: #cfe5ff; color: var(--gem-deep); }
.chip.orange { background: #ffdcc4; color: var(--tertiary); }

/* Image placeholder for photos not yet provided */
.img-placeholder {
  background:
    repeating-linear-gradient(45deg, rgba(24, 78, 119, 0.05) 0 12px, transparent 12px 24px),
    linear-gradient(140deg, var(--surface-container) 0%, var(--surface-dim) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  padding: 16px;
}

/* Blob-masked photo */
.blob-mask {
  border-radius: 58% 42% 44% 56% / 52% 48% 52% 48%;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Event list
   -------------------------------------------------------------------------- */
.event-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px 8px;
  border-bottom: 2px dotted var(--orange);
}

.event-date {
  text-align: center;
  background: var(--cream);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius);
  padding: 12px 8px;
  box-shadow: var(--card-shadow);
}

.event-date .mon {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.event-date .day {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.event-meta { font-size: 14px; color: var(--on-surface-variant); margin-top: 6px; }
.event-meta strong { color: var(--ink); }

.event-note { font-size: 15px; color: var(--on-surface-variant); margin-top: 4px; }

/* Filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 32px 0; }

.filter-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 9999px;
  border: 1px solid var(--outline);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}

.filter-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

/* --------------------------------------------------------------------------
   Trail page
   -------------------------------------------------------------------------- */
.stat-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.stat {
  text-align: center;
  padding: 36px 24px;
  background: var(--cream);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.stat .icon-bubble {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container);
  border-radius: 58% 42% 44% 56% / 52% 48% 52% 48%;
}

.stat .icon-bubble svg { width: 30px; height: 30px; stroke: var(--green); }

.stat h3 { margin-bottom: 4px; }
.stat p { color: var(--on-surface-variant); font-size: 15px; }

.trail-key { list-style: none; display: grid; gap: 16px; }
.trail-key.two-col { grid-template-columns: 1fr 1fr; }

.trail-key li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  background: var(--cream);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--card-shadow);
}

.trail-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  margin-top: 4px;
  border: 2px solid rgba(0, 0, 0, 0.15);
}

.trail-key h4 { color: var(--primary); }
.trail-key .len { font-size: 14px; color: var(--on-surface-variant); font-weight: 500; }
.trail-key p { font-size: 16px; line-height: 24px; color: var(--on-surface-variant); margin-top: 6px; }

.map-frame {
  background: var(--cream);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 16px;
}

/* 50/50 split: map left, trail key right */
.map-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Crops the GaiaGPS embed's white title/comment panel (rendered below the map) */
.map-crop {
  position: relative;
  overflow: hidden;
  height: 680px;
  border-radius: var(--radius);
}

.map-crop iframe {
  display: block;
  border: none;
  width: 100%;
  height: 1150px; /* 680px visible map + ~470px hidden panel */
}

@media (max-width: 960px) {
  .map-split { grid-template-columns: 1fr; }
  .map-crop { height: 480px; }
  .map-crop iframe { height: 950px; }
}

.trailheads { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.trailheads li {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: #fff;
}

.trailheads .label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}

/* FAQ accordion */
details.faq {
  background: var(--cream);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
  padding: 0 28px;
}

details.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
}

details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; font-size: 26px; color: var(--orange); }
details.faq[open] summary::after { content: '\2013'; }
details.faq .answer { padding: 0 0 24px; color: var(--on-surface-variant); }

/* --------------------------------------------------------------------------
   Dark band sections
   -------------------------------------------------------------------------- */
.band-blue {
  background: var(--primary-container);
  border-radius: var(--radius-xl);
  margin: 0 24px;
  color: #fff;
}

.band-blue h2, .band-blue h3 { color: #fff; }

.band-green {
  background: var(--green);
  border-radius: var(--radius-xl);
  margin: 0 24px;
  color: #fff;
}

.band-green h2 { color: #fff; }

/* Newsletter */
.newsletter { text-align: center; }

.newsletter .mail-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  stroke: #fff;
}

.newsletter form {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

.newsletter input {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 22px;
  min-width: 320px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.newsletter input::placeholder { color: rgba(255, 255, 255, 0.65); }

/* --------------------------------------------------------------------------
   Forms (contact)
   -------------------------------------------------------------------------- */
/* Form container stays light in both light and dark mode */
.form-card {
  background: #fdfcf0;
  color: #1a1c1e;
  border: 2px solid #184e77;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 40px;
}

.form-field { margin-bottom: 24px; }

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 13px 16px;
  border: 1px solid var(--outline);
  border-bottom-width: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fff;
  color: var(--ink);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--green);
}

/* --------------------------------------------------------------------------
   Mailchimp embed (newsletter landing page)
   -------------------------------------------------------------------------- */
.mc-card {
  background: var(--gem-deep);
  border: 2px solid var(--green-bright);
  border-radius: var(--radius-lg);
  padding: 48px;
  color: #fff;
}

#mc_embed_signup h2 {
  color: #fff;
  font-size: 30px;
  margin-bottom: 4px;
}

#mc_embed_signup .indicates-required { font-size: 13px; opacity: 0.8; margin-bottom: 20px; }
#mc_embed_signup .asterisk { color: var(--orange); }

#mc_embed_signup .mc-field-group { margin-bottom: 18px; }

#mc_embed_signup label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.9);
}

#mc_embed_signup input.text,
#mc_embed_signup input.email,
#mc_embed_signup input[type='text'],
#mc_embed_signup input[type='email'],
#mc_embed_signup select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#mc_embed_signup select option { color: #1a1c1e; }

#mc_embed_signup input:focus,
#mc_embed_signup select:focus {
  outline: none;
  border-color: var(--green-bright);
}

#mc_embed_signup .mc-address-fields-group { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { #mc_embed_signup .mc-address-fields-group { grid-template-columns: 1fr; } }

#mc_embed_signup .button,
#mc_embed_signup input[type='submit'] {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  background: var(--gem-mid);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 13px 32px;
  cursor: pointer;
}

#mc_embed_signup input[type='submit']:hover { background: var(--green); }
#mc_embed_signup .response { margin: 12px 0; font-size: 15px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--surface-low); padding: 80px 0 48px; margin-top: 24px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.site-footer h4 { font-family: var(--font-head); color: var(--primary); margin-bottom: 12px; }

.site-footer .col-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }

.site-footer a { color: var(--ink); text-decoration: none; font-size: 15px; }
.site-footer a:hover { color: var(--primary-container); }

.site-footer .tagline { color: var(--on-surface-variant); font-size: 15px; max-width: 320px; }

.site-footer .legal {
  border-top: 1px solid var(--surface-dim);
  padding-top: 24px;
  font-size: 13px;
  color: var(--on-surface-variant);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  :root { --section-pad: 72px; }

  .container { padding: 0 20px; }

  h1 { font-size: 36px; line-height: 44px; }
  h2 { font-size: 28px; line-height: 36px; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--cream);
    border: 1px solid var(--surface-high);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 16px;
  }

  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 12px; }
  .nav-toggle { display: block; }

  .site-header { padding: 0 12px; }
  .site-header .bar { position: relative; }

  .hero { margin: 12px; min-height: 480px; }

  .grid-3, .grid-4, .grid-2, .stat-band, .trailheads, .trail-key.two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  .event-row { grid-template-columns: 80px 1fr; }
  .event-row .event-cta { grid-column: 2; }

  .band-blue, .band-green { margin: 0 12px; }

  .newsletter input { min-width: 0; width: 100%; }
}
