/* ==========================================================================
   Meridian Neuro — main.css
   Palette: Navy #1B3A5C · Teal #0D8B8B · Gold #C4973B
   Type: Instrument Serif (headings) · DM Sans (body) · IBM Plex Mono (labels)
   Mobile-first. Gold restricted to large display type and accents only
   (gold on white fails WCAG AA at body sizes: contrast ~2.6:1).
   ========================================================================== */

:root {
  --navy: #1B3A5C;
  --navy-dark: #132B45;
  --teal: #0D8B8B;
  --teal-dark: #0A6E6E;   /* AA-safe on white for text/links (4.9:1) */
  --gold: #C4973B;
  --ink: #22303E;
  --ink-soft: #4A5A6A;
  --paper: #FFFFFF;
  --paper-warm: #F8F6F1;
  --paper-cool: #F2F6F8;
  --line: #E3E8EC;
  --max-w: 1120px;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

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

h1, h2, h3, .serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  line-height: 1.15;
  color: var(--navy);
}
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: .75rem; }
h3 { font-size: clamp(1.25rem, 3vw, 1.55rem); margin-bottom: .5rem; }
h4 { font-family: 'DM Sans', sans-serif; font-size: 1.05rem; color: var(--navy); margin-bottom: .35rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--teal-dark); }
ul, ol { margin: 0 0 1rem 1.25rem; }
li { margin-bottom: .4rem; }
strong { color: var(--navy); }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  display: block;
  margin-bottom: .8rem;
}
.eyebrow--gold { color: var(--gold); } /* only on navy backgrounds (7:1+) */

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
section { padding: 3.5rem 0; }
@media (min-width: 768px) { section { padding: 5rem 0; } }

.section-alt { background: var(--paper-warm); }
.section-cool { background: var(--paper-cool); }
.section-navy { background: var(--navy); }
.section-navy h2, .section-navy h3, .section-navy p, .section-navy li { color: #fff; }
.section-navy .eyebrow { color: var(--gold); }

.center { text-align: center; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46em; }
.center .lede { margin-left: auto; margin-right: auto; }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-w); margin: 0 auto; padding: .8rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { height: 42px; width: auto; }
.brand-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1.35rem; color: var(--navy); letter-spacing: .01em;
}
.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: .5rem; cursor: pointer;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--navy); transition: .2s; }
.nav-links {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--line);
  flex-direction: column; padding: .5rem 1.25rem 1.25rem;
  list-style: none; margin: 0;
}
.nav-links.open { display: flex; }
.nav-links li { margin: 0; }
.nav-links a {
  display: block; padding: .65rem 0; text-decoration: none;
  color: var(--navy); font-weight: 500; font-size: 1rem;
}
.nav-links a[aria-current="page"] { color: var(--teal-dark); }
.nav-cta {
  background: var(--teal); color: #fff !important; text-align: center;
  border-radius: 999px; padding: .6rem 1.2rem !important; margin-top: .5rem;
}
@media (min-width: 1120px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex; position: static; flex-direction: row; align-items: center;
    gap: 1.4rem; border: 0; padding: 0; background: none;
  }
  .nav-links a { padding: .3rem 0; font-size: .95rem; }
  .nav-cta { margin-top: 0; }
}

/* --- Buttons --- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  border-radius: 999px; padding: .85rem 1.8rem; font-size: 1rem;
  transition: transform .15s, box-shadow .15s; border: 2px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.section-navy .btn-secondary { color: #fff; border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }

/* --- Hero --- */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); padding: 4rem 0; }
.hero h1 { color: #fff; max-width: 15em; }
.hero .tagline {
  font-family: 'IBM Plex Mono', monospace; font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
  margin: 1.2rem 0 .4rem;
}
.hero p { color: #D8E1EA; max-width: 38em; font-size: 1.15rem; }
.hero .btn-secondary { color: #fff; border-color: rgba(255,255,255,.6); }
@media (min-width: 768px) { .hero { padding: 6rem 0; } }

/* --- Cards / grids --- */
.grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem;
}
.card--accent { border-top: 3px solid var(--teal); }
.card--gold { border-top: 3px solid var(--gold); }
.card h3 a { color: var(--navy); text-decoration: none; }
.card h3 a:hover { color: var(--teal-dark); }
.card .card-link { font-weight: 600; text-decoration: none; }

.section-navy .card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); }
.section-navy .card h3, .section-navy .card p { color: #fff; }

/* --- Did You Know module --- */
.didyouknow {
  background: var(--paper-warm); border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1.4rem 1.6rem; margin: 2.5rem 0;
}
.didyouknow .eyebrow { color: var(--navy); margin-bottom: .4rem; }

/* --- Callout / notice --- */
.notice {
  background: var(--paper-cool); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 1.5rem 0;
}
.notice--important { border-left: 4px solid var(--teal); }

/* --- Team --- */
.team-member { text-align: left; }
.team-member .headshot {
  width: 100%; aspect-ratio: 3 / 4; border-radius: var(--radius);
  background: var(--paper-cool); object-fit: cover; margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: .85rem;
}
.team-member .role {
  font-family: 'IBM Plex Mono', monospace; font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--teal-dark);
  display: block; margin: .2rem 0 .6rem;
}

