/* ============================================================
   The Wellness Clinic Australia — site.css
   Single stylesheet for the production site.
   Tokens, resets, typography, components, animations, responsive.
   ============================================================ */

/* ---- Fonts (CDN) ---- */
@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500&display=swap');

/* ---- Tokens ---- */
:root {
  --twc-white: #FFFFFF;
  --twc-grey-50: #F5F5F5;
  --twc-grey-200: #E0E0E0;
  --twc-grey-300: #DDDDDD;
  --twc-grey-400: #BBBBBB;
  --twc-grey-500: #8C8C8C;
  --twc-grey-700: #3A3A3A;
  --twc-black: #111111;
  --twc-teal: #1A6B5E;
  --twc-teal-700: #155649;

  --font-display: 'Cabinet Grotesk', sans-serif;
  --font-accent: 'Instrument Serif', Georgia, serif;
  --font-body: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Resets ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--twc-grey-700);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--twc-teal); color: #fff; }

/* ---- Scroll progress bar ---- */
#twc-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--twc-teal); z-index: 200;
  transform-origin: left; transform: scaleX(0);
  will-change: transform; pointer-events: none;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.btn-brand { background: var(--twc-teal); color: #fff; }
.btn-brand:hover { background: var(--twc-teal-700); }
.btn-primary { background: var(--twc-black); color: #fff; }
.btn-primary:hover { background: var(--twc-teal); }
.btn-sm { height: 40px; padding: 0 20px; font-size: 11px; }

/* ---- Hover utilities ---- */
.h-fade { transition: opacity 200ms ease; }
.h-fade:hover { opacity: 0.5; }
.h-fade-light { transition: opacity 200ms; }
.h-fade-light:hover { opacity: 0.55; }
.h-fade-med { transition: opacity 200ms; }
.h-fade-med:hover { opacity: 0.6; }
.h-footer { transition: color 200ms; }
.h-footer:hover { color: rgba(255,255,255,0.7); }
.h-card { transition: background 220ms; }
.h-card:hover { background: #F5F5F5; }
.h-underline:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Form inputs ---- */
input, textarea, select {
  font-family: var(--font-body);
  transition: border-color 200ms;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--twc-teal) !important;
  outline: none;
}

/* ---- Focus ring ---- */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--twc-teal);
  outline-offset: 2px;
}

/* ---- FAQ accordion ---- */
.faq-item { border-bottom: 1px solid var(--twc-grey-200); }
.faq-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 22px 0; background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--font-display); font-weight: 600;
  font-size: 17px; letter-spacing: -0.01em; color: var(--twc-black); line-height: 1.3;
  transition: opacity 160ms;
}
.faq-btn:hover { opacity: 0.6; }
.faq-icon {
  font-size: 20px; flex-shrink: 0; line-height: 1;
  transition: transform 0.3s var(--ease);
  color: var(--twc-grey-700);
}
.faq-item.open .faq-icon { transform: rotate(45deg); color: var(--twc-teal); }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.5s var(--ease);
}
.faq-item.open .faq-answer { max-height: 800px; }
.faq-answer-inner {
  padding: 0 0 22px; max-width: 640px;
  font-family: var(--font-body); font-size: 15px; line-height: 1.8; color: var(--twc-grey-700);
}

/* ---- Details/summary FAQ (articles) ---- */
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; }

