/* =======================================================
   TMJCompass — Design System
   ======================================================= */

:root {
  /* Brand colors */
  --color-navy: #14293D;
  --color-navy-dark: #0E1E2E;
  --color-green: #2F9E6E;
  --color-green-dark: #1F7A54;
  --color-green-light: #45C48A;
  --color-teal-bg: #EAF6F2;
  --color-teal-bg-soft: #F4FAF8;
  --color-orange: #F2622E;
  --color-orange-dark: #D94F1E;

  /* Neutrals */
  --color-text: #1c1c1c;
  --color-text-muted: #4a5568;
  --color-bg: #f9fafb;
  --color-white: #ffffff;
  --color-border: #dfe8e8;

  /* Type */
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(20, 41, 61, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 41, 61, 0.10);
  --shadow-lg: 0 16px 40px rgba(20, 41, 61, 0.14);

  --nav-height: 70px;
}

/* ======================= RESET ======================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-navy);
  line-height: 1.25;
}

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

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ======================= NAVBAR ======================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 40px);
  height: var(--nav-height);
  background-color: var(--color-navy);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar-left .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-logo-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.navbar-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  white-space: nowrap;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
}

.navbar-right a:not(.donation) {
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 8px 4px;
  position: relative;
  transition: color 0.2s;
}

.navbar-right a:not(.donation)::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  height: 2px;
  background: var(--color-green-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.navbar-right a:not(.donation):hover {
  color: #fff;
}

.navbar-right a:not(.donation):hover::after,
.navbar-right a.active::after {
  transform: scaleX(1);
}

/* Hamburger */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.navbar-toggle .bar {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.navbar-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open .bar:nth-child(2) { opacity: 0; }
.navbar-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ======================= HERO ======================= */
.hero {
  background: linear-gradient(180deg, var(--color-teal-bg) 0%, var(--color-teal-bg-soft) 100%);
  padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 40px) clamp(36px, 6vw, 56px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 700px;
  margin: 0 auto;
}

.hero-logo {
  max-width: 110px;
  width: 100%;
  height: auto;
  margin: 0 auto var(--space-2);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-green-dark);
  background: rgba(46, 139, 87, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

/* ======================= CONTAINER ======================= */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5) 0;
}

.container-narrow {
  width: 92%;
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-5) 0;
}

/* ======================= BLOG SEARCH ======================= */
.blog-search {
  max-width: 480px;
  margin: 0 auto var(--space-4);
  position: relative;
}

.blog-search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 18px 12px 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px center;
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search input:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(47, 158, 110, 0.15);
}

.blog-no-results {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-4) 0;
  display: none;
}

/* ======================= SPECIALIST SEARCH ======================= */
.specialist-search-box {
  background: var(--color-teal-bg);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
}

.specialist-search-box input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.specialist-search-box input:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(47, 158, 110, 0.15);
}

.specialist-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.specialist-search-actions .btn {
  flex: 1 1 auto;
}

.intro-text {
  font-size: 1.08rem;
  text-align: center;
  color: var(--color-text-muted);
  max-width: 760px;
  margin: 0 auto var(--space-4);
  line-height: 1.7;
}

.intro-text a:not(.btn),
.program-content a:not(.exercise-box):not(.btn),
.about a:not(.btn) {
  color: var(--color-green-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 107, 64, 0.35);
  transition: border-color 0.2s, color 0.2s;
}

.intro-text a:not(.btn):hover,
.program-content a:not(.exercise-box):not(.btn):hover,
.about a:not(.btn):hover {
  color: var(--color-navy);
  border-bottom-color: var(--color-navy);
}

.section-heading {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-4);
}

/* ======================= EXERCISE BOXES ======================= */
.exercise-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.exercise-box {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-3);
  text-align: left;
  color: var(--color-navy);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.exercise-box:hover,
.exercise-box:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-green-light);
}

.exercise-box .icon-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-teal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: var(--space-1);
}

