/* =========================================================
   ZA Physio & Pain Management Clinic — Design System
   Dr. Zunash Ahmad — Physiotherapist, Spine Specialist
   Palette derived from the clinic's real logo (navy/cyan blue,
   charcoal) extended with a warm amber accent + warm off-white,
   to move away from the flat "hospital blue" look most local
   competitors use, while staying true to the real brand mark.
   ========================================================= */

:root {
  /* ---- Color tokens (light, default) ---- */
  /* --color-navy / --color-navy-deep are the FIXED brand-navy surface
     colors used as backgrounds for dark sections (hero, footer, CTA
     bands). They never change with theme — those sections carry their
     own light text regardless of light/dark mode. */
  --color-navy: #12305C;          /* primary — from logo dark blue */
  --color-navy-deep: #0B2445;     /* darker navy for hover/depth */
  /* --color-link is the theme-AWARE brand-blue used for text/borders/
     icons sitting directly on the page body background (nav links,
     buttons, focus states) — this is the one that brightens in dark
     mode so it stays legible on a dark page background. */
  --color-link: #12305C;
  --color-cyan: #2E86D8;          /* secondary — from logo gradient */
  --color-cyan-light: #5FA8E8;
  --color-ink: #1E2430;           /* charcoal text — from logo */
  --color-amber: #D98A3D;         /* warm accent — CTAs, highlights */
  --color-amber-deep: #B96E28;
  --color-bg: #FAF7F1;            /* warm off-white page background */
  --color-surface: #EEF3F8;       /* pale blue-tint card background */
  --color-surface-warm: #F3ECE0;  /* warm sand card background (alt sections) */
  --color-border: #DDE3EA;
  --color-white: #FFFFFF;
  --color-muted: #5B6472;

  /* Shadows — warm-toned, never pure black */
  --shadow-sm: 0 1px 3px rgba(30, 36, 48, 0.08);
  --shadow-md: 0 6px 20px rgba(18, 48, 92, 0.12);
  --shadow-lg: 0 16px 40px rgba(18, 48, 92, 0.16);

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

  /* Spacing rhythm */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 7rem;

  /* Layout */
  --container-w: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Dark theme overrides (OS preference) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #14181F;
    --color-surface: #1B2230;
    --color-surface-warm: #211C16;
    --color-ink: #EDEEF1;
    --color-muted: #A7AEBB;
    --color-border: #2A3140;
    --color-white: #1B2230;
    --color-link: #7FBCF0;
    --color-cyan: #4FA0E8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

/* ---- Manual theme toggle overrides (wins over OS pref) ---- */
:root[data-theme="dark"] {
  --color-bg: #14181F;
  --color-surface: #1B2230;
  --color-surface-warm: #211C16;
  --color-ink: #EDEEF1;
  --color-muted: #A7AEBB;
  --color-border: #2A3140;
  --color-white: #1B2230;
  --color-link: #7FBCF0;
  --color-cyan: #4FA0E8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  --color-bg: #FAF7F1;
  --color-surface: #EEF3F8;
  --color-surface-warm: #F3ECE0;
  --color-ink: #1E2430;
  --color-muted: #5B6472;
  --color-border: #DDE3EA;
  --color-white: #FFFFFF;
  --color-link: #12305C;
  --color-cyan: #2E86D8;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 var(--space-sm); line-height: 1.15; font-weight: 600; }
p { margin: 0 0 var(--space-sm); }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* Visible focus states — accessibility baseline */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-amber);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
}
@media (max-width: 768px) {
  .section { padding: var(--space-xl) 0; }
}
.section--surface { background: var(--color-surface); }
.section--warm { background: var(--color-surface-warm); }
.section--navy {
  background: linear-gradient(160deg, var(--color-navy-deep), var(--color-navy) 65%);
  color: #F3F6FA;
  position: relative;
  overflow: hidden;
}
.section--navy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 85% 20%, rgba(217, 138, 61, 0.18), transparent 70%);
  pointer-events: none;
}
.section--navy h2, .section--navy h3 { color: #fff; }
.section--navy .muted { color: rgba(243, 246, 250, 0.75); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-amber-deep);
  margin-bottom: var(--space-xs);
}
.section--navy .eyebrow { color: var(--color-amber); }

.section-head { max-width: 640px; margin: 0 0 var(--space-lg); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.muted { color: var(--color-muted); }

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-amber);
  color: #201205;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-amber-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.5);
  color: inherit;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  border-color: var(--color-link);
  color: var(--color-link);
}
.btn-outline:hover { background: var(--color-link); color: #fff; transform: translateY(-2px); }
.btn-text {
  padding: 0;
  border: none;
  color: var(--color-link);
  font-weight: 600;
  position: relative;
}
.btn-text::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.btn-text:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-border);
  background: var(--color-bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-link);
}
.brand img { height: 64px; width: auto; }
.brand-text small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); }

.nav-desktop { display: flex; align-items: center; gap: var(--space-lg); }
.nav-links { display: flex; gap: var(--space-md); }
.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.3rem 0;
  color: var(--color-ink);
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--color-amber);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-links a[aria-current="page"] { color: var(--color-link); font-weight: 700; }

.header-cta { display: flex; align-items: center; gap: var(--space-sm); }
.header-phone { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--color-link); font-size: 0.95rem; }
.header-phone svg { flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none; border: none; padding: 0.5rem;
  color: var(--color-link);
}
.nav-toggle svg { width: 28px; height: 28px; }

