/* ─── MENDSPACE MAIN STYLESHEET ─────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Montserrat:wght@200;300;400;500;600&display=swap');

:root {
  /* Teal accent (replaces gold) */
  --gold:        #1F6B68;
  --gold-light:  #3D8E8A;
  --gold-dark:   #154E4C;

  /* Backgrounds — white-dominant, cream as accent */
  --dark:        #FFFFFF;   /* main page bg — clean white */
  --surface:     #FFFFFF;   /* cards */
  --surface2:    #F4F1EB;   /* cream accent — inputs / secondary bg */
  --surface3:    #F0EBE2;   /* cream accent — alternate sections */

  /* Borders */
  --border:      rgba(31,107,104,0.18);
  --border-s:    rgba(31,107,104,0.08);

  /* Text */
  --text:        #1A3230;   /* primary — dark forest green */
  --text-muted:  #6B7A77;   /* secondary */
  --text-faint:  #A8B4B1;   /* tertiary */

  /* Status */
  --error:       #C0392B;
  --success:     #2E7D32;
  --pending:     #B8860B;

  --radius:      0px;
  --nav-h:       72px;

  /* Typography — overridable via the admin Fonts picker */
  --font-heading: 'Cormorant Garamond', serif;
  --font-body:    'Montserrat', sans-serif;

  /* Motion — strong custom curves (built-in CSS easings are too weak) */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);     /* enter / responsive UI  */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);    /* on-screen movement     */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);     /* iOS-like drawer / modal */

  /* Elevation — soft, tinted to the brand's forest green */
  --shadow-sm:   0 1px 3px rgba(26,50,48,0.05);
  --shadow-md:   0 6px 24px rgba(26,50,48,0.08);
  --shadow-lg:   0 18px 48px rgba(26,50,48,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Accessible, on-brand focus ring — visible only for keyboard users */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.018;
  pointer-events: none;
  z-index: 0;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;       /* avoids orphans on multi-line headings */
}

h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }

p { text-wrap: pretty; }

a { color: var(--gold); text-decoration: none; transition: color .2s var(--ease-out), opacity .2s var(--ease-out); }
a:hover { opacity: .7; }

p { color: var(--text-muted); line-height: 1.8; }

.serif { font-family: var(--font-heading); }
.gold  { color: var(--gold); }
.muted { color: var(--text-muted); }

/* ─── NAVIGATION ─────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 48px;
}

.nav-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; }
.nav-logo img {
  /* Logo PNG is square with heavy transparent padding — match the events page
     by zooming with scale() so the mark renders large. transform-origin:left
     keeps the visual growth to the right so it never overlaps the nav links. */
  width: 50px;
  height: auto;
  max-height: 60px;
  object-fit: contain;
  scale: 3.8;
  transform-origin: left center;
  margin-left: 14px;
}
@media (max-width: 768px) {
  .nav-logo img { scale: 3.0; margin-left: 8px; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  position: relative;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color .2s var(--ease-out);
}

/* Underline that wipes in from the left on hover/active */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); opacity: 1; }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Dropdown nav */
.nav-has-dropdown { position: relative; }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  list-style: none;
  min-width: 180px;
  z-index: 200;
  box-shadow: var(--shadow-md);
  /* Animated entry: scale + lift from the top (origin-aware) */
  transform-origin: top center;
  transform: translateX(-50%) translateY(-6px) scale(0.97);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), visibility 0s linear .18s;
}
/* Invisible bridge across the 8px gap so hover isn't lost on the way down */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.nav-dropdown li a {
  display: block;
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-s);
  white-space: nowrap;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
}
.nav-dropdown li:last-child a { border-bottom: none; }
.nav-dropdown li a:hover { color: var(--gold); background: var(--surface2); }
.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), visibility 0s;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-menu-btn span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text);
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background .25s var(--ease-out), color .25s var(--ease-out),
              border-color .25s var(--ease-out), transform .12s var(--ease-out);
  white-space: nowrap;
  will-change: transform;
}

.btn:hover { background: var(--gold); color: #fff; opacity: 1; }
/* Press feedback — the interface acknowledges the tap instantly */
.btn:active { transform: scale(0.97); }

.btn-fill {
  background: var(--gold);
  color: #fff;
}
.btn-fill:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }

.btn-sm { padding: 10px 20px; font-size: 10px; }
.btn-lg { padding: 18px 40px; font-size: 12px; }