.exercise-box h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.exercise-box p {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.exercise-box .learn-more {
  margin-top: auto;
  padding-top: var(--space-2);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-green-dark);
}

/* ======================= BUTTONS ======================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.donation,
.btn-primary {
  background: var(--color-orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 106, 0, 0.35);
}

.donation:hover,
.btn-primary:hover {
  background: var(--color-orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 106, 0, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--color-navy);
  border: 2px solid var(--color-navy);
  padding: 11px 26px;
}

.btn-secondary:hover {
  background: var(--color-navy);
  color: #fff;
}

/* ======================= DISCLAIMER ======================= */
.disclaimer {
  background-color: #fff4e5;
  border: 1px solid #ffcb8a;
  color: #8a5300;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
}

/* ======================= ABOUT / TEXT PAGES ======================= */
.about p {
  font-size: 1.08rem;
  margin-bottom: var(--space-3);
  line-height: 1.85;
  max-width: 68ch;
}

.about h2 {
  font-size: 1.4rem;
  margin: var(--space-5) 0 var(--space-2);
  line-height: 1.35;
}

.about h2:first-of-type {
  margin-top: var(--space-4);
}

.about ul {
  margin: var(--space-1) 0 var(--space-3);
  padding-left: 1.4rem;
}

.about ul li {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  max-width: 68ch;
}

.about ul li:last-child {
  margin-bottom: 0;
}

.discipline-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-1) var(--space-3);
  margin-bottom: var(--space-3);
  padding-left: 0;
}

.discipline-list li {
  background: var(--color-teal-bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 0;
  max-width: none;
}

.privacy h2 {
  font-size: 1.3rem;
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
}

.privacy p, .privacy ul {
  font-size: 1rem;
  margin-bottom: var(--space-2);
  line-height: 1.75;
  color: var(--color-text-muted);
}

.privacy ul {
  padding-left: 1.3rem;
}

/* ======================= PROGRAM PAGES ======================= */
.program-content {
  max-width: 780px;
  margin: 0 auto var(--space-5);
  padding: 0 var(--space-2);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  margin-bottom: var(--space-3);
}

.program-content h2 {
  font-size: 1.5rem;
  margin: var(--space-4) 0 var(--space-2);
}

.program-content > p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.step-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.step-num {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body { flex: 1 1 auto; min-width: 0; }

.step-body strong {
  display: block;
  font-size: 1.05rem;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.step-body p {
  color: var(--color-text-muted);
  font-size: 0.96rem;
  margin-top: 4px;
}

.step-body em {
  color: var(--color-text);
}

.step-body img {
  width: 100%;
  max-width: 420px;
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.step-body .image-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.step-body .image-row img {
  width: 160px;
  max-width: 45%;
  margin-top: 0;
}

.step-body iframe {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  height: auto;
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: none;
}

.note-callout {
  background: var(--color-teal-bg);
  border-left: 4px solid var(--color-green);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-top: var(--space-4);
}

/* ======================= FOOTER ======================= */
footer {
  background-color: var(--color-navy);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: var(--space-3);
  font-size: 0.9rem;
}

footer a {
  color: var(--color-green-light);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

/* ======================= RESPONSIVE ======================= */
@media (max-width: 1024px) {
  .exercise-boxes {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar-right {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-navy);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-1) 0 var(--space-2);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-md);
  }

  .navbar-right.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .navbar-right a:not(.donation) {
    padding: 14px 24px;
    width: 100%;
  }

  .navbar-right a:not(.donation)::after {
    display: none;
  }

  .navbar-right .donation {
    margin: 10px 24px 0;
  }

  .navbar-toggle {
    display: flex;
  }

  .about ul {
    grid-template-columns: 1fr;
  }

  .step-card {
    flex-direction: column;
  }

  .step-num {
    margin-bottom: -8px;
  }

  .step-body .image-row img {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .exercise-boxes {
    grid-template-columns: 1fr;
  }
}