/* --- FAQ --- */
.faq details {
  border-bottom: 1px solid var(--line); padding: 1rem 0;
}
.faq summary {
  font-weight: 600; color: var(--navy); cursor: pointer; font-size: 1.05rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::after { content: "+"; color: var(--teal-dark); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: .8rem; color: var(--ink-soft); }

/* --- Forms / embeds --- */
.form-shell {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: 0 8px 30px rgba(27,58,92,.08);
}
.form-shell .form-note { font-size: .85rem; color: var(--ink-soft); margin-top: .8rem; }

/* --- LP hero split --- */
.lp-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); padding: 3rem 0 3.5rem; }
.lp-hero h1 { color: #fff; }
.lp-hero p { color: #D8E1EA; }
.lp-hero-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .lp-hero-grid { grid-template-columns: 1.15fr .85fr; align-items: start; } }

/* --- Pathways --- */
.pathway { counter-reset: none; }
.pathway .path-label {
  font-family: 'IBM Plex Mono', monospace; font-size: .75rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
}

/* --- Footer --- */
.site-footer { background: var(--navy-dark); color: #C9D4DE; padding: 3rem 0 2rem; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: .8rem; }
.site-footer ul { list-style: none; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-brand { font-family: 'Instrument Serif', serif; font-size: 1.4rem; color: #fff; }
.footer-tagline { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: .5rem 0 1rem; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .82rem; color: #9FB0C0; }

/* --- Utility --- */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.small { font-size: .88rem; color: var(--ink-soft); }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: .6rem 1rem; z-index: 200;
}
.skip-link:focus { left: 0; }

/* --- Interim scheduling slot (until GHL embed is installed) --- */
.ghl-slot {
  background: var(--paper-cool);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1.4rem;
}
.ghl-slot .btn-row { margin-top: 1rem; }

/* --- Fix: the form card sits on a light background *inside* the dark hero,
   so it must not inherit the hero's pale body colour. Specificity must beat
   `.lp-hero p`. --- */
.lp-hero .form-shell p,
.lp-hero .form-shell li,
.form-shell .ghl-slot p { color: var(--ink); }
.lp-hero .form-shell .form-note { color: var(--ink-soft); }
.form-shell .ghl-slot strong { color: var(--navy); }

/* --- Dropdown sub-navigation (hub & spoke) ---------------------------------
   Mobile-first: children render as an indented sub-list, always visible.
   Desktop (>=960px): children become a hover/focus dropdown.
   focus-within keeps it keyboard-accessible without JS. */
.nav-links .subnav { list-style: none; margin: 0; padding: 0; }
.nav-links .subnav a {
  font-size: .93rem; color: var(--ink-soft); padding-left: 1rem;
}
.nav-links .subnav a[aria-current="page"] { color: var(--teal-dark); }
.sub-caret { display: none; }

@media (min-width: 1120px) {
  .nav-links .has-sub { position: relative; }
  .nav-links .has-sub > a { display: inline-flex; align-items: center; gap: .35rem; }
  .sub-caret {
    display: inline-block; width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; opacity: .55;
  }
  .nav-links .has-sub.is-active > a { color: var(--teal-dark); }
  .nav-links .subnav {
    position: absolute; top: 100%; left: -1rem; min-width: 230px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(27,58,92,.12);
    padding: .4rem 0; opacity: 0; visibility: hidden;
    transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s;
  }
  .nav-links .has-sub:hover > .subnav,
  .nav-links .has-sub:focus-within > .subnav {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .nav-links .subnav a {
    padding: .55rem 1.1rem; white-space: nowrap; color: var(--navy); font-size: .92rem;
  }
  .nav-links .subnav a:hover { background: var(--paper-cool); color: var(--teal-dark); }
}


/* Headshots are portrait (340x510). Keep faces in frame and top-weighted. */
.team-member .headshot { object-position: 50% 22%; }
.card .headshot { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 22%; }

/* --- Photography -----------------------------------------------------------
   Every image carries explicit width/height so the browser reserves space
   before load — this is what keeps CLS under the 0.1 target. */
.media { margin: 0; }
.media img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius);
  background: var(--paper-cool);
}
.media figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: .85rem; line-height: 1.5;
}
.media--band { margin: 2.5rem 0 0; }
.media--band img { box-shadow: 0 18px 50px rgba(27,58,92,.16); }

/* image beside text */
.media-split { display: grid; gap: 2rem; align-items: center; margin-top: 2rem; }
@media (min-width: 820px) { .media-split { grid-template-columns: 1fr 1fr; } }
.media-stack { display: grid; gap: 1.25rem; }

/* --- Contact form ---------------------------------------------------------- */
.form-lead { font-size: .95rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.mn-form label {
  display: block; font-size: .85rem; font-weight: 600; color: var(--navy);
  margin: .9rem 0 .3rem;
}
.mn-form label span { color: var(--teal-dark); }
.mn-form input, .mn-form select, .mn-form textarea {
  width: 100%; font: inherit; font-size: .98rem; color: var(--ink);
  padding: .7rem .85rem; border: 1px solid #C9D6E0; border-radius: 8px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.mn-form textarea { resize: vertical; min-height: 120px; }
.mn-form input:focus, .mn-form select:focus, .mn-form textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,139,139,.16);
}
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-note { font-size: .82rem; color: var(--ink-soft); margin: .9rem 0 1.2rem; line-height: 1.55; }
.mn-form .btn { width: 100%; border: 0; cursor: pointer; }
/* honeypot — off-screen, never shown to people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alt {
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  text-align: center;
}
.form-alt .small { margin-bottom: .7rem; }
.form-alt .btn { width: 100%; }

.form-flash {
  border-radius: 8px; padding: .95rem 1.1rem; margin-bottom: 1.2rem;
  font-size: .92rem; line-height: 1.55;
}
.form-flash strong { display: block; margin-bottom: .2rem; }
.form-flash--ok  { background: #E8F3F3; border: 1px solid var(--teal); color: var(--ink); }
.form-flash--err { background: #FBF0E6; border: 1px solid var(--gold); color: var(--ink); }

/* --- Click-to-call in the header. Calling is the primary path to care, so the
   number is visible on every page and every screen size, not buried. --- */
.nav-phone {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-left: auto; margin-right: .75rem;
  font-weight: 700; font-size: .95rem; color: var(--navy);
  text-decoration: none; white-space: nowrap;
}
.nav-phone:hover { color: var(--teal-dark); }
.nav-phone-icon {
  width: 15px; height: 15px; flex: 0 0 15px;
  background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 006.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.2.4 2.4.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 013 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.4 0 .8-.2 1l-2.3 2.2z'/%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 006.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.2.4 2.4.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 013 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.4 0 .8-.2 1l-2.3 2.2z'/%3E%3C/svg%3E");
}
@media (max-width: 420px) { .nav-phone { font-size: .88rem; margin-right: .5rem; } }
@media (min-width: 960px) { .nav-phone { margin-left: 0; margin-right: 1rem; order: 99; } }

/* --- Utility bar: the phone number, on every page, above everything else.
   Calling is the primary route to care, so it gets its own row rather than
   competing for space in the nav. --- */
.topbar { background: var(--navy); color: #D8E1EA; font-size: .82rem; }
.topbar-inner {
  max-width: 1340px; margin: 0 auto; padding: .4rem 1.25rem;
  display: flex; align-items: center; justify-content: flex-end; gap: 1.25rem;
}
.topbar-hours {
  font-family: 'IBM Plex Mono', monospace; font-size: .7rem;
  letter-spacing: .08em; text-transform: uppercase; color: #9FB0C0;
}
.topbar-phone {
  display: inline-flex; align-items: center; gap: .42rem;
  color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap;
}
.topbar-phone:hover { color: var(--gold); }
@media (max-width: 620px) {
  .topbar-hours { display: none; }
  .topbar-inner { justify-content: center; padding: .45rem 1rem; }
  .topbar-phone { font-size: .95rem; }
}

/* Brand lockup stays on one line; the nav row wraps labels as originally designed. */
.brand { flex: 0 0 auto; }
.brand-name { white-space: nowrap; }

/* Breathing room between the brand lockup and the first nav link, without
   pushing the row wide enough to overflow at the 1100px breakpoint. */
@media (min-width: 1120px) { .nav-bar { gap: .75rem; } }
@media (min-width: 1240px) { .nav-bar { gap: 1.5rem; } }

/* Tightest desktop band: trim padding/gap so the nav never overflows right at
   the point the horizontal layout takes over. */
@media (min-width: 1120px) and (max-width: 1239px) {
  .nav-bar { gap: .5rem; padding-left: .9rem; padding-right: .9rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: .9rem; }
}
