/* ============================================================
   MULBERRY OBGYN — Master Design System
   This file is the single source of truth for: design tokens,
   reset, base typography, navigation, footer, buttons, and
   shared section utilities. Page-specific layouts live inline
   in each page's <style> block.
   ============================================================ */

/* ----- DESIGN TOKENS ----- */
:root {
  /* Core neutrals */
  --cream:        #FAF7F2;
  --cream-mid:    #F4EFE8;
  --cream-dark:   #F0EBE3;
  --ivory:        #FDFAF6;
  --ivory-mid:    #F7F1E9;
  --ivory-dark:   #EEE6D8;
  --taupe:        #E4DDD3;
  --taupe-mid:    #D4CBBF;
  --taupe-dark:   #C4BAB0;
  --stone:        #E8E2DA;
  --white:        #FFFFFF;

  /* Brand */
  --mulberry:        #7B4D6E;
  --mulberry-light:  #A67D98;
  --mulberry-dark:   #5A3650;
  --mulberry-pale:   #F0E8ED;
  --mulberry-mist:   #E8DCE4;

  --gold:        #C4A265;
  --gold-light:  #D4BA88;
  --gold-pale:   #EAD9BC;

  /* Optional accents (referenced by some pages) */
  --sage:        #A8B4A5;
  --sage-light:  #C5D4C0;
  --sage-pale:   #E8EFE6;
  --sage-deep:   #5C725C;
  --plum:        #6E4870;
  --plum-light:  #9A74A0;
  --plum-dark:   #4A2E50;
  --lavender:        #E8E2EE;
  --lavender-mid:    #D8D0E4;
  --lavender-dark:   #C4BAD4;
  --champagne:       #C7A86D;
  --champagne-light: #DCC094;

  /* Text & ink */
  --charcoal:    #2C2C2C;
  --text:        #3A3A3A;
  --text-light:  #6B6B6B;
  --text-soft:   #8A7E7E;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;

  /* Aliases — legacy short names used by older inline styles.
     Defined as aliases so existing rules using --fd, --fb, --mulberry-l
     keep working without per-page rewrites. */
  --fd:             var(--font-display);
  --fb:             var(--font-body);
  --mulberry-l:     var(--mulberry-light);
  --mulberry-d:     var(--mulberry-dark);
  --gold-l:         var(--gold-light);
  --charcoal-mid:   #3A3535;
  --charcoal-l:     #524E4E;
}

/* ----- RESET ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  font-weight: 300;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; }

/* ----- SKIP TO CONTENT (a11y) ----- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--mulberry);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.08em;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* Ensure pages have a logical landmark even on legacy pages */
main { display: block; }

/* ----- NAVIGATION ----- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.5s ease;
  background: transparent;
}
nav.scrolled {
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0,0,0,0.05);
  padding: 0.8rem 3rem;
}
/* Pages with a non-dark hero start in scrolled state */
nav.solid {
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0,0,0,0.05);
  padding: 0.8rem 3rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.5s;
}
.nav-logo svg { width: 44px; height: 44px; transition: all 0.5s; }
.nav-logo .logo-ring,
.nav-logo .logo-trunk,
.nav-logo .logo-branch { transition: all 0.5s; }
.nav-logo .logo-ring   { stroke: var(--white); }
.nav-logo .logo-trunk  { fill:   var(--white); }
.nav-logo .logo-branch { stroke: var(--white); }
.nav-logo span { color: var(--gold-light); font-weight: 300; margin-left: -0.18em; }

nav.scrolled .nav-logo, nav.solid .nav-logo { color: var(--mulberry-dark); }
nav.scrolled .nav-logo span, nav.solid .nav-logo span { color: var(--mulberry); }
nav.scrolled .nav-logo .logo-ring,
nav.solid    .nav-logo .logo-ring   { stroke: var(--charcoal); }
nav.scrolled .nav-logo .logo-trunk,
nav.solid    .nav-logo .logo-trunk  { fill:   var(--charcoal); }
nav.scrolled .nav-logo .logo-branch,
nav.solid    .nav-logo .logo-branch { stroke: var(--charcoal); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--gold-light);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--gold-light); }
.nav-links a:hover::after { width: 100%; }

/* Active page indicator */
.nav-links a.active,
.nav-links .nav-item-dropdown.active > .nav-dropdown-toggle { color: var(--gold-light); }
.nav-links a.active::after,
.nav-links .nav-item-dropdown.active > .nav-dropdown-toggle::after { width: 100%; }
nav.scrolled .nav-links a.active, nav.solid .nav-links a.active,
nav.scrolled .nav-links .nav-item-dropdown.active > .nav-dropdown-toggle,
nav.solid    .nav-links .nav-item-dropdown.active > .nav-dropdown-toggle { color: var(--mulberry); }
nav.scrolled .nav-links a.active::after, nav.solid .nav-links a.active::after,
nav.scrolled .nav-links .nav-item-dropdown.active > .nav-dropdown-toggle::after,
nav.solid    .nav-links .nav-item-dropdown.active > .nav-dropdown-toggle::after { background: var(--mulberry); }

.nav-links .nav-cta {
  background: var(--gold);
  color: var(--charcoal);
  padding: 0.6rem 1.6rem;
  border-radius: 2px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  transition: all 0.3s ease;
}
.nav-links .nav-cta:hover { background: var(--gold-light); color: var(--charcoal); }
.nav-links .nav-cta::after { display: none; }

nav.scrolled .nav-links a, nav.solid .nav-links a { color: var(--text); }
nav.scrolled .nav-links a:hover, nav.solid .nav-links a:hover { color: var(--mulberry); }
nav.scrolled .nav-links a::after, nav.solid .nav-links a::after { background: var(--mulberry); }
nav.scrolled .nav-cta, nav.solid .nav-cta { background: var(--mulberry-light); color: var(--white); }
nav.scrolled .nav-cta:hover, nav.solid .nav-cta:hover { background: var(--mulberry); color: var(--white); }

