/* ══════════════════════════════════════════════════════════════════════
   NAVBAR — the one description of how the bar looks.

   The navbar was copy-pasted into a dozen pages and had already drifted
   into two generations: index/contact/profile on a 76px bar with the
   current type, and services/gallery/program and friends still on an
   older, taller one whose logo wrapped onto two lines on a phone and
   whose call-to-action button ate half the width.

   This file is linked AFTER each page's own <style>, so for rules of
   equal weight it simply wins on order — no !important needed except
   where a page reaches for a heavier selector.

   Behaviour (progress line, section marker, small-screen menu) lives in
   navbar-ui.js.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --nav-h: 76px;
  --nav-bg: rgba(20, 20, 20, 0.82);
  --nav-bg-solid: rgba(20, 20, 20, 0.97);
  --nav-line: rgba(255, 255, 255, 0.08);
  --nav-ink: rgba(255, 255, 255, 0.62);
}

.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
  padding: 0; margin: 0;
  display: flex; align-items: center;
}
/* On scroll the bar goes solid, and that is the whole edge. The 1px rule that
   used to appear here ran the full width and read as a second line beside the
   marker that tracks the section you are in. */
.navbar.scrolled { background: var(--nav-bg-solid); border-bottom-color: transparent; }

/* Older pages put the contents straight into .navbar with no inner wrapper */
.nav-inner {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 30px;
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.4rem;
}
.navbar > .logo:first-child { margin-left: max(30px, calc((100% - 1200px) / 2 + 30px)); }
.navbar > .logo:first-child ~ * { margin-right: 0; }

/* ── logo ─────────────────────────────────────────────────────────── */
.logo {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  text-decoration: none; color: #fff;
  font-family: var(--display, 'Poppins', sans-serif);
  font-weight: 700; font-size: 1.24rem;
  letter-spacing: -0.01em; text-transform: none;
  white-space: nowrap;               /* stops "NOVAFIT GYM" folding in two */
  line-height: 1;
}
.logo img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.logo span { font: inherit; letter-spacing: inherit; }

/* ── links ────────────────────────────────────────────────────────── */
.nav-links {
  list-style: none; display: flex; align-items: center; gap: 2rem;
  margin: 0; padding: 0;
}
.nav-links li { list-style: none; }
.nav-links a {
  color: var(--nav-ink); text-decoration: none;
  font-family: var(--body, 'Inter', sans-serif);
  font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: color .18s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--orange, #FF4A17); }
/* navbar-ui.js draws the marker under the current link, so a second rule
   underneath it would only be a duplicate */
.nav-links a.active { border-bottom: none; padding-bottom: 0; }

/* ── right-hand side ──────────────────────────────────────────────── */
.nav-right { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }

.login-signup-btn, .back-button a {
  /* a fill carrying a 12px label needs 4.5:1 with white, which the brand
     orange does not reach — see --accent-fill on each themed page */
  background: var(--accent-fill, var(--orange, #FF4A17)); color: #fff; border: 1.5px solid transparent;
  padding: 11px 20px; border-radius: 0;
  font-family: var(--body, 'Inter', sans-serif);
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 9px;
  transition: background .18s, transform .18s;
}
.login-signup-btn:hover, .back-button a:hover {
  background: var(--accent-fill-2, var(--orange-2, #E03A0A)); color: #fff; transform: translateY(-2px);
}
.profile-section { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.profile-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--orange, #FF4A17); }
.profile-name {
  font-family: var(--body, 'Inter', sans-serif);
  font-size: 0.85rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}

/* The menu button navbar-ui.js adds on pages that had none. Hidden until the
   links collapse — see the media query below. */
.nav-burger {
  display: none; background: none; border: none; color: #fff;
  font-size: 1.2rem; line-height: 1; cursor: pointer;
  padding: 7px 9px; border-radius: 8px; margin-left: 2px;
}
.nav-burger:hover { color: var(--orange, #FF4A17); }
.nav-burger:focus-visible { outline: 2px solid var(--orange, #FF4A17); outline-offset: 2px; }
/* A page's own toggle follows the same rule, so both appear at one width */
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.25rem; cursor: pointer; padding: 6px; }

/* ── small screens ────────────────────────────────────────────────── */
/* The pages used to collapse at three different widths — 620, 700 and 768 —
   and most of them collapsed the links without offering anything in their
   place. One breakpoint now, and the panel below is what replaces them. */
@media (max-width: 900px) {
  .nav-inner { padding: 0 18px; gap: 0.7rem; }
  .navbar > .logo:first-child { margin-left: 18px; }
  .logo { font-size: 1.05rem; }
  .logo img { width: 30px; height: 30px; }

  /* The label is what makes this button wrap; the icon still says enough */
  .login-signup-btn span, .back-button a span { display: none; }
  .login-signup-btn, .back-button a { padding: 10px 13px; gap: 0; }

  .profile-name { max-width: 92px; }

  /* The panel. Opened either by a page's own toggle or by the button
     navbar-ui.js adds — both do it by putting .open on this list. */
  .nav-links {
    position: fixed; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #141414;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    padding: 0.4rem 20px 1.2rem;
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    box-shadow: 0 18px 30px -22px rgba(0, 0, 0, 0.9);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block; width: 100%; padding: 14px 2px;
    font-size: 0.95rem; letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  /* The base rule zeroes padding-bottom on the current page's link to kill a
     stray underline; inside the panel that would leave one row sitting tighter
     than its neighbours */
  .nav-links a.active { padding: 14px 2px; }
  .nav-links li:last-child a { border-bottom: none; }

  .nav-toggle, .nav-burger { display: block; }
}
@media (max-width: 420px) {
  .logo { font-size: 0.98rem; }
  .profile-name { display: none; }
}
