/* The Healing Nest — Chiropractic, Illawarra */

:root {
  /* Palette — earthy tans + deep greens */
  --forest-900: #1e2f24;
  --forest-700: #2f4a38;
  --forest-500: #45664f;
  --sage-400: #7c8f72;
  --sage-200: #b9c4ad;

  --clay-600: #a2724a;
  --clay-500: #b98a62;
  --clay-300: #d9b894;
  --sand-200: #e6dac7;
  --sand-100: #efe6d8;
  --cream: #f7f2e9;
  --paper: #fdfbf7;

  --ink: #26302a;
  --ink-soft: #4d5a51;
  --ink-muted: #6f7c73;
  --line: #e0d6c5;

  /* Type */
  --font-display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-xs: 0.78rem;
  --text-sm: 0.9rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(1.9rem, 3.4vw, 2.6rem);
  --text-3xl: clamp(2.4rem, 5vw, 3.6rem);
  --text-hero: clamp(2.7rem, 6.2vw, 4.6rem);

  /* Space */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;
  --s8: 8rem;

  --radius: 4px;
  --radius-lg: 10px;
  --maxw: 1200px;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--forest-900);
  margin: 0 0 var(--s3);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}

p { margin: 0 0 var(--s3); max-width: var(--measure); }

a { color: var(--forest-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--clay-600); }

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

ul { padding-left: 1.15rem; margin: 0 0 var(--s3); }
li { margin-bottom: 0.4rem; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }

section { padding-block: var(--s7); }
section.tight { padding-block: var(--s6); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay-600);
  margin: 0 0 var(--s2);
}

.lede { font-size: var(--text-lg); color: var(--ink-soft); line-height: 1.65; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-block: 0.9rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--forest-900);
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 0.3rem;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--forest-700); border-bottom-color: var(--clay-300); }
.nav a[aria-current='page'] { color: var(--forest-900); border-bottom-color: var(--clay-500); }
.nav a.btn-primary { color: var(--cream); border-bottom-color: transparent; padding: 0.6rem 1.4rem; }
.nav a.btn-primary:hover { color: var(--cream); border-bottom-color: transparent; }

/* ---------- Dropdown submenus ---------- */
.nav-item { position: relative; display: flex; align-items: center; gap: 0.15rem; }

.sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.sub-toggle:hover { color: var(--forest-700); background: var(--sand-100); }
.sub-toggle[aria-expanded='true'] { transform: rotate(180deg); color: var(--forest-700); }

