/* =========================================================
   UX Peak–inspired functional UX layer (desktop + mobile)
   35+ tactics applied across Parkes Fitness4All
   Channel: youtube.com/@uxpeak
   =========================================================
   1  Visual hierarchy (type scale)
   2  8-point spacing system
   3  Primary CTA dominance (size + contrast)
   4  Secondary vs primary button hierarchy
   5  Sticky glass header
   6  Header shrink on scroll
   7  Scroll progress bar
   8  Focus-visible rings (keyboard a11y)
   9  48px touch targets (mobile)
  10  Bottom mobile nav (thumb zone)
  11  Sticky mobile free-pass CTA
  12  Full-screen mobile drawer + overlay
  13  Body scroll lock when drawer open
  14  Click-outside / Escape close
  15  Active page nav indicator
  16  Back-to-top FAB
  17  Form focus glow + error states
  18  Inline validation
  19  Loading button states
  20  Polished toasts
  21  Image fade-in (perceived performance)
  22  Aspect-ratio reserved (CLS)
  23  Sticky store/equipment filters
  24  Chip-style filter controls
  25  Empty states
  27  Press feedback on cards/buttons
  28  Safe-area insets (notches)
  29  prefers-reduced-motion
  30  Readable content measure
  31  Bottom-nav body padding
  33  Trust microcopy near CTAs
  34  Desktop hover-only affordances
  35  Enhanced skip-link
  37  Sticky section labels
  38  Clear z-index stacking
  39  Reduced cognitive load (group spacing)
  40  High-contrast dark mode nav
   ========================================================= */

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 80px;
  --touch: 48px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,.12);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.18);
  --focus-ring: 0 0 0 3px rgba(var(--accent-rgb), .45);
  --header-h: 72px;
  --bottom-nav-h: 64px;
  --z-header: 1000;
  --z-overlay: 1100;
  --z-drawer: 1200;
  --z-bottom: 1050;
  --z-fab: 1060;
  --z-toast: 1300;
  --z-progress: 1400;
}

/* Simplified header: fewer top links, roomier tap targets */
.site-header .nav-links > li { margin-left: 10px; }
.site-header .nav-links > li > a {
  font-size: .88rem !important;
  padding: 10px 10px !important;
  letter-spacing: .04em;
}
.site-header .nav-join {
  background: var(--accent);
  color: var(--on-accent) !important;
  border-radius: 999px;
  padding: 10px 16px !important;
}
.site-header .nav-join:hover { background: var(--accent-hover); color: var(--on-accent) !important; }
.join-menu { min-width: 280px !important; padding: 8px 0 !important; }
.join-menu a {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  padding: 12px 16px !important;
  line-height: 1.25;
}
.join-menu a strong { font-size: .95rem; }
.join-menu a span { font-size: .75rem; color: #999; font-weight: 500; }
.join-menu a:hover span { color: #ccc; }
.join-menu .join-combo {
  background: linear-gradient(90deg, rgba(0,169,224,.12), rgba(0,169,224,.02));
  border-left: 3px solid var(--accent);
}

@media (max-width: 768px) {
  
  
  
  
}

/* Dual membership plaster cards */
.dual-plaster {
  background: linear-gradient(135deg, #0a0a0a 0%, #0c4a6e 55%, #00a9e0 100%);
  color: #fff;
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}
.dual-plaster::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(0,169,224,.35), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,.08), transparent 35%);
  pointer-events: none;
}
.dual-plaster .container { position: relative; z-index: 1; }
.dual-plaster h2 {
  color: #fff;
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 12px;
}
.dual-plaster .lead {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 32px;
  opacity: .95;
  font-size: 1.1rem;
}
.dual-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .dual-cards { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
.dual-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.dual-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,.16);
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
}
.dual-card.featured {
  background: #fff;
  color: #0a0a0a;
  border-color: #fff;
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
}
.dual-card .dual-icon { font-size: 2.2rem; margin-bottom: 10px; }
.dual-card h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: inherit;
}
.dual-card.featured h3 { color: #0077a3; }
.dual-card p {
  font-size: .95rem;
  opacity: .9;
  margin-bottom: 18px;
  flex: 1;
}
.dual-card.featured p { color: #444; opacity: 1; }
.dual-card .btn { margin-top: auto; width: 100%; }
.dual-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* 1 & 2 - hierarchy + spacing.
   Fluid so the mobile step-down lives in one place. This file loads after styles.css,
   so a plain `.section { padding: var(--space-8) 0 }` here was overriding the
   `@media (max-width:768px) { .section { padding: 50px 0 } }` rule there, and every
   section kept its full 80px desktop padding on phones. */
.section { padding: clamp(48px, 7vw, var(--space-8)) 0; }
.section-sm { padding: clamp(32px, 5vw, var(--space-6)) 0; }
.container { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.section-header { margin-bottom: var(--space-5); }
.section-header h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); margin-bottom: var(--space-3); }
.section-header p { max-width: 42rem; margin-left: auto; margin-right: auto; color: var(--text-muted); font-size: 1.05rem; }

/* 30 — readable measure */
.post-content, .form-box p, .card-body > p { max-width: 65ch; }
.hero-content p, .page-hero p { max-width: 40rem; }

/* 3 & 4 — CTA hierarchy */
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  font-size: .95rem;
  letter-spacing: .05em;
}
.btn-primary {
  /* was also font-size:1rem + padding:14px 32px, which made every primary button
     physically larger than the outline/white buttons beside it in the same row */
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), .28);
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(var(--accent-rgb), .38); }
.btn-outline { box-shadow: none; }
.btn-sm { min-height: 40px; padding: 10px 18px; font-size: .9rem; }
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* 8 — keyboard focus */
.nav-links a:focus-visible,
.footer-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 5 & 6 — sticky glass header + shrink */
header {
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  background: rgba(10, 10, 10, .92) !important;
  transition: min-height .25s ease, padding .25s ease, box-shadow .25s ease, background .25s ease;
}
header.is-scrolled {
  box-shadow: 0 8px 28px rgba(0,0,0,.35) !important;
}
header.is-scrolled .main-nav { padding-top: 6px; padding-bottom: 6px; }
header.is-scrolled .logo-img img { height: 36px; width: auto; transition: height .25s ease; }
.logo-img img { transition: height .25s ease; }