/* ---- Hero animation initial states ---- */
[data-hero-anim] { opacity: 0; }
[data-hero-anim="headline"] { transform: translateY(44px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
[data-hero-anim="accent"] { transform: translateY(44px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-hero-anim="body"] { transform: translateY(36px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-hero-anim="cta"] { transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-hero-anim="trust"] { transform: translateY(20px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-hero-anim="image"] { transform: scale(1.06); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
[data-hero-anim][data-revealed] { opacity: 1; transform: translateY(0); }
[data-hero-anim="image"][data-revealed] { transform: scale(1); }

/* ---- Scroll reveal ---- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal][data-reveal-type="fade"] { transform: none; transition: opacity 0.9s var(--ease); }
[data-reveal][data-reveal-type="accent"] { opacity: 1; transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease); }
[data-reveal][data-reveal-type="dramatic"] { transform: translateY(48px) scale(0.96); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal][data-revealed] { opacity: 1; transform: translateY(0); }
[data-reveal][data-reveal-type="fade"][data-revealed] { opacity: 1; }
[data-reveal][data-reveal-type="accent"][data-revealed] { transform: scaleX(1); }
[data-reveal][data-reveal-type="dramatic"][data-revealed] { opacity: 1; transform: translateY(0) scale(1); }

/* ---- Nav scroll solidify ---- */
.site-nav { transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.site-nav[data-scrolled] { background: rgba(255,255,255,0.97) !important; box-shadow: 0 1px 0 rgba(0,0,0,0.05) !important; }

/* ============================================================
   NAV DROPDOWN
   Critical: .nav-item must ONLY wrap the Protocols link + its
   dropdown panel. Other top-level nav links (Our Approach,
   Articles, Sign in, Book consult) must NOT be inside .nav-item,
   otherwise they will receive a caret indicator.
   ============================================================ */

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding-top: 20px; /* invisible hover bridge between trigger and panel */
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms;
  pointer-events: none;
  z-index: 110;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-dropdown-inner {
  background: #fff;
  border-top: 3px solid var(--twc-teal);
  padding: 32px 36px 36px;
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 32px 56px;
}

.nav-dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 200px;
}

.nav-dropdown-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--twc-teal);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--twc-grey-200);
  margin-bottom: 4px;
}

.nav-dropdown a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--twc-black);
  line-height: 1.25;
  transition: opacity 180ms;
  white-space: nowrap;
}
.nav-dropdown a:hover { opacity: 0.6; }

/* Caret indicator — ONLY applied when the nav-item actually contains
   a .nav-dropdown. Defensive: prevents accidental carets on any other
   top-level nav link if .nav-item is ever misused. */
.nav-item:has(.nav-dropdown) > .nav-text-link::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 220ms var(--ease), color 220ms var(--ease);
}
.nav-item:has(.nav-dropdown):hover > .nav-text-link::after,
.nav-item:has(.nav-dropdown):focus-within > .nav-text-link::after {
  transform: translateY(0) rotate(225deg);
  color: var(--twc-teal);
}

/* ============================================================
   MOBILE MENU
   ============================================================ */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-menu-btn svg { display: block; }

.mobile-menu {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: #fff;
  z-index: 150;
  flex-direction: column;
  padding: 24px clamp(24px, 5vw, 32px) 32px;
  transform: translateX(-100%);
  transition: transform 360ms var(--ease);
  overflow-y: auto;
  visibility: hidden;
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-close {
  align-self: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: 0 0 32px -8px;
  font-size: 28px;
  color: var(--twc-black);
  line-height: 1;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Top-level mobile links (Our approach, Protocols, Articles, etc.) */
.mobile-menu-links > a,
.mobile-menu-links > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--twc-black);
  border-bottom: 1px solid var(--twc-grey-200);
  cursor: pointer;
}

/* <details>-based collapsible group for the Protocols section */
.mobile-menu-links > details {
  border-bottom: 1px solid var(--twc-grey-200);
}
.mobile-menu-links > details > summary {
  border-bottom: none;
  list-style: none;
}
.mobile-menu-links > details > summary::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--twc-teal);
  border-bottom: 1.5px solid var(--twc-teal);
  transform: rotate(-45deg);
  transition: transform 280ms var(--ease);
}
.mobile-menu-links > details[open] > summary::after {
  transform: rotate(45deg);
}

/* Submenu container — holds the two grouped columns (Protocols + Explore by) */
.mobile-submenu {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px 0 24px;
}
.mobile-submenu-group {
  display: flex;
  flex-direction: column;
}
.mobile-submenu-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--twc-teal);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--twc-grey-200);
}
.mobile-submenu a {
  padding: 10px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--twc-black);
}

/* Utility links (FAQ, Contact) shown smaller below primary nav */
.mobile-menu-utility {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.mobile-menu-utility a {
  padding: 18px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--twc-grey-500);
  border-bottom: 1px solid var(--twc-grey-200);
}

/* Action buttons pinned to bottom */
.mobile-menu-actions {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .nav-text-link { display: none !important; }
  .nav-book-btn { display: none !important; }
  .mobile-menu-btn { display: block !important; }
  .hero-image-desktop { display: none !important; }
  .subpage-hero-img { display: none !important; }
  .steps-grid { grid-template-columns: 1fr !important; }
  .protocol-row { flex-direction: column !important; gap: 8px !important; }
  .protocol-row p { text-align: left !important; }
  .protocol-grid { grid-template-columns: 1fr !important; }
  .protocol-grid-photo { display: none !important; }
  .approach-hero-img { display: none !important; }
  .nav-dropdown { display: none !important; }
  .nav-item:has(.nav-dropdown) > .nav-text-link::after { display: none !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .protocol-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .protocol-grid-photo { grid-column: span 1 !important; }
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 999;
  background: var(--twc-teal); color: #fff; padding: 8px 16px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---- Body copy links ---- */
.prose a { color: var(--twc-teal); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { opacity: 0.7; }

/* ---- Print ---- */
@media print {
  .site-nav, #twc-progress, .mobile-menu, .mobile-menu-btn { display: none !important; }
  body { font-size: 12pt; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}
.explore-grid { grid-template-columns: 1fr !important; }