/* ===================================================================
   Navigationsleiste – für ALLE Seiten verbindlich.

   Diese Datei wird als letzte im <head> eingebunden und überschreibt
   damit abweichende Regeln, die in einzelnen Seiten stehen. So sieht
   die Leiste überall identisch aus und springt beim Seitenwechsel nicht.

   Pro Seite wechseln nur zwei Dinge:
     - der aktive Menüpunkt (class="on" bzw. aria-current="page")
     - der Zusatz an der Wortmarke auf /vereine und /studios
   =================================================================== */

/* Unabhaengig vom Reset der jeweiligen Seite rechnen */
nav, nav *, nav *::before, nav *::after { box-sizing: border-box; }
nav { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
      "Helvetica Neue", Helvetica, Arial, sans-serif; }

nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
nav .nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 22px;
  height: 48px; display: flex; align-items: center; justify-content: space-between;
}

/* Wortmarke */
nav .brand {
  display: inline-flex; align-items: baseline;
  font-weight: 600; font-size: 19px; letter-spacing: -0.02em;
  color: #1d1d1f; text-decoration: none;
}
nav .brand:hover { text-decoration: none; }
nav .brand .wm { height: 24px; width: auto; display: block; }

/* Segmentzusatz (nur auf /vereine und /studios) */
nav .brand .brand-seg {
  margin-left: 2px; font-size: 21px; font-weight: 400; line-height: 1;
  color: #6e6e73; letter-spacing: -0.02em; white-space: nowrap; text-decoration: none;
}

/* Menüpunkte */
nav .nav-links { display: flex; gap: 22px; align-items: center; }
nav .nav-links a {
  color: #1d1d1f; font-size: 14px; opacity: 0.85;
  text-decoration: none; font-weight: 400;
  /* Laufweite und Schriftglaettung festschreiben, damit die Punkte auf
     jeder Seite exakt gleich breit sind */
  letter-spacing: -0.16px;
  -webkit-font-smoothing: antialiased;
}
nav .nav-links a:hover { opacity: 1; text-decoration: none; }

/* Aktive Seite – beide Schreibweisen */
nav .nav-links a.on,
nav .nav-links a[aria-current="page"] { color: #1d1d1f; font-weight: 600; opacity: 1; }

/* Schaltfläche „Kostenlos testen" */
nav .nav-links .nav-cta {
  background: #f40a12; color: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 14px; font-weight: 600; line-height: 1; opacity: 1;
}
nav .nav-links .nav-cta:hover { background: #c30910; color: #fff; text-decoration: none; }

/* Jeder Menüpunkt belegt immer die Breite der fetten Schrift. Dadurch
   verschiebt sich die Leiste nicht, wenn auf einer anderen Seite ein
   anderer Punkt fett markiert ist. */
@media (min-width: 981px) {
  nav .nav-links a { display: inline-flex; flex-direction: column; align-items: center; }
  nav .nav-links a::after {
    content: attr(data-text);
    font-weight: 600; letter-spacing: inherit;
    height: 0; overflow: hidden; visibility: hidden; pointer-events: none;
  }
  /* Die Schaltflaeche wird nie fett und braucht keine Reservierung */
  nav .nav-links a.nav-cta { display: inline-block; }
  nav .nav-links a.nav-cta::after { content: none; }
}

/* Klappschalter */
nav .nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  width: 40px; height: 40px; align-items: center; justify-content: center;
}
nav .nav-toggle span, nav .nav-toggle span::before, nav .nav-toggle span::after {
  content: ""; display: block; position: relative;
  width: 20px; height: 2px; background: #1d1d1f; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
nav .nav-toggle span::before { position: absolute; top: -6px; }
nav .nav-toggle span::after  { position: absolute; top: 6px; }
nav.nav-open .nav-toggle span { background: transparent; }
nav.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
nav.nav-open .nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

/* Der Zusatz braucht Luft neben dem Menü – wird es eng, entfällt er.
   Welche Seite aktiv ist, zeigt ohnehin der fette Menüpunkt. */
@media (max-width: 1340px) {
  nav .brand .brand-seg { display: none; }
}

/* Klappmenü */
@media (max-width: 980px) {
  nav .nav-toggle { display: inline-flex; }
  nav .nav-inner { flex-wrap: wrap; height: auto; min-height: 48px; }
  nav .nav-links {
    display: none; flex-basis: 100%; width: 100%; order: 3;
    flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  nav.nav-open .nav-links { display: flex; }
  nav .nav-links a {
    padding: 13px 4px; font-size: 16px; opacity: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  nav .nav-links a:last-child { border-bottom: 0; }
  nav .nav-links .nav-cta {
    align-self: flex-start; margin: 12px 4px 6px;
    padding: 10px 16px; font-size: 15px; border-bottom: 0;
  }
}
