/* ===== header-nav-overrides.css — FINAL ===== */

/* Rechte Leiste: Buttons + Toggler */
.navbar.custom-justify-between { justify-content: space-between; }
.navbar .right-rail { display: flex; align-items: center; margin-left: auto; }
.navbar .right-rail .navbar-toggler { margin-left: 1.5rem; }

/* Buttons im normalen Flow (Größe unverändert) */
#login, #searchbutton { position: static; top: auto; right: auto; }
#login { margin-right: .5rem; }
#login i, #searchbutton i { vertical-align: middle; }
#searchbutton { color: #fff; }

/* Desktop: kein Zeilenumbruch der Menüpunkte */
@media (min-width: 992px) {
  nav.navbar .navbar-nav { flex-wrap: nowrap; }
}

/* <=1200px: Hamburger-Modus – sofort vertikal, bündig, sauberes Hover */
@media (max-width: 1200px) {
  /* Früher kollabieren und Toggler anzeigen */
  nav.navbar.custom-justify-between.navbar-expand-lg .navbar-toggler { display: block !important; }
  nav.navbar.custom-justify-between.navbar-expand-lg .navbar-collapse.collapse:not(.show) { display: none !important; }

  /* Home-Icon außen zeigen, internes ausblenden */
  nav.navbar .d-lg-none#logo { display: inline-flex !important; }
  nav.navbar .d-none.d-lg-block#logo { display: none !important; }

  /* Beim Öffnen (inkl. Übergang) immer vertikal stapeln */
  nav.navbar.custom-justify-between.navbar-expand-lg .navbar-collapse.show,
  nav.navbar.custom-justify-between.navbar-expand-lg .navbar-collapse.collapsing {
    display: block !important;
    width: 100%;
  }

  /* Bündig links unter dem Home-Icon + deterministische Abstände */
  nav.navbar.custom-justify-between .navbar-collapse { padding-left: 0; }
  nav.navbar.custom-justify-between .navbar-collapse .navbar-nav {
    flex-direction: column !important;
    align-items: flex-start;
    width: 100%;
    margin-top: .95rem;      /* Abstand Home -> erster Menüpunkt */
    margin-bottom: 0;
    padding-left: 0;
    gap: 0;                  /* wir steuern die Abstände selbst */
  }
  /* Alle LI/Dropdown-Margins neutralisieren */
  nav.navbar.custom-justify-between .navbar-collapse .navbar-nav .nav-item,
  nav.navbar.custom-justify-between .navbar-collapse .navbar-nav .dropdown {
    margin: 0 !important;
  }
  /* Einheitlicher Abstand zwischen JEDEM Nachbarn (z.B. auch Industrie <-> Presse) */
  nav.navbar.custom-justify-between .navbar-collapse .navbar-nav .nav-item + .nav-item {
    margin-top: .6rem !important;
  }

  /* Links: nur Textbreite, kein breiter Hover/Underline, einheitliche Zeilenhöhe */
  nav.navbar.custom-justify-between .navbar-collapse .nav-link {
    display: inline-block;
    width: auto !important;          /* nicht 100% breit */
    padding-left: 0; padding-right: 0;
    line-height: 1.4;
    text-decoration: none !important;
  }
  nav.navbar.custom-justify-between .navbar-collapse .nav-link:hover,
  nav.navbar.custom-justify-between .navbar-collapse .nav-link:focus {
    text-decoration: none !important; /* kein zusätzliches Unterstreichen */
  }
  /* Breite Pseudo-Unterstreichungen (aus main.css) deaktivieren,
     die Dropdown-Pfeile bleiben erhalten */
  nav.navbar.custom-justify-between .navbar-collapse .nav-link:not(.dropdown-toggle)::before,
  nav.navbar.custom-justify-between .navbar-collapse .nav-link:not(.dropdown-toggle)::after {
    content: none !important;
  }
}

/* DGAI-Blau für den Login-Button */
#login.btn {
  background-color: #143254;
  border-color: #143254;
  color: #fff;
}
#login.btn:hover,
#login.btn:focus {
  background-color: #0f2741; /* leicht dunkler fürs Hover */
  border-color: #0f2741;
  color: #fff;
}
#login.btn:active {
  background-color: #0b1c2e; /* noch dunkler beim Active */
  border-color: #0b1c2e;
}
#login.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(20, 50, 84, .35);
}
/* Icon sicher weiß */
#login i { color:#fff; }
