/* ============================================================
   NONSURGICAL ORTHOPEDICS — Design System
   Palette: "Oxford Powder"
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Brand palette */
  --color-primary:      #142B5E;
  --color-secondary:    #3D567F;
  --color-muted:        #6B7D99;
  --color-accent:       #2563B7;

  /* Conversion CTA (green) */
  --color-cta:          #1D6A3A;
  --color-cta-hover:    #155A30;
  --color-surface:      #DCE5F0;
  --color-background:   #F4F8FC;
  --color-white:        #FFFFFF;
  --color-black:        #0D1B2A;

  /* Semantic aliases */
  --color-text:         var(--color-primary);
  --color-text-light:   var(--color-secondary);
  --color-text-muted:   var(--color-muted);
  --color-link:         var(--color-accent);
  --color-link-hover:   var(--color-primary);
  --color-border:       #E5E7EB;
  --color-border-light: #F0F2F5;
  --color-success:      #2E7D4F;
  --color-warning:      #B8860B;
  --color-danger:       #C0392B;

  /* Shadows */
  --shadow-xs:    0 1px 2px rgba(20, 43, 94, 0.04);
  --shadow-sm:    0 1px 3px rgba(20, 43, 94, 0.06), 0 1px 2px rgba(20, 43, 94, 0.04);
  --shadow-md:    0 4px 12px rgba(20, 43, 94, 0.08), 0 2px 4px rgba(20, 43, 94, 0.04);
  --shadow-lg:    0 8px 24px rgba(20, 43, 94, 0.10), 0 4px 8px rgba(20, 43, 94, 0.05);
  --shadow-xl:    0 16px 48px rgba(20, 43, 94, 0.12), 0 8px 16px rgba(20, 43, 94, 0.06);
  --shadow-glass: 0 8px 32px rgba(20, 43, 94, 0.08);

  /* Glass — preserved only for header */
  --glass-bg:           rgba(255, 255, 255, 0.92);
  --glass-bg-strong:    rgba(255, 255, 255, 0.97);
  --glass-border:       rgba(255, 255, 255, 0.45);
  --glass-blur:         16px;

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* Spacing scale (4px base) */
  --sp-1:   4px;  --sp-2:   8px;  --sp-3:  12px;
  --sp-4:  16px;  --sp-5:  20px;  --sp-6:  24px;
  --sp-8:  32px;  --sp-10: 40px;  --sp-12: 48px;
  --sp-16: 64px;  --sp-20: 80px;  --sp-24: 96px;
  --sp-32: 128px;

  /* Typography */
  --font-sans:   'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.5rem;

  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.6;
  --leading-relaxed: 1.7;

  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-caps:    0.1em;

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;

  /* Layout */
  --container-max:  1200px;
  --container-wide: 1400px;
  --header-height:  80px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--color-link); text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--color-link-hover); }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; border: none; background: none; outline: none; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: var(--leading-tight); }

/* ---- Layout Utilities ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.container--wide { max-width: var(--container-wide); }

.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;
}

/* Section spacing */
.section      { padding-block: var(--sp-20); }
.section--sm  { padding-block: var(--sp-16); }
.section--lg  { padding-block: var(--sp-32); }

/* ---- Typography ---- */
.text-serif  { font-family: var(--font-serif); }
.text-sans   { font-family: var(--font-sans); }
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-light  { color: var(--color-text-light); }

.heading-xl {
  font-family: var(--font-sans);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary);
}
.heading-lg {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary);
}
.heading-md {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-weight: 600;
  color: var(--color-primary);
}
.heading-sm {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
}

.section-eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-2);
}
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--sp-12);
}
.section-header p {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
  margin-top: var(--sp-4);
}

.body-lg { font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--color-text-light); }
.body-sm { font-size: var(--text-sm); line-height: var(--leading-normal); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-weight: 600; font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap; line-height: 1.4;
}
.btn--primary {
  background: var(--color-primary); color: var(--color-white); box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--color-secondary); box-shadow: var(--shadow-md);
  transform: translateY(-1px); color: var(--color-white);
}
.btn--accent {
  background: var(--color-accent); color: var(--color-white); box-shadow: var(--shadow-sm);
}
.btn--accent:hover {
  background: #2E66B8; box-shadow: var(--shadow-md);
  transform: translateY(-1px); color: var(--color-white);
}
.btn--outline {
  border: 1.5px solid var(--color-border); color: var(--color-secondary);
  background: var(--glass-bg); backdrop-filter: blur(8px);
}
.btn--outline:hover {
  border-color: var(--color-accent); color: var(--color-accent);
  background: rgba(58, 120, 212, 0.06);
}
.btn--ghost {
  color: var(--color-accent); padding: var(--sp-2) var(--sp-4);
}
.btn--ghost:hover { background: rgba(58, 120, 212, 0.08); }
.btn--lg { padding: var(--sp-4) var(--sp-8); font-size: var(--text-base); }
.btn--sm { padding: var(--sp-2) var(--sp-4); font-size: var(--text-xs); min-height: 44px; }