/* Nav dropdowns */
.nav-item-dropdown { position: relative; }
.nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(250,247,242,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 12px 40px rgba(0,0,0,0.10);
  border-radius: 3px;
  padding: 0.75rem 0;
  padding-top: 0.85rem;
  list-style: none;
  min-width: 220px;
  z-index: 2000;
}
.nav-sub::before {
  content: '';
  position: absolute;
  top: -0.85rem;
  left: 0; right: 0;
  height: 0.85rem;
}
.nav-sub li a {
  display: block;
  padding: 0.55rem 1.4rem;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: none;
  white-space: nowrap;
  border-bottom: none;
  transition: background 0.2s, color 0.2s;
}
.nav-sub li a:hover { background: var(--cream-dark); color: var(--mulberry); }
.nav-sub li a::after { display: none; }
.nav-item-dropdown:hover .nav-sub { display: block; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  width: 24px; height: 1.5px;
  background: var(--white);
  transition: 0.3s;
}
nav.scrolled .hamburger span, nav.solid .hamburger span { background: var(--charcoal); }

/* ----- BUTTONS ----- */
.btn-primary {
  display: inline-block;
  background: #7A4F68;
  color: var(--white);
  padding: 1rem 2.4rem;
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}
.btn-primary:hover {
  background: #876177;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(123,77,110,0.25);
}
.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--mulberry);
  padding: 1rem 2.4rem;
  border: 1px solid var(--mulberry);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}
.btn-secondary:hover {
  background: var(--mulberry);
  color: var(--white);
}
.btn-cta { /* alias used by location pages */
  display: inline-block;
  background: var(--gold);
  color: var(--charcoal);
  padding: 1rem 2.4rem;
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}
.btn-cta:hover { background: var(--gold-light); }

.btn-cta-outline { /* outlined companion to .btn-cta */
  display: inline-block;
  background: transparent;
  color: var(--mulberry);
  padding: 1rem 2.4rem;
  border: 1px solid var(--mulberry);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}
.btn-cta-outline:hover {
  background: var(--mulberry);
  color: var(--white);
}

/* ----- SECTION UTILITIES ----- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mulberry);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.section-label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.sec-title, .section-title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.2;
}

/* ----- REVEAL ANIMATION ----- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s cubic-bezier(.2,.6,.2,1), transform 0.9s cubic-bezier(.2,.6,.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- FOOTER ----- */
footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.7);
  padding: 5rem 3rem 2rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}
.footer-brand svg { width: 34px; height: 34px; }
.footer-brand span { color: var(--gold-light); font-weight: 300; margin-left: -0.18em; }
.footer-tagline {
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  line-height: 1.8;
  max-width: 360px;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--cream);
  font-weight: 500;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
}
.footer-col a:hover { color: var(--gold-light); }

.footer-bottom {
  max-width: 1280px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-legal a:hover { color: var(--gold-light); }

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) {
  nav { padding: 1rem 2rem; }
  nav.scrolled, nav.solid { padding: 0.7rem 2rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  nav.scrolled, nav.solid { padding: 0.7rem 1.5rem; background: rgba(250,247,242,0.97); }
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--cream);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.4s ease;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    align-items: flex-start;
  }
  .nav-links.open { right: 0; }
  .nav-links a { color: var(--text); }
  .hamburger { display: flex; }
  .nav-sub {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--cream-dark);
    padding: 0.25rem 0 0.25rem 1rem;
    display: none;
  }
  .nav-item-dropdown.open .nav-sub { display: block; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; text-align: left; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  footer { padding: 4rem 1.5rem 2rem; }
}

/* ----- REDUCED MOTION (a11y) ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ----- MOBILE READABILITY (a11y) -----
   Bump decorative tiny text (eyebrows, breadcrumbs, labels) to a
   readable size on phones. Targets any class containing the words
   'eyebrow', 'breadcrumb', or '-label' regardless of the BEM prefix. */
@media (max-width: 768px) {
  [class*="eyebrow"],
  [class*="breadcrumb"],
  [class*="-label"],
  .hero-badge {
    font-size: 0.74rem !important;
    line-height: 1.5 !important;
  }
}

/* ===== A11y: improve readability on dark/mulberry/charcoal backgrounds ====
   Targets ONLY classes that are reliably on dark backgrounds. .hero-sub /
   .hero-supporting are NOT included because some pages (Flushing) put them
   on a light cream hero where white would be invisible.

   Rule of thumb: opacity 0.78 minimum for paragraph body text on dark bg. */
.wp-body p, .wp-pillar p,
.sp-pillar p,
.pp-body p, .pp-pillar-text,
.proc-phil p, .proc-phil li,
.trust p,
.member-bridge p, .member-bridge-body p,
.footer-tagline {
  color: rgba(255,255,255,0.82) !important;
}

/* Italic accents inside known DARK section containers only.
   This is the safe version — won't bleed into light-cream pages. */
.proc-phil em,
.trust em,
.member-bridge em,
.osteo-sec .sec-heading em,
.wp-heading em,
.diff-heading em,
.dp-heading em,
.sp-heading em,
.lt-heading em {
  color: rgba(255,255,255,0.7) !important;
}

/* Dim eyebrow labels on dark hero — bump opacity */
.lt-eyebrow,
.proc-phil .pp-eyebrow,
.hero-breadcrumb {
  color: rgba(255,255,255,0.72) !important;
}

/* Slightly stronger weight on hero subheads for legibility on dark hero. */
.wp-body p, .sp-body p, .pp-body p, .proc-phil p {
  font-weight: 350;
}