/* 7 — scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: var(--z-progress);
  background: linear-gradient(90deg, var(--accent), #7dd3fc);
  pointer-events: none;
  transition: width .05s linear;
}

/* 35 — skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
  outline: none;
  box-shadow: var(--focus-ring);
}

/* 12 — mobile drawer overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  backdrop-filter: blur(2px);
}
.nav-overlay.open {
  opacity: 1;
  visibility: visible;
}
body.nav-open { overflow: hidden; touch-action: none; }

/* Drawer head only on mobile */
.nav-drawer-head { display: none; }

/* Mobile menu as slide-in drawer */
@media (max-width: 768px) {
  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 16px;
    border-bottom: 1px solid #222;
    margin-bottom: 8px;
  }
  .mobile-menu-btn {
    min-width: var(--touch);
    min-height: var(--touch);
    font-size: 1.4rem;
    border-radius: var(--radius-md);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
  }
  .mobile-menu-btn[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
  }
  .nav-links {
    display: flex !important;
    position: fixed;
    top: 0;
    /* must clear the `left: 0` from styles.css or left+right+width over-constrain
       and the closed drawer stays visible on screen */
    left: auto;
    right: 0;
    bottom: 0;
    width: min(88vw, 360px);
    max-height: none;
    background: #0d0d0d;
    flex-direction: column;
    align-items: stretch;
    padding: calc(16px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));
    transform: translateX(105%);
    /* visibility, not just transform: a closed drawer parked off-screen still counted
       towards the document width, so every page could be panned ~356px sideways on a
       phone. It also keeps the closed menu out of the tab order. */
    visibility: hidden;
    /* visibility flips instantly when opening, and only after the slide-out finishes
       when closing, so the panel is never invisible while it is on screen */
    transition: transform .32s cubic-bezier(.16,1,.3,1), visibility 0s linear .32s;
    z-index: var(--z-drawer);
    overflow-y: auto;
    border-left: 1px solid #222;
    box-shadow: -16px 0 48px rgba(0,0,0,.4);
  }
  .nav-links.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform .32s cubic-bezier(.16,1,.3,1), visibility 0s;
  }
  .nav-links > li > a {
    min-height: var(--touch);
    display: flex;
    align-items: center;
    padding: 14px 22px;
    font-size: .95rem;
  }
  .nav-drawer-head strong {
    font-family: var(--font-display);
    letter-spacing: .06em;
    font-size: .9rem;
  }
  .nav-close {
    min-width: var(--touch);
    min-height: var(--touch);
    border: 1px solid #333;
    background: transparent;
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-close .icon {
    width: 1.15rem;
    height: 1.15rem;
    color: #fff;
  }
}

/* 15 — active page */
.nav-login-btn.is-active,
a.nav-login-btn.is-active {
  background: var(--accent) !important;
  color: #041018 !important;
}
/* The active-page colour is the accent, so it must never land on a control
   that already sits ON the accent — the JOIN pill was painting accent text on
   an accent background and going blank on membership-prices.html. Pill-shaped
   nav controls get a darker fill instead of the underline treatment. */
.nav-links a.is-active:not(.nav-join):not(.nav-login-btn):not(.btn) {
  color: var(--accent) !important;
}
.nav-links > li > a.is-active:not(.nav-join):not(.nav-login-btn):not(.btn) {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.site-header .nav-join.is-active {
  background: var(--accent-hover);
  color: var(--on-accent) !important;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .35);
}
@media (max-width: 768px) {
  .nav-links > li > a.is-active:not(.nav-join):not(.nav-login-btn):not(.btn) {
    background: rgba(var(--accent-rgb), .1);
    box-shadow: inset 3px 0 0 var(--accent);
  }
}