.btn-ghost {
  border-color: rgba(26,50,48,0.2);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: transparent; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── LAYOUT HELPERS ─────────────────────────────────────────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  position: relative;
  z-index: 1;
}

.section     { padding: 100px 0; }
.section-sm  { padding: 60px 0; }
.section-lg  { padding: 140px 0; }

.page-top { padding-top: calc(var(--nav-h) + 60px); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.flex   { display: flex; }
.flex-c { display: flex; align-items: center; }
.flex-b { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mt-60 { margin-top: 60px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ─── SECTION HEADERS ────────────────────────────────────────────────────── */

.section-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.8;
}

/* ─── CARDS ──────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out), transform .3s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(31,107,104,0.35);
    box-shadow: var(--shadow-md);
  }
}

.card-sm { padding: 20px 24px; }

/* ─── DIVIDER ────────────────────────────────────────────────────────────── */

.divider {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 24px 0;
}

.divider-center { margin: 24px auto; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  padding: 12px 16px;
  outline: none;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(31,107,104,0.12);
}
/* These get the soft ring on focus, not the global keyboard outline */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible { outline: none; }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7A77' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-color: var(--surface2);
  padding-right: 36px;
  cursor: pointer;
}

.form-select option { background: var(--surface2); color: var(--text); }

.form-textarea { resize: vertical; min-height: 120px; }

.form-error { font-size: 12px; color: var(--error); margin-top: 6px; }
.form-hint  { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── ALERTS ─────────────────────────────────────────────────────────────── */

.alert {
  padding: 13px 16px;
  border: 1px solid;
  border-left-width: 3px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  animation: alertIn .28s var(--ease-out, ease) both;
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.alert-error   { border-color: var(--error);   background: rgba(192,57,43,.06);  color: var(--error); }
.alert-success { border-color: var(--success);  background: rgba(46,125,50,.06);  color: var(--success); }
.alert-info    { border-color: var(--gold);     background: rgba(31,107,104,.06); color: var(--gold); }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid;
}

.badge-gold    { border-color: var(--gold);    color: var(--gold); }
.badge-green   { border-color: var(--success); color: var(--success); }
.badge-red     { border-color: var(--error);   color: var(--error); }
.badge-muted   { border-color: var(--border);  color: var(--text-muted); }
.badge-hot     { border-color: #C0392B; color: #C0392B; }

/* ─── HERO ───────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Full-bleed background image */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1544367567-0f2fcb009e0b?w=1600&q=80&auto=format') center/cover no-repeat;
  transform: scale(1.04);
  transition: transform 8s ease;
}

/* Dark gradient overlay for text legibility */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(10,28,26,0.82) 0%, rgba(10,28,26,0.62) 45%, rgba(10,28,26,0.25) 100%);
}

.hero-bg.loaded { transform: scale(1); }

.hero-content { position: relative; z-index: 2; }

.hero-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.5);
}

.hero-title {
  font-size: clamp(2.6rem, 5.5vw, 5.2rem);
  font-weight: 300;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  color: #7ecac7;
}

.hero-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.78);
  max-width: 480px;
  line-height: 1.8;
  margin-bottom: 48px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Hero btn variant on dark bg */
.hero .btn:not(.btn-fill) {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.hero .btn:not(.btn-fill):hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ─── CLASS CARDS ────────────────────────────────────────────────────────── */

.class-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .class-card:hover {
    border-color: rgba(31,107,104,0.35);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }
}

.class-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.class-card-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
}

.class-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.class-card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.class-card-meta-item svg { opacity: .4; flex-shrink: 0; }

.class-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;          /* keep the Book button visible if it can't sit beside the price */
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-s);
  margin-top: auto;
}

.class-card-price {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--gold);
}

.spots-bar {
  height: 2px;
  background: var(--surface3);
  position: relative;
  overflow: hidden;
}

.spots-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--gold);
  transition: width .6s var(--ease-out);
}

.spots-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── MEMBERSHIP CARDS ───────────────────────────────────────────────────── */

.membership-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.membership-card.featured { border-color: var(--gold); }

.membership-card.featured::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: 14px; right: -28px;
  background: var(--gold);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 4px 36px;
  transform: rotate(45deg);
}

@media (hover: hover) and (pointer: fine) {
  .membership-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }
}

.membership-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text);
}

.membership-price {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--gold);
  margin: 8px 0;
}

.membership-price span {
  font-size: 1rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 300;
}

