/* =========================================================
   Monash Chiropractic Clinic — Design System
   Hand-written, mobile-first. No framework.
   ========================================================= */

/* ---- Design tokens ---- */
:root {
  /* Brand palette
     The -600 tints below carry white button text, so each one is held at
     ≥ 4.5:1 against white (WCAG 2.1 AA for normal text). */
  --teal-900: #0f3d3a;
  --teal-700: #1a6d63;
  --teal-600: #1e7d72;   /* primary brand — 4.96:1 on white */
  --teal-500: #2fa093;   /* focus ring only — 3.2:1, AA for UI components */
  --teal-100: #e4f2ef;
  --teal-50:  #f2f9f7;

  /* University accent (distinct, fresh) */
  --uni-700: #7a3d12;
  --uni-600: #a55a14;    /* warm ochre — campus path — 5.16:1 on white */
  --uni-100: #f8ecdd;
  --uni-50:  #fdf7ef;

  /* Action accent */
  --accent-600: #c74d2c; /* warm coral CTA — 4.64:1 on white */
  --accent-700: #ab3f22;

  /* Neutrals */
  --ink-900: #1c2422;
  --ink-700: #3a4744;
  --ink-500: #64726e;
  --ink-300: #9aa7a3;
  --line:    #e2e8e6;
  --bg:      #fbfcfb;
  --surface: #ffffff;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --step--1: clamp(0.78rem, 0.75rem + 0.12vw, 0.84rem);
  --step-0:  clamp(1rem, 0.96rem + 0.18vw, 1.075rem);   /* body ~16-17px */
  --step-1:  clamp(1.15rem, 1.06rem + 0.35vw, 1.3rem);
  --step-2:  clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem);
  --step-3:  clamp(1.55rem, 1.35rem + 0.85vw, 2.05rem);
  --step-4:  clamp(1.9rem, 1.55rem + 1.4vw, 2.75rem);

  /* Spacing scale (8px) */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4.5rem;
  --sp-7: 6.5rem;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(28,36,34,.06), 0 1px 2px rgba(28,36,34,.04);
  --shadow-md: 0 10px 30px -12px rgba(28,36,34,.18);
  --maxw: 1140px;
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* the header is sticky, so anchor targets must clear it */
:target { scroll-margin-top: 90px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.15; font-weight: 700; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
a { color: var(--teal-700); }
img { max-width: 100%; display: block; height: auto; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
strong { color: var(--ink-900); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-3); }
.section { padding-block: var(--sp-6); }
/* tighten vertical rhythm on mobile so there's less dead scrolling */
@media (max-width: 680px) {
  .section { padding-block: var(--sp-4); }
  .hero__inner { padding-block: var(--sp-4); }
  .person { gap: var(--sp-2); }
  .footer__grid { padding-block: var(--sp-4); gap: var(--sp-3); }
}
.section--tint { background: var(--teal-50); }
.section--narrow { max-width: 760px; margin-inline: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: var(--step--1); font-weight: 600; color: var(--teal-600); margin-bottom: .6em; }
.lede { font-size: var(--step-1); color: var(--ink-700); }
.center { text-align: center; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink-900); color: #fff; padding: .7em 1em; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; justify-content: center;
  font-weight: 600; font-size: var(--step-0); line-height: 1;
  padding: .85em 1.5em; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--teal-500); outline-offset: 2px; }
.btn--primary { background: var(--accent-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-700); }
.btn--teal { background: var(--teal-600); color: #fff; }
.btn--teal:hover { background: var(--teal-700); }
.btn--uni { background: var(--uni-600); color: #fff; }
.btn--uni:hover { background: var(--uni-700); }
.btn--ghost { background: transparent; color: var(--teal-700); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--teal-500); background: var(--teal-50); }
.btn--lg { padding: .9em 1.6em; font-size: var(--step-0); }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: var(--sp-3);
}
.brand { display: flex; align-items: center; gap: .6em; text-decoration: none; }
.brand__logo { height: 48px; width: auto; display: block; }
@media (max-width: 480px) { .brand__logo { height: 40px; } }
/* legacy text/mark logo styles (unused, kept harmless) */
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__name { font-weight: 700; color: var(--teal-700); font-size: 1.18rem; letter-spacing: -0.01em; line-height: 1.05; }
.brand__name span { display: block; font-size: .72rem; font-weight: 500; color: var(--ink-500); letter-spacing: .02em; }

