/* ==========================================================================
   PEAK FITNESS ACADEMY — GLOBAL HEADER & FOOTER NAVIGATION
   Accessible, Responsive, SEO-Optimized Component Styles
   ========================================================================== */

/* --- Root & Header Variables --- */
:root {
  --nav-dark: #16171b;
  --nav-header-bg: rgba(22, 23, 27, 0.96);
  --nav-accent: #FF7350;
  --nav-accent-hover: #e85f3c;
  --nav-white: #ffffff;
  --nav-text-muted: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(255, 255, 255, 0.09);
  --nav-dropdown-bg: #1c1d22;
  --nav-dropdown-border: rgba(255, 255, 255, 0.12);
  --nav-footer-bg: #0f1013;
  --nav-footer-text: #a8aab4;
  --nav-footer-heading: #ffffff;
  --nav-footer-border: rgba(255, 255, 255, 0.08);
}

/* --- Skip Link for Accessibility --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--nav-accent);
  color: var(--nav-white);
  padding: 10px 18px;
  z-index: 9999;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 14px;
}

/* ==========================================================================
   1. GLOBAL STICKY HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  width: 100%;
}

.site-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* --- Site Logo --- */
.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
.site-logo img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}
.site-logo .brand-text {
  color: var(--nav-white);
  font-weight: 900;
  font-size: 1.28rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'Roboto', Arial, sans-serif;
  transition: color 0.2s ease;
}
.site-logo:hover .brand-text {
  color: var(--nav-accent);
}

/* --- Desktop Primary Navigation --- */
.site-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}
.nav-item {
  position: relative;
}

/* --- Nav Links & Dropdown Buttons --- */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--nav-accent);
  background-color: rgba(255, 255, 255, 0.05);
}
.nav-link:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}

/* Active states */
.nav-link[aria-current="page"],
.nav-link.is-active {
  color: var(--nav-accent);
  background-color: rgba(255, 115, 80, 0.1);
  font-weight: 700;
}
.nav-link.is-active-parent {
  color: var(--nav-accent);
  font-weight: 700;
}

/* Dropdown arrow icon */
.dropdown-chevron {
  width: 10px;
  height: 10px;
  transition: transform 0.25s ease;
  opacity: 0.8;
}
.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.is-open .dropdown-chevron,
.nav-dropdown:focus-within .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* --- Dropdown Menus (Desktop) --- */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--nav-dropdown-bg);
  border: 1px solid var(--nav-dropdown-border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  list-style: none;
  margin: 0;
  padding: 10px;
  z-index: 1010;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
  pointer-events: none;
}

/* Hover buffer to prevent accidental close */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

/* Show Dropdown on Hover, Focus-within, or Active Open Class */
.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown.is-open > .dropdown-menu,
.nav-dropdown:focus-within > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 2-Column Desktop Grid for Training Programs */
.dropdown-programs-menu {
  display: grid;
  grid-template-columns: repeat(2, 280px);
  gap: 6px;
  padding: 12px;
  left: -80px;
}