.membership-benefits {
  list-style: none;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.membership-benefits li {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.membership-benefits li::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */

.footer {
  background: var(--surface3);
  border-top: 1px solid var(--border);
  padding: 80px 0 40px;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border-s);
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 260px;
  margin-top: 16px;
  line-height: 1.8;
}

.footer-logo { display: inline-flex; align-items: center; }
.footer-logo img {
  width: 42px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
  scale: 3.2;
  transform-origin: left center;
  margin-left: 10px;
  filter: brightness(0) saturate(100%) invert(28%) sepia(40%) saturate(600%) hue-rotate(140deg) brightness(80%);
}

.footer-heading {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color .2s;
}

.footer-links a:hover { color: var(--gold); opacity: 1; }

.footer-social { display: flex; gap: 12px; margin-top: 20px; }

.footer-social a {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out), transform .2s var(--ease-out);
}

.footer-social a:hover { border-color: var(--gold); color: var(--gold); opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .footer-social a:hover { transform: translateY(-2px); }
}
.footer-social a:active { transform: scale(0.92); }
.footer-links a { transition: color .2s var(--ease-out); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ─── ANIMATIONS ─────────────────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fadeup  { animation: fadeUp .6s var(--ease-out) both; }
.animate-fadein  { animation: fadeIn .4s var(--ease-out) both; }
.delay-1 { animation-delay: .06s; }
.delay-2 { animation-delay: .12s; }
.delay-3 { animation-delay: .18s; }
.delay-4 { animation-delay: .24s; }
.delay-5 { animation-delay: .30s; }

/* ─── MOBILE DRAWER ──────────────────────────────────────────────────────── */

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.mobile-drawer.open { pointer-events: all; }

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20,38,36,.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .35s var(--ease-out);
}

.mobile-drawer.open .mobile-drawer-overlay { opacity: 1; }

.mobile-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 80px 32px 32px;
  transform: translateX(100%);
  transition: transform .4s var(--ease-drawer);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow-y: auto;
}

