/* ─────────────────────────────────────────────────────────────────────
   JBSG Shared Stylesheet — Skeleton Framework
   ─────────────────────────────────────────────────────────────────────
   Universal CSS that all per-category skeletons reference. Locks
   layout proportions, typography scale, spacing rhythm, and component
   patterns so individual builds can't drift.

   Per-org theming swaps these CSS variables (substituted at build time):
     #1E3A5F, #142840, #A8895C,
     #E8DCC4, #FBF7F0, #F2EBDC,
     #1F2937, #5B6472, #D9CFB8,
     Newsreader, 'Newsreader', Georgia, 'Times New Roman', serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif

   Pages must use ONLY the classes defined here — no inline styles, no
   ad-hoc CSS in <style> tags. The framework owns the look. The skeleton
   owns the structure. Claude owns the content.
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* Theming — injected per org */
  --primary:        #1E3A5F;
  --primary-dark:   #142840;
  --accent:         #A8895C;
  --accent-soft:    #E8DCC4;
  --bg:             #FBF7F0;
  --bg-alt:         #F2EBDC;
  --text:           #1F2937;
  --text-muted:     #5B6472;
  --border:         #D9CFB8;

  --font-display:   'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Locked typography scale */
  --fs-h1:          clamp(2.75rem, 7vw, 5.5rem);
  --fs-h2:          clamp(2rem, 4.5vw, 3.25rem);
  --fs-h3:          clamp(1.35rem, 2.2vw, 1.65rem);
  --fs-h4:          1.125rem;
  --fs-body:        1.0625rem;
  --fs-lede:        clamp(1.15rem, 1.6vw, 1.35rem);
  --fs-small:       0.875rem;
  --fs-eyebrow:     0.78rem;
  --fs-display-xl:  clamp(3.5rem, 9vw, 7rem);

  --lh-display:     1.05;
  --lh-heading:     1.2;
  --lh-body:        1.65;
  --tracking-tight: -0.025em;
  --tracking-wide:  0.08em;

  /* Locked spacing scale */
  --space-1:        0.5rem;
  --space-2:        1rem;
  --space-3:        1.5rem;
  --space-4:        2rem;
  --space-5:        3rem;
  --space-6:        4.5rem;
  --space-7:        6rem;
  --space-8:        8rem;
  --section-py:     clamp(72px, 9vw, 128px);
  --section-py-sm:  clamp(48px, 6vw, 80px);

  /* Locked layout */
  --container:      1180px;
  --container-prose: 64ch;
  --measure:        65ch;

  /* Locked radii / motion */
  --radius-sm:      4px;
  --radius:         8px;
  --radius-lg:      14px;
  --duration:       180ms;
  --ease:           cubic-bezier(0.2, 0.8, 0.2, 1);

  --shadow-sm:      0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow:         0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:      0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
}

/* ── Reset ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a {
  color: var(--primary);
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--primary-dark); }
p { margin: 0 0 var(--space-3); max-width: var(--measure); }
ul, ol { padding-left: 1.25rem; line-height: var(--lh-body); }
li + li { margin-top: 0.4em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }

/* ── Typography ─────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0 0 var(--space-3);
  font-weight: 500;
}
h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-tight);
  font-weight: 400;
}
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-tight);
  font-weight: 500;
}
h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  font-weight: 600;
}
h4 { font-size: var(--fs-h4); font-weight: 600; line-height: var(--lh-heading); }

.lede {
  font-family: var(--font-display);
  font-size: var(--fs-lede);
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 400;
  max-width: var(--measure);
}
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
  display: block;
}
.display-xl {
  font-family: var(--font-display);
  font-size: var(--fs-display-xl);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 400;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
}
.container-prose { max-width: calc(var(--container-prose) + 4rem); }

.section { padding-top: var(--section-py); padding-bottom: var(--section-py); }
.section.compact { padding-top: var(--section-py-sm); padding-bottom: var(--section-py-sm); }
.section.alt  { background: var(--bg-alt); }
.section.dark { background: var(--primary); color: var(--bg); }
.section.dark h1, .section.dark h2, .section.dark h3 { color: var(--bg); }
.section.dark .lede { color: rgba(255,255,255,0.85); }
.section.dark a { color: var(--accent); }

.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  max-width: 48rem;
}
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ── Grids ──────────────────────────────────────────────────────────── */

