/* ============================================================
   THE ATHLETE FACTORY — shared.css
   All pages link to this file. Page-specific overrides go
   in a <style> block inside each page's <head>.
   ============================================================ */

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ===========================
   CSS VARIABLES
=========================== */
:root {
  --navy:      #0d1f35;
  --navy-lt:   #162d4e;
  --accent:    #8f9aab;
  --accent-lt: #b8c1cc;
  --white:     #ffffff;
  --off-white: #f4f5f7;
  --light:     #edf0f3;
  --mid:       #6b7280;
  --dark:      #111111;
  --border:    #dde1e7;
  --radius:    6px;
  --transition: 0.25s ease;
  /* Legacy aliases — keep for compatibility */
  --gold:      #8f9aab;
  --gold-lt:   #b8c1cc;
}

/* ===========================
   UTILITY
=========================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section-header { margin-bottom: 44px; }
.section-header.centered { text-align: center; }

.section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.5rem;
}
.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  text-transform: uppercase;
}
.section-title.light { color: var(--white); }
.section-body {
  font-size: 16px;
  color: #444;
  max-width: 620px;
  line-height: 1.75;
}
.section-body.light { color: rgba(255,255,255,0.82); }
.btn {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 13px 30px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border: 2px solid transparent;
}
.btn-gold { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-gold:hover { background: var(--accent-lt); border-color: var(--accent-lt); }
.btn-outline-white { background: transparent; color: var(--white); border-color: var(--white); }
.btn-outline-white:hover { background: var(--white); color: var(--navy); }
.btn-outline-navy { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-lt); border-color: var(--navy-lt); }
.btn-member-login { background: var(--mid); color: var(--white); border-color: var(--mid); }
.btn-member-login:hover { background: #555c6a; border-color: #555c6a; }
.desktop-only { display: inline-block; }
@media (max-width: 768px) { .desktop-only { display: none !important; } }

/* ===========================
   TOP BAR
=========================== */
#topbar {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  height: 36px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
#topbar a { color: rgba(255,255,255,0.75); transition: color var(--transition); }
#topbar a:hover { color: var(--accent-lt); }
.topbar-left { display: flex; gap: 20px; align-items: center; }
.topbar-right { display: flex; gap: 16px; align-items: center; }
.topbar-social { display: flex; gap: 12px; }
.topbar-social a { font-size: 14px; }

/* ===========================
   MAIN NAV
=========================== */
#main-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: box-shadow var(--transition);
}
#main-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.10); }
/* Push page content down to account for fixed nav (~70px) + topbar (~37px) */
body { padding-top: 108px; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo span { color: var(--navy); }
.nav-logo-icon {
  width: 42px; height: 42px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.nav-links li { position: relative; }
.nav-links a {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  padding: 8px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a:hover,
.nav-links a.active { background: var(--light); color: var(--navy-lt); border-bottom: 2px solid var(--navy); }
.nav-links .has-dropdown > a::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.6;
  margin-left: 3px;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 6px 0;
}
/* Invisible bridge fills the gap between nav item and dropdown */
.nav-links .has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
}
.nav-links .has-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 12px;
  border-radius: 0;
  color: var(--navy);
}
.dropdown-menu a:hover { background: var(--light); color: var(--navy); }
.nav-cta { margin-left: 6px; }
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--navy);
  transition: all var(--transition);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  display: block;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  background: var(--navy);
  z-index: 2000;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  visibility: hidden;
}
.mobile-nav-drawer.open { transform: translateX(0); visibility: visible; }
.mobile-nav-overlay {
  display: block;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-nav-overlay.open { opacity: 1; pointer-events: all; }
.mobile-drawer-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.7); font-size: 24px;
  margin-bottom: 24px; display: block;
}
.mobile-nav-links { list-style: none; }
.mobile-nav-links li { border-bottom: 1px solid rgba(255,255,255,0.08); }
.mobile-nav-links a {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 14px 4px;
  transition: color var(--transition);
}
.mobile-nav-links a:hover { color: var(--accent); }
.mobile-nav-cta { margin-top: 24px; display: block; width: 100%; text-align: center; }

/* ===========================
   PAGE SUB-NAV
   Hidden by default — enable per page with:
   <style>#sub-nav { display: block; }</style>
=========================== */
#sub-nav {
  display: none;
  background: var(--off-white);
  border-bottom: 2px solid var(--border);
  padding: 0;
}
.sub-nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav-inner::-webkit-scrollbar { display: none; }
.sub-nav-label {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  padding: 12px 20px 12px 0;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}
.sub-nav-inner a {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.sub-nav-inner a:hover,
.sub-nav-inner a.active { color: var(--navy); border-bottom-color: var(--navy); }

/* ===========================
   FOOTER
=========================== */
#footer {
  background: var(--navy);
  padding: 64px 0 0;
  color: rgba(255,255,255,0.7);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand-logo span { color: var(--gold); }
.footer-brand-logo .nav-logo-icon { width: 36px; height: 36px; font-size: 15px; }
.footer-brand p {
  font-size: 14px;
  line-height: 1.75;
  max-width: 280px;
  margin-bottom: 20px;
}
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  transition: background var(--transition), color var(--transition);
}
.footer-social a:hover { background: var(--accent); color: var(--navy); }
.footer-col h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  font-size: 14px;
  color: rgba(255,255,255,0.62);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--accent); }
.footer-address {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
}
.footer-address strong {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  margin-bottom: 4px;
}
.footer-bottom {
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.footer-bottom a {
  color: rgba(255,255,255,0.4);
  transition: color var(--transition);
}
.footer-bottom a:hover { color: var(--accent); }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-accent-bar {
  height: 4px;
  background: linear-gradient(to right, var(--navy) 0%, var(--accent) 50%, var(--navy) 100%);
}

/* ===========================
   SCROLL-TO-TOP BUTTON
=========================== */
#scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px; height: 44px;
  background: var(--navy);
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 500;
}
#scroll-top.visible { opacity: 1; pointer-events: all; }
#scroll-top:hover { transform: translateY(-3px); }

/* ===========================
   RESPONSIVE — TABLET & MOBILE
=========================== */
@media (max-width: 960px) {
  .about-grid,
  .facility-grid,
  .community-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }

  .about-image-wrap { order: -1; }
  .community-image-wrap { order: -1; }

  .programs-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .faq-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero-stats { display: none; }
}

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; z-index: 1100; position: relative; }
  .nav-inner { position: relative; }

  .topbar-address { display: inline; }
  .topbar-phone { font-size: 11px; }
  .topbar-right { display: none; }
  .topbar-left { flex-direction: row; justify-content: space-between; width: 100%; font-size: 11px; gap: 0; }

  .programs-grid { grid-template-columns: 1fr; }
  .program-card { min-height: 320px; }
  .program-card .program-card-body { max-height: 120px; }

  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }

  #about, #programs, #stats-banner, #facility, #community, #faq, #contact { padding: 64px 0; }
  .about-badge { bottom: -8px; left: 8px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(36px, 10vw, 56px); }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .sub-nav-label { display: none; }
}

/* ===========================
   ANIMATION — scroll reveal
=========================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