/* Stagger the drawer links in after the panel slides open */
.mobile-drawer-links a {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.mobile-drawer.open .mobile-drawer-links a { opacity: 1; transform: translateX(0); }
.mobile-drawer.open .mobile-drawer-links li:nth-child(1) a { transition-delay: .12s; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(2) a { transition-delay: .16s; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(3) a { transition-delay: .20s; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(4) a { transition-delay: .24s; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(5) a { transition-delay: .28s; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(6) a { transition-delay: .32s; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(7) a { transition-delay: .36s; }

.mobile-drawer.open .mobile-drawer-panel { transform: translateX(0); }

.mobile-drawer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.mobile-drawer-links a {
  display: block;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--text-muted);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-s);
}

.mobile-drawer-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  transition: color .2s var(--ease-out), transform .12s var(--ease-out);
}
.mobile-drawer-close:hover { color: var(--text); }
.mobile-drawer-close:active { transform: scale(0.9); }

/* ─── MODAL ──────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,38,36,.55);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: flex;
  flex-direction: column;    /* stack vertically so the overlay is the single scroll container */
  align-items: center;
  padding: 24px;
  overflow-y: auto;          /* the ONE scroll region — reliable in Safari, no nested scroll */
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-out);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

/* When a modal is open, freeze the page behind it so the scroll stays in the modal */
body.modal-open { overflow: hidden; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  max-width: 560px;
  width: 100%;
  margin: auto;              /* centers when there's room; the overlay scrolls when it's taller */
  flex-shrink: 0;            /* never squash the modal — let the overlay scroll instead (Safari fix) */
  position: relative;
  /* Modals stay centered (not anchored to a trigger) — scale + lift from center */
  transform: translateY(8px) scale(0.97);
  opacity: 0;
  transition: transform .3s var(--ease-drawer), opacity .3s var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .2s var(--ease-out), background .2s var(--ease-out), transform .12s var(--ease-out);
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-close:active { transform: scale(0.9); }

/* ─── TABS ───────────────────────────────────────────────────────────────── */

.tabs { display: flex; border-bottom: 1px solid var(--border); gap: 0; }

.tab-btn {
  padding: 12px 24px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .2s var(--ease-out), border-color .2s var(--ease-out);
  margin-bottom: -1px;
}

.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── FILTER PILLS ───────────────────────────────────────────────────────── */

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

.filter-pill {
  padding: 7px 16px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: color .2s var(--ease-out), border-color .2s var(--ease-out),
              background .2s var(--ease-out), transform .12s var(--ease-out);
}

.filter-pill:hover { border-color: var(--gold); color: var(--gold); }
.filter-pill:active { transform: scale(0.96); }
.filter-pill.active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ─── SCHEDULE TABLE ─────────────────────────────────────────────────────── */

.schedule-day-header {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 20px 0 12px;
  border-bottom: 1px solid var(--border-s);
  margin-bottom: 16px;
}

.schedule-day-header span { color: var(--gold); margin-left: 8px; }

/* ─── TESTIMONIALS ───────────────────────────────────────────────────────── */

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px 32px;
}

.testimonial-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 24px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
}

.testimonial-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.testimonial-title {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

/* ─── STARS ──────────────────────────────────────────────────────────────── */

.stars { color: var(--gold); font-size: 12px; margin-bottom: 16px; }

/* ─── TOAST ──────────────────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 32px; right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text);
  min-width: 280px;
  animation: toastIn .3s var(--ease-out) both;
  box-shadow: var(--shadow-md);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }

/* ─── HERO VIDEO / IMAGE ─────────────────────────────────────────────────── */

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

/* ─── DASHBOARD ──────────────────────────────────────────────────────────── */

.dash-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  min-height: calc(100vh - var(--nav-h));
}

.dash-sidebar {
  padding: 32px 0;
  border-right: 1px solid var(--border-s);
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.dash-nav { list-style: none; }

.dash-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--text-muted);
  transition: color .2s var(--ease-out), background .2s var(--ease-out);
}

.dash-nav-item a:hover,
.dash-nav-item a.active {
  color: var(--text);
  background: var(--surface2);
  opacity: 1;
}

.dash-nav-item a.active { color: var(--gold); }

.dash-main { padding: 40px 0; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px 28px;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--text);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── SECTION ALT BG ─────────────────────────────────────────────────────── */

/* Sections that previously used --surface now use a slightly off-white */
section[style*="background:var(--surface)"] {
  background: var(--surface) !important;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .container { padding: 0 32px; }
}

@media (max-width: 768px) {
  .nav { padding: 0 24px; }
  .nav-links, .nav-cta { display: none; }
  .nav-menu-btn { display: flex; }

  .container { padding: 0 24px; }
  .section { padding: 72px 0; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  /* Modals: tighter padding + full-height scroll on phones, and let wide
     content (tables) scroll sideways instead of overflowing the screen. */
  .modal-overlay { padding: 12px; }
  .modal { padding: 24px 20px; max-width: 100% !important; }
  .modal .admin-table-wrap,
  .modal [data-scroll-x] { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .dash-grid { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }

  .hero-title { font-size: clamp(2rem, 8vw, 3.2rem); }

  h2 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
}

@media (max-width: 480px) {
  .section { padding: 60px 0; }
  .hero-actions { flex-direction: column; }
  .btn-lg { padding: 16px 28px; }
}

/* ─── MOBILE: collapse inline grids the stylesheet can't otherwise reach ─────
   Pages set grid columns via inline style (higher specificity than a class),
   so these substring selectors stack them to a single column on phones.       */
@media (max-width: 720px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr auto"],
  [style*="grid-template-columns: 1fr auto"],
  [style*="grid-template-columns:auto 1fr"],
  [style*="grid-template-columns: auto 1fr"],
  [style*="grid-template-columns:1.5fr 1fr"],
  [style*="grid-template-columns:200px 1fr"],
  [style*="grid-template-columns: 200px 1fr"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* Tame oversized inline gaps once stacked */
  [style*="gap:40px"] { gap: 24px !important; }
  [style*="gap:48px"] { gap: 24px !important; }
}

/* Trim very large inline padding on small phones so content isn't cramped */
@media (max-width: 520px) {
  [style*="padding:40px 48px"] { padding: 28px 22px !important; }
  [style*="padding:48px"]      { padding: 28px !important; }
  [style*="padding:56px"]      { padding: 32px 24px !important; }
}

/* ─── REDUCED MOTION ─────────────────────────────────────────────────────────
   Keep opacity/colour transitions that aid comprehension; drop movement.      */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Neutralise position/scale shifts so nothing moves */
  .card:hover,
  .class-card:hover,
  .membership-card:hover,
  .footer-social a:hover,
  .btn:active,
  .filter-pill:active,
  .hero-bg,
  .hero-bg.loaded { transform: none !important; }

  .animate-fadeup,
  .animate-fadein,
  .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}