/* 10 — bottom mobile nav (thumb zone) */
.bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: var(--z-bottom);
    background: rgba(10,10,10,.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid #2a2a2a;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 28px rgba(0,0,0,.25);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--bottom-nav-h);
    font-size: .62rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-radius: 10px;
    transition: color .2s, background .2s;
  }
  .bottom-nav a .bn-icon { font-size: 1.15rem; line-height: 1; }
  .bottom-nav a.is-active,
  .bottom-nav a:active { color: var(--accent); background: rgba(var(--accent-rgb), .1); }
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px); }
  footer { padding-bottom: var(--space-4); }
}

/* 16 — back to top */
.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: var(--z-fab);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all .25s ease;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--accent); }
@media (max-width: 768px) {
  .back-to-top {
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 80px);
    right: 12px;
  }
}

/* 17 & 18 — forms */
.form-control {
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  transition: border-color .2s, box-shadow .2s, background .2s;
  padding: 12px 14px;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
  outline: none;
}
.form-control.is-invalid {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, .15);
}
.form-control.is-valid {
  border-color: #16a34a;
}
.field-hint {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.field-error {
  display: none;
  font-size: .78rem;
  color: #e11d48;
  margin-top: 4px;
  font-weight: 600;
}
.form-group.has-error .field-error { display: block; }
.form-group label {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 6px;
  display: block;
}

/* 20 — toasts */
.toast-stack {
  z-index: var(--z-toast) !important;
  bottom: max(24px, env(safe-area-inset-bottom)) !important;
}
@media (max-width: 768px) {
  .toast-stack {
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 16px) !important;
    left: 12px !important;
    right: 12px !important;
  }
  .toast { width: 100%; }
}
.toast {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: #16a34a; }

/* 21 & 22 — images */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity .4s ease;
  background: linear-gradient(90deg, #eee 25%, #f7f7f7 50%, #eee 75%);
  background-size: 200% 100%;
}
img[loading="lazy"].loaded,
img.loaded {
  opacity: 1;
  background: none;
}
.card-img, .img-real, .media-thumb, .class-video {
  aspect-ratio: 4/3;
  background: #111;
}
.media-thumb, .class-video, .blog-card .media-thumb { aspect-ratio: 16/10; }
.card-img.has-photo.contain-img { aspect-ratio: 1; }

/* 23 & 24 — sticky chip filters */
.equip-filters,
.equip-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.equip-filter-btn,
.equip-room-btn,
.price-tab {
  min-height: 40px;
  border-radius: var(--radius-pill) !important;
  padding: 8px 16px !important;
  font-weight: 600;
  transition: transform .15s ease, background .2s, color .2s, border-color .2s;
}
.equip-filter-btn:active,
.equip-room-btn:active { transform: scale(.96); }

.equip-toolbar {
  position: sticky;
  top: calc(var(--header-h, 72px) + 8px);
  z-index: 20;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  padding: 12px 0 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* 25 — empty states */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: .6;
}
.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 8px;
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 700;
}

/* 27 — press feedback */
.card {
  border-radius: var(--radius-md);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
  }
}
.card:active { transform: scale(.99); }

/* 33 — trust microcopy */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: center;
  margin-top: 16px;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
}
/* the row is injected next to any join/free CTA, including ones on photos and
   dark bands — #666 was unreadable there */
.hero-slide .trust-row,
.page-hero .trust-row,
.section-dark .trust-row,
.dual-plaster .trust-row,
.video-banner .trust-row,
.loyalty-banner .trust-row,
.cta-strip .trust-row,
.pp-hero .trust-row {
  color: #fff;
}
.hero-slide .trust-row,
.page-hero .trust-row {
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.hero-slide .trust-row .icon,
.page-hero .trust-row .icon,
.section-dark .trust-row .icon,
.dual-plaster .trust-row .icon,
.video-banner .trust-row .icon,
.loyalty-banner .trust-row .icon,
.cta-strip .trust-row .icon,
.pp-hero .trust-row .icon {
  color: #fff;
}
.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trust-row span::before {
  content: none;
}

/* Price cards more functional */
.price-card {
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.price-card .btn { margin-top: auto; width: 100%; }

/* FAQ better touch */
.faq-q {
  min-height: 56px;
  text-align: left;
  width: 100%;
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
}
.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.faq-item.open { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .2); }

/* Desktop polish */
@media (min-width: 992px) {
  .nav-links > li > a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .dropdown-content {
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
  }
  .dropdown-content a {
    padding: 10px 16px;
    min-height: 40px;
    display: flex;
    align-items: center;
  }
  .dropdown-content a:hover {
    background: rgba(var(--accent-rgb), .08);
    color: var(--accent);
  }
}

/* 39 — grouping */
.grid { gap: var(--space-4); }
.pricing-grid { gap: var(--space-4); }

/* Live region for screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* 29 — reduced motion already in animations.css; reinforce */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { transition: none; }
  .nav-links, .back-to-top, .card { transition: none !important; }
  img[loading="lazy"] { opacity: 1; }
}
