/* =========================================================
   BP Labs – Navigation: Untermenü unter "KI-Wissen"
   Ergänzt style.css, ändert style.css nicht.
   ========================================================= */

.nav-links .has-sub { position: relative; }

/* Kleiner Pfeil am Menüpunkt mit Untermenü */
.nav-links .has-sub > a::after {
  content: "▾";
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted-2);
}

/* Unsichtbare Brücke, damit das Untermenü beim Hinunterfahren mit der Maus nicht zugeht */
.nav-links .has-sub::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
}

.subnav {
  position: absolute;
  top: calc(100% + 18px);
  left: -16px;
  min-width: 280px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: var(--navy-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 110;
}

.has-sub:hover > .subnav,
.has-sub:focus-within > .subnav {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.subnav li { margin: 0; }
.subnav a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #C7D3E2;
}
.subnav a:hover,
.subnav a.active {
  background: var(--orange-soft);
  color: var(--white);
}

/* Smartphone / Tablet: Menü klappt auf, Untermenü steht eingerückt darunter */
@media (max-width: 980px) {
  .site-header .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-darker);
    border-bottom: 1px solid var(--border-soft);
    padding: 20px 24px;
    gap: 16px;
  }
  .site-header .nav-links.open .has-sub::after { display: none; }
  .site-header .nav-links.open .has-sub > a::after { display: none; }
  .site-header .nav-links.open .subnav {
    position: static;
    min-width: 0;
    margin-top: 8px;
    padding: 0 0 0 14px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .site-header .nav-links.open .subnav a { padding: 8px 12px; }
}
