/* ==========================================================================
   4. NAVIGATION (HEADER)
   ========================================================================== */
body > header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
}

.logo {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--text-dark);
  text-decoration: none;
  z-index: 1001;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 400;
}

.nav-links a:hover {
  color: var(--accent-purple);
}

/* Hamburger Button für Mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1001;
  padding: 5px;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text-dark);
  transition: var(--transition);
}




@media (max-width: 768px) { 
    /* Mobile Navigation */
  .hamburger {
    display: flex;
    z-index: 10001 !important;
  }
  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    padding: 6rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    transition: right 0.4s ease-in-out;
    z-index: 10000 !important; 

  }
  .nav-links.active {
    right: 0;
  }
  .nav-links a {
    font-size: 1.1rem;
  }
  .hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ==========================================================================
   14. SEITEN-ANPASSUNGEN (Für Multi-Page Betrieb)
   ========================================================================== */
/* Aktiver Navigationspunkt */
.nav-links a.active-nav {
  color: var(--accent-purple) !important;
  font-weight: 600;
  position: relative;
}

/* Eleganter Unterstrich (nur auf Desktop) */
@media (min-width: 769px) {
  .nav-links a.active-nav::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-purple);
    border-radius: 2px;
  }
}

.page-header {
  text-align: center;
  /* Mehr Abstand nach oben (4.5rem statt 3rem) für eine saubere Optik */
  padding: 4.5rem 2rem 1.5rem;
  background: linear-gradient(180deg, var(--primary-pastel) 0%, rgba(247, 244, 252, 0) 100%);
  /* Perfekter Ausgleich zur Höhe der fixierten Navigation */
  margin-top: -4rem; 
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 2px;
}

/* ==========================================================================
   4b. DROPDOWN NAVIGATION (Desktop & Mobile)
   ========================================================================== */
.dropdown {
  position: relative;
}

/* Das versteckte Untermenü auf Desktop */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  list-style: none;
  padding: 0.5rem 0;
  min-width: 180px;
  box-shadow: 0 10px 25px rgba(179, 156, 208, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 1100;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  text-align: center;
  color: var(--text-dark);
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background-color: rgba(232, 223, 245, 0.3);
  color: var(--accent-purple) !important;
}

/* Zeigt das Menü beim Hovern auf Desktop */
@media (min-width: 769px) {
  .dropdown:hover .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
}

/* Spezielles Layout für Smartphones (Mobile) */
@media (max-width: 768px) {
  .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background-color: transparent;
    opacity: 1;
    pointer-events: auto;
    display: none; /* Wird per JS getoggelt */
    padding-left: 1.5rem;
    text-align: left;
  }
  
  .dropdown-menu a {
    text-align: left;
    padding: 0.5rem 0;
    font-size: 1.1rem;
  }

  /* Wenn das mobile Dropdown aktiv ist */
  .dropdown.open .dropdown-menu {
    display: block;
  }
}

/* Eleganter Unterstrich für den aktiven Punkt (nur auf Desktop) */
@media (min-width: 769px) {
  .nav-links a.active-nav::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-purple);
    border-radius: 2px;
  }
  
  /* Verhindert, dass die Unterlinks IM Dropdown-Fenster ebenfalls einen Unterstrich bekommen (das sähe unruhig aus) */
  .dropdown-menu a.active-nav::after {
    display: none;
  }
}

@media (max-width: 768px) {
  /* 1. HEADER-CONTAINER FLEX-DIRECTION ÄNDERN 
     Zwingt den Hamburger/das Kreuz, über dem Logo-Schriftzug zu stehen */
  .nav-links {
    overflow-y: auto;
    max-height: 100vh;
  }

  /* 2. ZARTE TRENNLINIEN FÜR DIE NAV-LINKS */
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(179, 156, 208, 0.5); /* Pastell-violette Trennlinie */
  }

  /* Entfernt die Trennlinie beim allerletzten Punkt (Kontakt) für ein sauberes Ende */
  .nav-links li:last-child {
    border-bottom: none;
  }

  /* Sorgt dafür, dass die Links schön atmen können */
  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.8rem 0; /* Vergrößert die Klickfläche */
    font-size: 1.2rem;
  }

  /* Verhindert, dass die Unterpunkte im Dropdown eine eigene dicke Linie bekommen, 
     sondern rückt sie stattdessen dezent ein */
  .dropdown-menu li {
    border-bottom: none;
    padding-left: 1rem;
  }
}

@media (max-width: 768px) {

  /* --- 1. TRENNLINIEN FÜR DIE HAUPTPUNKTE --- */
  .nav-links > li {
    width: 100%;
    /* Dezente Pastell-Linie mit exakt 0.5 Opacity */
    border-bottom: 1px solid rgba(179, 156, 208, 0.5); 
  }

  /* Entfernt die Linie beim allerletzten Hauptpunkt (Kontakt) */
  .nav-links > li:last-child {
    border-bottom: none;
  }

  /* --- 2. TRENNLINIEN FÜR DIE DROPDOWN-UNTERPUNKTE --- */
  .dropdown-menu li {
    width: 100%;
    /* Ein Stück nach rechts eingerückt, damit man sieht, dass es Unterpunkte sind */
    padding-left: 1rem; 
    /* Eigene Trennlinie für jeden Unterpunkt mit 0.5 Opacity */
    border-bottom: 1px solid rgba(179, 156, 208, 0.5);
  }

  /* Entfernt die Linie beim letzten Unterpunkt (Online-Bücherei) innerhalb des Dropdowns */
  .dropdown-menu li:last-child {
    border-bottom: none;
  }

  /* --- 3. SPACING & SCHRIFT FÜR DIE LINKS --- */
  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.8rem 0;
    font-size: 1.2rem;
  }

  /* Schafft etwas Luft zwischen dem Hauptpunkt "Kreationen" und dem ersten Unterpunkt */
  .dropdown-menu {
    margin-top: 0.25rem;
  }
}