/* Mobile nav drawer */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--color-bg);
  display: flex; flex-direction: column;
  padding: var(--space-md);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  visibility: hidden;
}
.mobile-drawer.is-open { transform: translateX(0); visibility: visible; }
.mobile-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); }
.mobile-drawer-close { background: none; border: none; color: var(--color-link); padding: 0.5rem; }
.mobile-drawer-close svg { width: 28px; height: 28px; }
.mobile-drawer nav { display: flex; flex-direction: column; gap: var(--space-sm); }
.mobile-drawer nav a { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; padding: 0.4rem 0; }
.mobile-drawer-footer { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-sm); }

@media (max-width: 900px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  color: #F3F6FA;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-bg::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(11, 36, 69, 0.88) 0%, rgba(11, 36, 69, 0.78) 45%, rgba(18, 48, 92, 0.92) 100%);
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(700px 400px at 80% 10%, rgba(217, 138, 61, 0.22), transparent 65%);
}
.hero .container { position: relative; z-index: 3; padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.hero-content { max-width: 640px; }
.hero-content .eyebrow { color: var(--color-amber); }
.hero-content p.lede { font-size: 1.15rem; color: rgba(243, 246, 250, 0.88); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-md); }
.hero-badges { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-lg); }
.hero-badge { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: rgba(243, 246, 250, 0.85); }
.hero-badge svg { color: var(--color-amber); flex-shrink: 0; }

/* ---- Cards ---- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.icon-badge {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
  color: var(--color-link);
  margin-bottom: var(--space-sm);
}
.section--navy .icon-badge { background: rgba(255,255,255,0.1); color: var(--color-amber); }

.service-card img { border-radius: var(--radius-sm); margin-bottom: var(--space-sm); aspect-ratio: 4/3; object-fit: cover; }

/* ---- Testimonial ---- */
.testimonial-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.testimonial-stars { color: var(--color-amber); display: flex; gap: 2px; margin-bottom: var(--space-xs); }
.testimonial-source { display: flex; align-items: center; gap: 0.6rem; margin-top: var(--space-sm); font-size: 0.85rem; color: var(--color-muted); }

/* ---- Two column layout ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: var(--space-lg); } }
.split img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* ---- Stats ---- */
.stat-row { display: flex; flex-wrap: wrap; gap: var(--space-lg); }
.stat-num { font-family: var(--font-display); font-size: 2.4rem; color: var(--color-amber); font-weight: 700; }
.stat-label { font-size: 0.85rem; color: rgba(243,246,250,0.75); }

/* ---- Map ---- */
.map-box { height: 360px; position: relative; overflow: hidden; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.map-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Forms ---- */
.form-grid { display: grid; gap: var(--space-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; }
input, textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-ink);
  transition: border-color 0.2s var(--ease);
}
input:focus, textarea:focus, select:focus { border-color: var(--color-link); outline: none; }
.form-msg {
  display: none;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: var(--space-sm);
}
.form-msg.is-visible { display: block; }
.form-msg--success { background: #E9F3EA; color: #2A5A32; border: 1px solid #B9DABF; }

/* ---- FAQ ---- */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  background: none; border: none; text-align: left;
  padding: var(--space-sm) 0;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  color: var(--color-ink);
}
.faq-q svg { flex-shrink: 0; transition: transform 0.3s var(--ease); color: var(--color-amber-deep); }
.faq-item[data-open="true"] .faq-q svg { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
  color: var(--color-muted);
}
.faq-a-inner { padding-bottom: var(--space-sm); }
.faq-item[data-open="true"] .faq-a { max-height: 400px; }

/* ---- Footer ---- */
.site-footer { background: var(--color-navy-deep); color: rgba(243,246,250,0.85); padding: var(--space-xl) 0 var(--space-md); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-lg); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: var(--space-sm); }
.footer-brand img { height: 56px; filter: brightness(0) invert(1); }
.footer-brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff; }
.footer-col h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--space-sm); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a:hover { color: var(--color-amber); }
.footer-social { display: flex; gap: 0.75rem; margin-top: var(--space-sm); }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; transition: background 0.25s var(--ease); }
.footer-social a:hover { background: var(--color-amber); color: #201205; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: var(--space-lg); padding-top: var(--space-md); display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: space-between; font-size: 0.85rem; color: rgba(243,246,250,0.6); }

/* ---- Scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.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; left: -999px; top: 0; z-index: 999;
  background: var(--color-navy); color: #fff; padding: 0.75rem 1.25rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.badge-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--color-surface);
  color: var(--color-link);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.page-hero {
  padding: calc(var(--space-2xl) + 2rem) 0 var(--space-xl);
  background: var(--color-navy-deep);
  color: #F3F6FA;
  position: relative;
  overflow: hidden;
}
.page-hero-bg { position: absolute; inset: 0; z-index: 0; }
.page-hero-bg img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero-bg::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(160deg, rgba(6, 20, 41, 0.92), rgba(11, 36, 69, 0.86) 70%);
}
.page-hero-bg::after {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(600px 300px at 85% 0%, rgba(217, 138, 61, 0.22), transparent 65%);
}
.page-hero .container { position: relative; z-index: 3; }
.breadcrumb { font-size: 0.85rem; color: rgba(243,246,250,0.7); margin-bottom: var(--space-sm); }
.breadcrumb a:hover { color: var(--color-amber); }
