/*
 * navigation.css
 * ─────────────────────────────────────────────────────────────────
 * Stile für Header und Hauptnavigation.
 * Mobile First:
 *   – Mobil: Logo + Hamburger-Knopf, Menü klappt vertikal aus
 *   – Tablet (768px+): Alle Links horizontal in einer Zeile
 *   – Desktop (1024px+): Mehr Platz, größere Abstände
 * ─────────────────────────────────────────────────────────────────
 */


/* ════════════════════════════════════════
   HEADER-CONTAINER
════════════════════════════════════════ */

.site-header {
  background-color: var(--weiss);
  box-shadow: var(--schatten-header);
  position: sticky;
  top: 0;
  z-index: 200;   /* liegt über allen Seiteninhalten */
  width: 100%;
}

.header-innen {
  max-width: var(--max-breite);
  margin: 0 auto;
  padding: 0 var(--aussen-mobil);
  height: var(--header-hoehe);   /* 70px */
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

@media (min-width: 768px) {
  .header-innen {
    padding: 0 var(--aussen-tablet);
  }
}

@media (min-width: 1024px) {
  .header-innen {
    padding: 0 var(--aussen-desktop);
    height: 80px;
  }
}


/* ════════════════════════════════════════
   TEXT-LOGO
════════════════════════════════════════ */

.site-logo {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: var(--ls-logo);
  text-transform: uppercase;
  color: var(--schwarz);
  text-decoration: none;
  flex-shrink: 0;   /* Logo wird niemals gestaucht */
  transition: opacity var(--transition-standard);
}

.site-logo:hover,
.site-logo:focus {
  opacity: 0.65;
}

@media (min-width: 768px) {
  .site-logo {
    font-size: 14px;
  }
}


/* ════════════════════════════════════════
   HAMBURGER-KNOPF (nur auf Mobil sichtbar)
════════════════════════════════════════ */

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 2px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-strich {
  display: block;
  width: 24px;
  height: 1.5px;
  background-color: var(--schwarz);
  transform-origin: center;
  transition:
    transform var(--transition-standard),
    opacity var(--transition-standard);
}

/* Animation: Hamburger → X wenn Menü offen */
.menu-toggle[aria-expanded="true"] .hamburger-strich:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger-strich:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded="true"] .hamburger-strich:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Ab Tablet: Hamburger ausblenden */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}


/* ════════════════════════════════════════
   NAVIGATIONMENÜ – MOBIL (ausgeklappt)
════════════════════════════════════════ */

.haupt-navigation {
  /* Mobil: standardmäßig versteckt */
  display: none;
  position: absolute;
  top: var(--header-hoehe);   /* direkt unter dem Header */
  left: 0;
  right: 0;
  background-color: var(--weiss);
  border-top: 1px solid var(--trennlinie);
  border-bottom: 1px solid var(--trennlinie);
  padding: 24px var(--aussen-mobil);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Sanfte Ein-/Ausblend-Animation */
  animation: menue-einklappen 0.2s ease forwards;
}

.haupt-navigation.ist-offen {
  display: block;
  animation: menue-ausklappen 0.25s ease forwards;
}

@keyframes menue-ausklappen {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Menü-Liste (ul) */
.nav-liste {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Einzelner Menüpunkt */
.nav-liste > li > a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: var(--ls-navigation);
  text-transform: uppercase;
  color: var(--schwarz);
  text-decoration: none;
  border-bottom: 1px solid var(--trennlinie-hell);
  transition: opacity var(--transition-standard);
}

.nav-liste > li:last-child > a {
  border-bottom: none;
}

.nav-liste > li > a:hover,
.nav-liste > li > a:focus {
  opacity: 0.55;
}

/* Aktive Seite hervorheben */
.nav-liste > li.current-menu-item > a,
.nav-liste > li.current_page_item > a {
  opacity: 0.5;
}


/* ════════════════════════════════════════
   NAVIGATIONSMENÜ – TABLET (768px+)
════════════════════════════════════════ */

@media (min-width: 768px) {

  .haupt-navigation {
    display: flex !important;   /* immer sichtbar, kein Ausklappen */
    position: static;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    animation: none;
  }

  .nav-liste {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .nav-liste > li > a {
    padding: 6px 0;
    border-bottom: none;
    font-size: 11px;
    position: relative;
  }

  /* Unterstrich-Animation beim Hover */
  .nav-liste > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--schwarz);
    transition: width var(--transition-standard);
  }
  .nav-liste > li > a:hover::after,
  .nav-liste > li.current-menu-item > a::after,
  .nav-liste > li.current_page_item > a::after {
    width: 100%;
  }

  /* Aktive Seite: volle Deckkraft + Unterstrich */
  .nav-liste > li.current-menu-item > a,
  .nav-liste > li.current_page_item > a {
    opacity: 1;
  }
}


/* ════════════════════════════════════════
   NAVIGATIONSMENÜ – DESKTOP (1024px+)
════════════════════════════════════════ */

@media (min-width: 1024px) {

  .nav-liste {
    gap: 36px;
  }

  .nav-liste > li > a {
    font-size: 12px;
    letter-spacing: 0.18em;
  }
}