.subnav {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: -0.9rem;
  z-index: 60;
  min-width: 15rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -18px rgba(30, 47, 36, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.subnav::before {
  content: '';
  position: absolute;
  top: -0.65rem;
  left: 0;
  right: 0;
  height: 0.65rem;
}
.nav-item.has-sub:hover .subnav,
.nav-item.has-sub:focus-within .subnav,
.nav-item.has-sub.open .subnav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.subnav li { margin: 0; }
.nav .subnav a {
  display: block;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-bottom: 0;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.nav .subnav a:hover,
.nav .subnav a:focus-visible {
  background: var(--sand-100);
  color: var(--forest-900);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  color: var(--forest-900);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.6rem;
  border-radius: 100px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-primary { background: var(--forest-700); color: var(--cream); }
.btn-primary:hover { background: var(--forest-900); color: var(--cream); }
.btn-ghost { border-color: var(--forest-700); color: var(--forest-700); background: transparent; }
.btn-ghost:hover { background: var(--forest-700); color: var(--cream); }
.btn-light { border-color: rgba(247,242,233,0.55); color: var(--cream); background: transparent; }
.btn-light:hover { background: var(--cream); color: var(--forest-900); border-color: var(--cream); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 0; background: var(--cream); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 74vh;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: var(--s7) clamp(1.25rem, 5vw, 4.5rem); }
.hero-copy h1 { font-size: var(--text-hero); margin-bottom: var(--s3); }
.hero-copy .lede { max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: var(--s3); }
.hero-media { position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Page hero (interior) ---------- */
.page-hero {
  background: var(--forest-900);
  color: var(--cream);
  padding-block: var(--s6) var(--s6);
}
.page-hero h1 { color: var(--cream); margin-bottom: var(--s2); }
.page-hero .eyebrow { color: var(--clay-300); }
.page-hero p { color: rgba(247, 242, 233, 0.82); max-width: 58ch; margin-bottom: 0; font-size: var(--text-lg); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: var(--s3); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
a.card:hover {
  border-color: var(--clay-300);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(38, 48, 42, 0.07);
}
.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: var(--s2); }
.card-media { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); margin-bottom: var(--s3); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-link {
  margin-top: auto;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clay-600);
  letter-spacing: 0.02em;
}

/* ---------- Split feature ---------- */
.split {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split-media img { border-radius: var(--radius-lg); }

/* ---------- Tabs ---------- */
.tabs { border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  padding: 0.75rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { color: var(--forest-700); }
.tab[aria-selected='true'] {
  color: var(--forest-900);
  font-weight: 600;
  border-bottom-color: var(--clay-500);
}
.tabpanel[hidden] { display: none; }
.tabpanel { animation: fade 0.35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; columns: 2; column-gap: var(--s5); max-width: 780px; }
.checklist li {
  position: relative;
  padding-left: 1.5rem;
  break-inside: avoid;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  margin-bottom: 0.55rem;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay-500);
}

.panel {
  background: var(--sand-100);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.panel h4 { color: var(--forest-900); }
.panel :last-child { margin-bottom: 0; }

/* ---------- Bands ---------- */
.band-cream { background: var(--cream); }
.band-sand { background: var(--sand-100); }
.band-forest { background: var(--forest-900); color: rgba(247,242,233,0.85); }
.band-forest h2, .band-forest h3 { color: var(--cream); }
.band-forest a { color: var(--clay-300); }

/* ---------- Stat row ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.stat-num { font-family: var(--font-display); font-size: var(--text-2xl); color: var(--clay-300); line-height: 1; }
.band-cream .stat-num { color: var(--clay-600); }
.stat-label { font-size: var(--text-sm); color: inherit; opacity: 0.85; margin-top: 0.5rem; }

/* ---------- Form ---------- */
.form { display: grid; gap: var(--s3); max-width: 620px; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--text-sm); font-weight: 600; color: var(--forest-900); }
.field input, .field textarea, .field select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--sage-400);
  outline-offset: 1px;
  border-color: var(--sage-400);
}
.form-note { font-size: var(--text-sm); color: var(--ink-muted); }

/* ---------- Detail list ---------- */
.details { display: grid; gap: var(--s3); }
.detail-row { display: grid; grid-template-columns: 110px 1fr; gap: var(--s2); align-items: baseline; border-top: 1px solid var(--line); padding-top: var(--s2); }
.detail-row dt { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.detail-row dd { margin: 0; font-size: var(--text-lg); color: var(--forest-900); }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-900); color: rgba(247,242,233,0.72); padding-block: var(--s6) var(--s4); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s5); }
.site-footer h4 { color: var(--cream); font-size: var(--text-sm); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: var(--s2); }
.site-footer a { color: rgba(247,242,233,0.82); text-decoration: none; }
.site-footer a:hover { color: var(--clay-300); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; font-size: var(--text-sm); }
.site-footer .brand-name { color: var(--cream); }
.site-footer .brand svg { color: var(--clay-300); }
.footer-bottom {
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid rgba(247,242,233,0.14);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: space-between;
  font-size: var(--text-xs);
  color: rgba(247,242,233,0.5);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .tabpanel { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { height: 46vh; order: -1; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  section { padding-block: var(--s6); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .checklist { columns: 1; }
  .stats { grid-template-columns: 1fr; gap: var(--s3); text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: var(--s2) 1.25rem var(--s3);
    max-height: calc(100vh - 100%);
    max-height: calc(100dvh - 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding-block: 0.7rem; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: var(--s2); width: 100%; border-bottom: none; }

  /* Submenus become inline accordions on mobile */
  .nav-item { width: 100%; justify-content: space-between; gap: 0; flex-wrap: wrap; }
  .nav-item > a { flex: 1; }
  .sub-toggle {
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .subnav {
    position: static;
    order: 3;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--sand-100);
    transform: none;
    display: none;
  }
  .subnav::before { display: none; }
  .sub-toggle:hover { background: none; }
  .nav-item.has-sub:hover .subnav,
  .nav-item.has-sub:focus-within .subnav { display: none; opacity: 0; visibility: hidden; }
  .nav-item.has-sub.open .subnav {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .nav .subnav a {
    padding: 0.65rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  .subnav li:last-child a { border-bottom: 0; }
  .header-inner { position: static; }
  .header { position: sticky; }
  .tablist { gap: 0; }
  .tab { padding: 0.65rem 0.75rem; font-size: 0.85rem; }
  .detail-row { grid-template-columns: 1fr; }
}