.nav__links { display: flex; align-items: center; gap: var(--sp-3); list-style: none; margin: 0; padding: 0; }
.nav__links a { text-decoration: none; color: var(--ink-700); font-weight: 500; font-size: 1rem; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--teal-700); }
.nav__cta { margin-left: var(--sp-1); }
/* keep CTA buttons' own text colour — beat the .nav__links a colour rule */
.nav__links .nav__cta a.btn--primary,
.nav__links .nav__cta a.btn--uni { color: #fff; }
.nav__links .nav__cta a:hover { color: #fff; }

.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: .4em;
  width: 44px; height: 44px; color: var(--ink-900);
}
.nav__toggle svg { width: 26px; height: 26px; }

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav__links {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: var(--sp-2) var(--sp-3) var(--sp-4);
    box-shadow: var(--shadow-md);
    transform: translateY(-120%); transition: transform .25s ease; visibility: hidden;
    /* short viewports (landscape phones) must still reach the Book item */
    max-height: calc(100dvh - 72px); overflow-y: auto;
  }
  .nav__links.is-open { transform: translateY(0); visibility: visible; }
  .nav__links li { border-bottom: 1px solid var(--line); }
  .nav__links a { display: block; padding: .9em 0; font-size: 1.1rem; }
  .nav__cta { margin: var(--sp-2) 0 0; }
  .nav__cta a { display: block; text-align: center; }
}

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--teal-50), #fff 60%); }
.hero__inner { display: grid; gap: var(--sp-4); align-items: center; padding-block: var(--sp-6); }
.hero__title { margin-bottom: .3em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.hero__media { display: grid; place-items: center; }
.hero__media img {
  width: 100%; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
/* home hero photo has a baked-in circular vignette — show it as a true circle */
.hero__media--round img { max-width: 460px; aspect-ratio: 1; border-radius: 50%; }
@media (min-width: 860px) {
  .hero__inner { grid-template-columns: 1.05fr .95fr; }
}

/* ---- Location cards ---- */
.locations { display: grid; gap: var(--sp-3); }
@media (min-width: 760px) { .locations { grid-template-columns: 1fr 1fr; } }
.loc-card {
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--teal-600);
  border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.loc-card--uni { border-top-color: var(--uni-600); }
.loc-card__photo {
  width: calc(100% + 2 * var(--sp-4)); max-width: none;
  margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) var(--sp-3);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; aspect-ratio: 16 / 9; object-fit: cover;
}
.loc-card__tag {
  display: inline-block; font-size: var(--step--1); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--teal-700); background: var(--teal-100);
  padding: .35em .8em; border-radius: 999px; margin-bottom: var(--sp-2); align-self: flex-start;
}
.loc-card--uni .loc-card__tag { color: var(--uni-700); background: var(--uni-100); }
.loc-card h3 { margin-bottom: .3em; }
.loc-card__meta { list-style: none; padding: 0; margin: 0 0 var(--sp-3); font-size: 1rem; }
.loc-card__meta li { display: flex; gap: .6em; padding: .35em 0; color: var(--ink-700); }
.loc-card__meta a { color: var(--ink-900); font-weight: 600; text-decoration: none; }
.loc-card__meta a:hover { color: var(--teal-700); }
.loc-card__actions { margin-top: auto; display: flex; flex-direction: column; gap: .6em; }
.icon { flex: none; width: 22px; height: 22px; color: var(--teal-600); }
.loc-card--uni .icon { color: var(--uni-600); }

/* ---- Feature / service grid ---- */
.grid { display: grid; gap: var(--sp-3); }
.grid--3 { grid-template-columns: 1fr; }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } .grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-3); box-shadow: var(--shadow-sm);
}
.card h3 { font-size: var(--step-0); }
.service { text-align: left; }
.service__icon { width: 40px; height: 40px; color: var(--teal-600); margin-bottom: var(--sp-1); }