/* 1-Column Desktop Menu for About */
.dropdown-about-menu {
  width: 290px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Individual Dropdown Item */
.dropdown-link {
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  background: transparent;
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.dropdown-link:hover,
.dropdown-link:focus-visible {
  background-color: rgba(255, 115, 80, 0.12);
  transform: translateX(2px);
}
.dropdown-link:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 1px;
}
.dropdown-link .link-title {
  color: var(--nav-white);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  margin-bottom: 2px;
  transition: color 0.18s ease;
}
.dropdown-link:hover .link-title {
  color: var(--nav-accent);
}
.dropdown-link .link-desc {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  line-height: 1.3;
}
.dropdown-link[aria-current="page"],
.dropdown-link.is-active {
  background-color: rgba(255, 115, 80, 0.16);
  border-left: 3px solid var(--nav-accent);
}
.dropdown-link[aria-current="page"] .link-title,
.dropdown-link.is-active .link-title {
  color: var(--nav-accent);
}

/* --- Header Action Items (Contact CTA + Mobile Toggle) --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-accent);
  color: var(--nav-white);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 115, 80, 0.3);
}
.btn-header-cta:hover {
  background-color: var(--nav-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 115, 80, 0.42);
}
.btn-header-cta:focus-visible {
  outline: 2px solid var(--nav-white);
  outline-offset: 2px;
}
.btn-header-cta[aria-current="page"],
.btn-header-cta.is-active {
  background-color: var(--nav-accent-hover);
  box-shadow: 0 0 0 2px var(--nav-white);
}

/* --- Mobile Menu Toggle Button (Hamburger) --- */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 9px;
  cursor: pointer;
  color: var(--nav-white);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.mobile-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
.mobile-toggle:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}
.hamburger-box {
  width: 22px;
  height: 16px;
  display: inline-block;
  position: relative;
}
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 22px;
  height: 2px;
  background-color: var(--nav-white);
  border-radius: 2px;
  position: absolute;
  transition: transform 0.22s ease, top 0.22s ease, opacity 0.22s ease;
}
.hamburger-inner {
  top: 7px;
}
.hamburger-inner::before {
  content: "";
  top: -7px;
}
.hamburger-inner::after {
  content: "";
  top: 7px;
}

/* Hamburger active transformation */
.mobile-toggle[aria-expanded="true"] .hamburger-inner {
  background-color: transparent;
}
.mobile-toggle[aria-expanded="true"] .hamburger-inner::before {
  top: 0;
  transform: rotate(45deg);
  background-color: var(--nav-accent);
}
.mobile-toggle[aria-expanded="true"] .hamburger-inner::after {
  top: 0;
  transform: rotate(-45deg);
  background-color: var(--nav-accent);
}

/* ==========================================================================
   2. MOBILE DRAWER NAVIGATION
   ========================================================================== */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-drawer-backdrop.is-visible {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88%;
  max-width: 380px;
  background: var(--nav-dark);
  z-index: 1200;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-drawer.is-open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--nav-border);
}
.drawer-title {
  color: var(--nav-white);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.drawer-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--nav-white);
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.drawer-close:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--nav-accent);
  color: var(--nav-accent);
}
.drawer-close:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}

/* Drawer Body & Accordions */
.drawer-body {
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}
.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  color: var(--nav-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--nav-accent);
}
.mobile-nav-link[aria-current="page"],
.mobile-nav-link.is-active {
  background-color: rgba(255, 115, 80, 0.14);
  color: var(--nav-accent);
  font-weight: 700;
}
.mobile-nav-link.is-active-parent {
  color: var(--nav-accent);
  font-weight: 700;
}

/* Accordion Toggle Icon */
.mobile-accordion-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.25s ease;
}
.mobile-accordion-btn[aria-expanded="true"] .mobile-accordion-icon {
  transform: rotate(180deg);
}

/* Accordion Panel */
.mobile-accordion-panel {
  display: none;
  padding: 4px 0 8px 12px;
  margin-left: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}
.mobile-accordion-panel.is-open {
  display: block;
}
.mobile-sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-sub-link {
  display: block;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.92rem;
  border-radius: 6px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.mobile-sub-link:hover {
  background-color: rgba(255, 115, 80, 0.12);
  color: var(--nav-accent);
}
.mobile-sub-link[aria-current="page"],
.mobile-sub-link.is-active {
  color: var(--nav-accent);
  font-weight: 700;
  background-color: rgba(255, 115, 80, 0.15);
}

/* Drawer Bottom Actions */
.drawer-footer-actions {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-accent);
  color: var(--nav-white);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 14px rgba(255, 115, 80, 0.3);
}
.mobile-drawer-cta:hover {
  background-color: var(--nav-accent-hover);
}
.mobile-drawer-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  color: var(--nav-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.mobile-drawer-call:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--nav-accent);
  color: var(--nav-accent);
}

/* Lock body scroll when mobile drawer open */
body.mobile-nav-open {
  overflow: hidden !important;
}

