/* ==========================================================================
   Dr Nigel Hargreaves — design system
   Replaces ~2,100 generated Webflow classes with one container, one spacing
   scale and one type scale. Mobile-first; every breakpoint is min-width.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */
@font-face {
  font-family: 'Hauora';
  src: url('/assets/media/656b107dfd5213ff8545b78f_Hauora-wght-.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Brand colours, sampled from the original site so the identity carries over. */
  --navy: #292f3b;
  --navy-deep: #21262f;
  --navy-raised: #323949;
  --bronze: #b68d71;
  --bronze-bright: #cfa68a;

  --text: #f3f5f8;
  --text-muted: #aeb6c4;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);

  /* Fluid type scale */
  --fs-display: clamp(2.75rem, 1.6rem + 4.6vw, 5.25rem);
  --fs-h1: clamp(2.1rem, 1.4rem + 2.8vw, 3.5rem);
  --fs-h2: clamp(1.65rem, 1.25rem + 1.7vw, 2.5rem);
  --fs-h3: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
  --fs-sm: 0.9375rem;
  --fs-eyebrow: 0.8125rem;

  /* Spacing scale (4px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section-y: clamp(3.5rem, 2rem + 6vw, 7rem);

  /* One container. This is what fixes the "all over the place" alignment. */
  --container: 1200px;
  --gutter: clamp(1.25rem, 0.5rem + 3.2vw, 3.5rem);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px rgba(182, 141, 113, 0.45);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font-family: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, picture, video, iframe, svg { display: block; max-width: 100%; }
img, video { height: auto; }

h1, h2, h3, h4 {
  font-family: 'Hauora', 'Inter Tight', system-ui, sans-serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* --- Layout primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--alt { background: var(--navy-deep); }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-6); }

@media (min-width: 860px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--split { grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); }
  .grid--split-wide { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); }
}
@media (min-width: 600px) and (max-width: 859px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

/* --- Typography helpers --------------------------------------------------- */
.eyebrow {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 600;
  margin: 0 0 var(--s-3);
}

.display { font-size: var(--fs-display); font-weight: 700; }
.h1 { font-size: var(--fs-h1); font-weight: 700; }
.h2 { font-size: var(--fs-h2); font-weight: 600; }
.h3 { font-size: var(--fs-h3); font-weight: 600; }

.lede { font-size: clamp(1.06rem, 1rem + 0.4vw, 1.3rem); color: var(--text-muted); }
.muted { color: var(--text-muted); }
.bronze { color: var(--bronze); }
.measure { max-width: 62ch; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  /* 48px min height keeps every tap target above the 44px guideline. */
  min-height: 48px;
  padding: var(--s-3) var(--s-6);
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--bronze); color: #1d222b; }
.btn--primary:hover { background: var(--bronze-bright); }

.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--bronze); color: var(--bronze); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* --- Header / navigation -------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(41, 47, 59, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 74px;
}

.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand__name { font-family: 'Hauora', sans-serif; font-weight: 600; font-size: 1rem; line-height: 1.2; }
.brand__role { display: block; font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.nav { display: none; }
.nav__list { display: flex; align-items: center; gap: var(--s-5); list-style: none; margin: 0; padding: 0; }
.nav__link {
  text-decoration: none;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding-block: var(--s-2);
  transition: color 0.18s;
}
.nav__link:hover { color: var(--text); }
.nav__link[aria-current='page'] { color: var(--bronze); }

.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0 12px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.nav__toggle span { display: block; height: 2px; background: var(--text); transition: transform 0.25s, opacity 0.2s; }
.nav__toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 74px 0 0;
  background: var(--navy-deep);
  padding: var(--s-6) var(--gutter) var(--s-8);
  /* Slides down from behind the header rather than in from the right. A fixed
     element parked to the *right* is not clipped by overflow-x and adds a full
     viewport of horizontal scroll; parked *above*, it cannot extend the scroll
     range in either axis. visibility also blocks interaction while closed. */
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0s linear 0.28s;
  overflow-y: auto;
  z-index: 49;
}
.drawer[data-open='true'] {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.28s ease, visibility 0s;
}
.drawer__list { list-style: none; margin: 0 0 var(--s-6); padding: 0; }
.drawer__list li + li { border-top: 1px solid var(--line); }
.drawer__link {
  display: block;
  padding: var(--s-4) 0;
  font-family: 'Hauora', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
}
.drawer__link[aria-current='page'] { color: var(--bronze); }

@media (min-width: 1000px) {
  .nav { display: block; }
  .nav__toggle, .drawer { display: none; }
}

/* --- Hero ----------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(3rem, 1.5rem + 7vw, 7rem); overflow: hidden; }
.hero::after {
  /* Soft bronze bloom, purely decorative. */
  content: '';
  position: absolute;
  width: 60vw;
  aspect-ratio: 1;
  right: -18vw;
  top: -22vw;
  background: radial-gradient(circle, rgba(182, 141, 113, 0.16), transparent 62%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero__figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
}
.hero__figure img { width: 100%; height: 100%; object-fit: cover; }