/* ---- Practitioner ---- */
.person { display: grid; gap: var(--sp-4); align-items: start; }
@media (min-width: 680px) { .person { grid-template-columns: 210px 1fr; } .person--rev { grid-template-columns: 1fr 210px; } .person--rev .person__photo { order: 2; } }
.person__photo { border-radius: var(--radius-lg); background: var(--teal-100); aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; width: 100%; box-shadow: var(--shadow-sm); }
/* on small screens keep it a modest headshot, not a full-width photo */
@media (max-width: 679px) { .person__photo { max-width: 170px; } }
.person__quals { color: var(--teal-700); font-weight: 600; font-size: var(--step--1); margin-bottom: .8em; }

/* ---- Hours table ---- */
.hours { width: 100%; border-collapse: collapse; font-size: 1rem; }
.hours th, .hours td { text-align: left; padding: .55em 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; color: var(--ink-900); font-weight: 600; }
.hours th { font-weight: 500; color: var(--ink-700); }

/* ---- Checklist ---- */
.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 1.9em; margin-bottom: .6em; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 1.2em; height: 1.2em;
  background: var(--teal-100); border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2321857a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: .8em; background-repeat: no-repeat; background-position: center;
}
.notlist { list-style: none; padding: 0; }
.notlist li { position: relative; padding-left: 1.6em; margin-bottom: .5em; color: var(--ink-700); }
.notlist li::before { content: "—"; position: absolute; left: 0; color: var(--ink-300); }

/* ---- FAQ / accordion ---- */
.faq { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 1.1em var(--sp-3); font-weight: 600; color: var(--ink-900);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5em; color: var(--teal-600); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding: 0 var(--sp-3) 1.2em; color: var(--ink-700); }

/* ---- Callout / placeholder ---- */
.callout { background: var(--teal-50); border: 1px dashed var(--teal-500); border-radius: var(--radius); padding: var(--sp-3); font-size: 1rem; }
.ph { background: #fff3cd; color: #664d03; padding: 0 .35em; border-radius: 4px; font-weight: 600; font-size: .95em; }

/* ---- Split banner (uni page) ---- */
.banner--uni { background: linear-gradient(160deg, var(--uni-50), #fff 65%); }
.banner--uni .eyebrow { color: var(--uni-700); }

/* ---- Footer ---- */
.site-footer { background: var(--teal-900); color: #cfe0dc; }
.site-footer a { color: #fff; }
.footer__grid { display: grid; gap: var(--sp-4); padding-block: var(--sp-5); }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.2fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: var(--step-0); margin-bottom: .7em; }
.footer__loc p { margin: 0 0 .3em; font-size: .98rem; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.15); padding-block: var(--sp-2); font-size: .9rem; color: #9fb8b3; display: flex; flex-wrap: wrap; gap: .5em 1.5em; justify-content: space-between; }

/* ---- Sticky mobile action bar ---- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; gap: .6rem;
  padding: .55rem var(--sp-3) calc(.55rem + env(safe-area-inset-bottom, 0px));
  /* light, fading backdrop so iOS Safari tints its toolbar neutral, not orange */
  background: linear-gradient(to top, rgba(251,252,251,.97) 60%, rgba(251,252,251,0));
  backdrop-filter: saturate(1.2) blur(6px);
}
.mobile-bar a {
  flex: 1; text-align: center; padding: .85em 1em; border-radius: 999px;
  text-decoration: none; font-weight: 600; color: var(--teal-700); font-size: 1rem;
  display: flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.mobile-bar a.is-book { background: var(--accent-600); color: #fff; border-color: transparent; }
@media (max-width: 860px) {
  .mobile-bar { display: flex; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  /* the booking hub IS the booking action — no sticky bar, no reserved space */
  body.no-bar { padding-bottom: 0; }
}

/* ---- Misc ---- */
.stack > * + * { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.muted { color: var(--ink-500); font-size: 1rem; }