/* ==========================================================================
   3. GLOBAL FOOTER
   ========================================================================== */
.site-footer {
  background: var(--nav-footer-bg);
  color: var(--nav-footer-text);
  padding: 68px 0 0;
  border-top: 1px solid var(--nav-footer-border);
  font-size: 0.94rem;
  line-height: 1.6;
}

.site-footer .wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- 4-Column Footer Grid --- */
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.15fr 0.95fr 1.25fr;
  gap: 44px;
  padding-bottom: 54px;
}

.footer-col h3 {
  color: var(--nav-footer-heading);
  font-size: 1.12rem;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 10px;
}
.footer-col h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 2px;
  background: var(--nav-accent);
  border-radius: 2px;
}

/* Col 1: About Peak Brand */
.footer-brand-title {
  color: var(--nav-white);
  font-size: 1.28rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}
.footer-desc {
  color: var(--nav-footer-text);
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.65;
}
.footer-inline-link {
  color: var(--nav-accent);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease, opacity 0.2s ease;
}
.footer-inline-link:hover {
  opacity: 0.9;
  gap: 8px;
}
.footer-inline-link:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}
.footer-social-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.footer-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c9ccd6;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.footer-social-btn svg {
  flex-shrink: 0;
  color: #1877f2;
}
.footer-social-btn:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
}
.footer-social-btn:hover svg {
  color: #ffffff;
}
.footer-social-btn--ig svg {
  color: #e1306c;
}
.footer-social-btn--ig:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: #e1306c;
  color: #ffffff;
}
.footer-social-btn--ig:hover svg {
  color: #ffffff;
}
.footer-social-btn:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}

/* Col 2 & 3: Link Lists */
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--nav-footer-text);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}
.footer-links a:hover {
  color: var(--nav-accent);
  transform: translateX(3px);
}
.footer-links a:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}
.footer-links a[aria-current="page"] {
  color: var(--nav-accent);
  font-weight: 700;
}

/* Col 4: Contact & Location Info */
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 0.92rem;
}
.footer-contact-icon {
  width: 18px;
  height: 18px;
  color: var(--nav-accent);
  flex-shrink: 0;
  margin-top: 3px;
}
.footer-contact-item a {
  color: var(--nav-footer-text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-contact-item a:hover {
  color: var(--nav-accent);
}
.footer-contact-item a:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}
.footer-map-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--nav-accent) !important;
  font-weight: 600;
  font-size: 0.85rem;
}
.footer-cta-box {
  margin-top: 14px;
}
.btn-footer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-accent);
  color: var(--nav-white);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(255, 115, 80, 0.25);
}
.btn-footer-cta:hover {
  background-color: var(--nav-accent-hover);
  transform: translateY(-1px);
}
.btn-footer-cta:focus-visible {
  outline: 2px solid var(--nav-white);
  outline-offset: 2px;
}

/* --- Footer Bottom Bar --- */
.footer-bottom {
  border-top: 1px solid var(--nav-footer-border);
  padding: 24px 0;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-bottom p {
  margin: 0;
  color: #7b7e88;
  font-size: 0.88rem;
}
.footer-bottom a {
  color: #9da0ac;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}
.footer-bottom a:hover {
  color: var(--nav-accent);
}
.footer-bottom a:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 2px;
}
.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.legal-sep {
  color: #4c4e5a;
  font-size: 0.75rem;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* --- Tablet / Desktop Breakpoint (< 1060px) --- */
@media (max-width: 1060px) {
  .site-nav {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .dropdown-programs-menu {
    left: auto;
    right: 0;
  }
}

/* --- Tablet Footer (< 992px) --- */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
}

/* --- Mobile Breakpoint (< 640px) --- */
@media (max-width: 640px) {
  .site-header-inner {
    padding: 10px 16px;
    gap: 12px;
  }
  .site-logo img {
    height: 40px;
  }
  .site-logo .brand-text {
    font-size: 1.1rem;
  }
  .btn-header-cta {
    display: none; /* Accessible in mobile drawer */
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}