.credentials { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.credentials img {
  height: 62px;
  width: auto;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

/* --- Cards ---------------------------------------------------------------- */
.card {
  background: var(--navy-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-6);
  height: 100%;
}
.card--flush { padding: 0; overflow: hidden; }
.card__body { padding: var(--s-6); }
.card__media { aspect-ratio: 16 / 10; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.figure img { width: 100%; }

/* --- Numbered steps ------------------------------------------------------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 4.25rem; }
.steps li + li { margin-top: var(--s-6); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -0.15em;
  font-family: 'Hauora', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--bronze);
  opacity: 0.85;
}

/* --- Video cards ---------------------------------------------------------- */
.video-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-raised);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.video-card__media { position: relative; aspect-ratio: 16 / 10; }
.video-card__media img { width: 100%; height: 100%; object-fit: cover; }
.video-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 24, 31, 0.85), rgba(20, 24, 31, 0.15));
}
.video-card__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--bronze);
  display: grid;
  place-items: center;
  z-index: 2;
  transition: transform 0.2s;
}
.video-card:hover .video-card__play { transform: scale(1.08); }
.video-card__play svg { width: 22px; height: 22px; fill: #1d222b; margin-left: 3px; }
.video-card__body { padding: var(--s-5); }

/* --- Lightbox ------------------------------------------------------------- */
/* A closed <dialog> is display:none via the UA sheet; `display:grid` below would
   override that and leave the player visible on the page, so re-assert it. */
.lightbox:not([open]) { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(14, 17, 22, 0.92);
  border: 0;
}
.lightbox::backdrop { background: rgba(14, 17, 22, 0.92); }
.lightbox__frame { width: min(1100px, 100%); aspect-ratio: 16 / 9; }
.lightbox__frame iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.lightbox__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-raised);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* --- Clinics -------------------------------------------------------------- */
.clinic { border-top: 1px solid var(--line); padding-top: var(--s-7); }
.clinic + .clinic { margin-top: var(--s-7); }
.clinic__map { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy-raised); }
.clinic__map iframe { width: 100%; height: 100%; border: 0; }

/* --- Tabs ----------------------------------------------------------------- */
.tabs { display: flex; gap: var(--s-2); border-bottom: 1px solid var(--line); margin-bottom: var(--s-7); }
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  padding: var(--s-3) var(--s-5);
  min-height: 48px;
  cursor: pointer;
}
.tab[aria-selected='true'] { color: var(--bronze); border-bottom-color: var(--bronze); }
.tabpanel[hidden] { display: none; }

/* --- Forms ---------------------------------------------------------------- */
.field { display: block; margin-bottom: var(--s-5); }
.field__label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s-2); }
.field__label .req { color: var(--bronze); }

.input, .textarea, .select {
  width: 100%;
  min-height: 52px;
  padding: var(--s-3) var(--s-4);
  background: var(--navy-deep);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  /* 16px minimum stops iOS Safari zooming the page on focus. */
  font-size: max(16px, var(--fs-sm));
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--bronze);
  outline: none;
  box-shadow: var(--ring);
}
.textarea { min-height: 150px; resize: vertical; padding-top: var(--s-4); }
.input::placeholder, .textarea::placeholder { color: #7c8697; }

.checkbox { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: var(--s-4); }
.checkbox input {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--bronze);
}
.checkbox span { font-size: var(--fs-sm); color: var(--text-muted); }

.form-note {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  border-left: 2px solid var(--bronze);
  padding-left: var(--s-4);
  margin-bottom: var(--s-6);
}

.form-status { border-radius: 10px; padding: var(--s-4) var(--s-5); margin-top: var(--s-5); }
.form-status[hidden] { display: none; }
.form-status--ok { background: rgba(122, 168, 128, 0.16); border: 1px solid rgba(122, 168, 128, 0.5); }
.form-status--err { background: rgba(196, 106, 106, 0.16); border: 1px solid rgba(196, 106, 106, 0.5); }

@media (min-width: 720px) {
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-5); }
}

/* --- Gallery -------------------------------------------------------------- */
.gallery { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.gallery img { width: 100%; border-radius: var(--radius); }

/* --- Course card ---------------------------------------------------------- */
.course {
  display: grid;
  gap: var(--s-6);
  background: var(--navy-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 860px) { .course { grid-template-columns: 1fr 1fr; align-items: center; } }
.course__media img { width: 100%; height: 100%; object-fit: cover; }
.course__body { padding: clamp(1.5rem, 3vw, 3rem); }
.price { font-family: 'Hauora', sans-serif; font-size: 2rem; font-weight: 700; color: var(--bronze); }

/* --- Footer --------------------------------------------------------------- */
.footer { background: var(--navy-deep); border-top: 1px solid var(--line); padding-block: var(--s-8) var(--s-6); }
.footer__grid { display: grid; gap: var(--s-7); }
@media (min-width: 780px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h2 { font-size: var(--fs-eyebrow); letter-spacing: 0.16em; text-transform: uppercase; color: var(--bronze); margin-bottom: var(--s-4); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer a { color: var(--text-muted); text-decoration: none; }
/* Standalone navigation links, so they need a 44px target rather than relying on
   the WCAG inline-text exception that applies to links inside a sentence. */
.footer li a,
.footer p > a:only-child {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer a:hover { color: var(--text); }
.socials { display: flex; gap: var(--s-3); }
.socials a {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.socials img { width: 20px; height: 20px; }
.footer__base {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --- Utility -------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  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: var(--s-4);
  top: -100px;
  z-index: 100;
  background: var(--bronze);
  color: #1d222b;
  padding: var(--s-3) var(--s-5);
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