.grid-3, .grid-4 { display: grid; gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.split-asymmetric {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}
@media (min-width: 768px) {
  .split-asymmetric { grid-template-columns: 5fr 7fr; gap: var(--space-6); }
  .split-asymmetric.flip { grid-template-columns: 7fr 5fr; }
  .split-asymmetric.flip > :first-child { order: 2; }
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.875rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
}
.btn-ghost:hover { color: var(--primary-dark); }

.btn-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 1.125rem 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.btn-phone:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── Hero (used variably across categories) ─────────────────────────── */

.hero {
  padding-top: clamp(72px, 10vw, 144px);
  padding-bottom: clamp(56px, 8vw, 112px);
}
.hero-eyebrow { margin-bottom: var(--space-3); }
.hero-title {
  font-size: var(--fs-display-xl);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin: 0 0 var(--space-4);
  max-width: 16ch;
}
.hero-lede {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 38ch;
  margin: 0 0 var(--space-5);
  font-weight: 400;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.hero-meta {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .hero-meta { grid-template-columns: 1fr 1fr; max-width: 50rem; }
}

/* ── Doorway cards (3-column "how can we help you?") ────────────────── */

.doorways {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-top: var(--space-5);
}
@media (min-width: 768px) {
  .doorways { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
}
.doorway {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all var(--duration) var(--ease);
}
.doorway:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.doorway h3 {
  font-family: var(--font-display);
  margin: 0 0 var(--space-2);
}
.doorway p {
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
  font-size: 1rem;
}
.doorway .doorway-cta {
  margin-top: auto;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  align-self: flex-start;
}

/* ── Programs grid (cards) ──────────────────────────────────────────── */

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.program-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: all var(--duration) var(--ease);
}
.program-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-soft);
}
.program-card h3 { margin: 0 0 var(--space-2); }
.program-card p { color: var(--text-muted); font-size: 0.97rem; margin-bottom: var(--space-3); }

/* ── Callout band ───────────────────────────────────────────────────── */

.callout-band {
  background: var(--accent);
  color: var(--bg);
  padding: var(--space-6) 0;
}
.callout-band h2 { color: var(--bg); margin: 0 0 var(--space-2); max-width: 24ch; }
.callout-band p {
  color: rgba(255,255,255,0.92);
  font-size: var(--fs-lede);
  margin: 0 0 var(--space-3);
  max-width: 50ch;
}
.callout-band .btn-primary { background: var(--bg); color: var(--primary); border-color: var(--bg); }
.callout-band .btn-primary:hover { background: var(--primary-dark); color: var(--bg); border-color: var(--primary-dark); }

/* ── Stat block / pull quote ────────────────────────────────────────── */

.stat-block { text-align: center; padding: var(--space-5) 0; }
.stat-block .stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.stat-block .stat-context { font-size: var(--fs-lede); color: var(--text-muted); max-width: 32ch; margin: 0 auto; }

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.3;
  font-style: italic;
  color: var(--text);
  max-width: 30ch;
  margin: 0;
  position: relative;
  padding-left: 1.2em;
}
.pull-quote::before {
  content: "\201C";
  font-family: var(--font-display);
  font-size: 4em;
  line-height: 1;
  color: var(--accent);
  position: absolute;
  top: -0.2em;
  left: -0.2em;
  opacity: 0.4;
}

/* ── Hours/address block ────────────────────────────────────────────── */

.info-block {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.5;
  color: var(--text);
}
.info-block .info-label {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  display: block;
}

/* ── Header / nav ───────────────────────────────────────────────────── */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  min-height: 64px;
}
.site-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-nav ul {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--duration) var(--ease);
}
.site-nav a:hover { color: var(--primary); }
.site-nav a[aria-current="page"] {
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
}
.site-header .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--primary);
  color: var(--bg);
  padding: var(--space-6) 0 var(--space-4);
  margin-top: var(--space-7);
}
.site-footer h4 {
  font-family: var(--font-display);
  color: var(--bg);
  font-size: 1.15rem;
  margin: 0 0 var(--space-2);
  font-weight: 500;
}
.site-footer p, .site-footer a { color: rgba(255,255,255,0.85); font-size: 0.95rem; }
.site-footer a:hover { color: var(--accent-soft); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}
.footer-meta {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

/* ── Utilities ──────────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--bg);
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: 0; }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Mobile refinements ─────────────────────────────────────────────── */

@media (max-width: 767px) {
  .site-nav ul { gap: var(--space-2); font-size: 0.9rem; }
  .hero { padding-top: var(--space-6); padding-bottom: var(--space-5); }
  .programs-grid { grid-template-columns: 1fr; gap: var(--space-3); }
}