.btn--cta {
  background: var(--color-cta); color: var(--color-white);
  border-radius: var(--radius-full); padding: var(--sp-3) var(--sp-8);
  font-weight: 600; font-size: var(--text-base); box-shadow: var(--shadow-sm);
  min-height: 44px;
}
.btn--cta:hover {
  background: var(--color-cta-hover); color: var(--color-white);
  transform: translateY(-1px); box-shadow: var(--shadow-md);
}

.btn--phone {
  background: var(--color-secondary); color: var(--color-white);
  border-radius: var(--radius-full); padding: var(--sp-2) var(--sp-5);
  font-size: var(--text-sm); box-shadow: var(--shadow-sm);
}
.btn--phone:hover { background: var(--color-primary); color: var(--color-white); box-shadow: var(--shadow-md); }
.btn--phone svg { width: 16px; height: 16px; }

/* ---- Cards ---- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-normal) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-accent); }
.card--glass {
  background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-glass);
}
.card--glass:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card--flat { box-shadow: none; }

/* ---- Grid helpers ---- */
.grid { display: grid; gap: var(--sp-6); }
.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: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

/* ---- Breadcrumbs ---- */
.breadcrumb {
  display: none;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb__sep { color: var(--color-border); font-size: var(--text-xs); margin-inline: var(--sp-1); }
.breadcrumb__current { color: var(--color-text-light); font-weight: 500; }

/* ---- Divider ---- */
.divider { border: none; border-top: 1px solid var(--color-border-light); margin-block: var(--sp-8); }

/* ---- Badge ---- */
.badge {
  display: inline-block; padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full); font-size: var(--text-xs);
  font-weight: 600; letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.badge--accent  { background: rgba(58, 120, 212, 0.10); color: var(--color-accent); }
.badge--muted   { background: rgba(128, 145, 173, 0.10); color: var(--color-muted); }
.badge--success { background: rgba(46, 125, 79, 0.10); color: var(--color-success); }

/* ---- Reviewer Block ---- */
.reviewer-block {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm); color: var(--color-text-light); margin-block: var(--sp-8);
}
.reviewer-block__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-primary); color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--text-sm); flex-shrink: 0;
  border: 2px solid var(--color-white); box-shadow: var(--shadow-xs);
}
.reviewer-block img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--color-white); box-shadow: var(--shadow-xs);
}
.reviewer-block strong { color: var(--color-primary); }
.reviewer-block__details { display: flex; flex-direction: column; gap: 2px; }

/* ---- CTA Banner ---- */
.section:has(.cta-banner) { padding-top: 0; }
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 80%);
  border-radius: var(--radius-xl); padding: var(--sp-16) var(--sp-8);
  text-align: center; color: var(--color-white);
}
.cta-banner h2 { color: var(--color-white); margin-bottom: var(--sp-4); }
.cta-banner p { color: rgba(255, 255, 255, 0.8); max-width: 560px; margin-inline: auto; margin-bottom: var(--sp-6); }
.cta-banner .btn--primary { background: var(--color-white); color: var(--color-primary); }
.cta-banner .btn--primary:hover { background: var(--color-surface); }

/* ---- Medical Disclaimer ---- */
.medical-disclaimer {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-10);
  font-size: var(--text-xs); color: var(--color-text-muted); line-height: var(--leading-relaxed);
}
.medical-disclaimer strong { color: var(--color-text-light); }

/* ---- Skip Link ---- */
.skip-link {
  position: absolute; top: -100%; left: var(--sp-4);
  background: var(--color-primary); color: var(--color-white);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600; z-index: 10000;
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus { top: var(--sp-2); color: var(--color-white); }

/* ---- Focus States ---- */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ---- Print ---- */
@media print {
  .site-header, .site-footer, .mega-menu, .cta-banner { display: none; }
  body { color: #000; background: #fff; }
}

/* ---- KWCO Referral Link ---- */
.kwco-link {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  transition: color var(--duration-fast) var(--ease-out);
}
.kwco-link:hover { color: var(--color-black); text-decoration: none; }