/* ==========================================================================
   Hauptnavigation — ersetzt Max Mega Menu durch den Navigation-Block
   Eigene Datei, damit die SCSS-Übersetzung von style.css sie nicht überschreibt.
   Maße übernommen aus dem alten MegaMenu-Stil: 18px, #177829, #f1f1f1, 250px.
   ========================================================================== */

.efeu-nav {
  --efeu-gruen: #177829;
  --efeu-gruen-dunkel: #115c1f;
  --efeu-flyout: #f1f1f1;
  --efeu-grau: #7b7b7b;
  --efeu-tap: 3rem;                 /* Mindesthöhe für Finger, 48px */
  font-size: 18px;
}

/* ---------- Ebene 1 ---------- */

.efeu-nav .wp-block-navigation__container { gap: .25rem; align-items: center; }

/* Kein Umbruch INNERHALB eines Eintrags ("Über uns" darf nicht brechen),
   und die Eintraege duerfen nicht schrumpfen, wenn der Platz knapp wird. */
.efeu-nav .wp-block-navigation__container > li { flex: 0 0 auto; }
.efeu-nav .wp-block-navigation-item__content,
.efeu-nav .wp-block-navigation-item__label { white-space: nowrap; }

/* Die Navigation darf im Kopf so breit werden, wie sie braucht. */
.efeu-nav { flex: 0 0 auto; max-width: none; }

.efeu-nav .wp-block-navigation__submenu-container { gap: 0; }

.efeu-nav .wp-block-navigation-item__content {
  color: #000;
  padding: 0 10px;
  line-height: 40px;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.efeu-nav .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover,
.efeu-nav .wp-block-navigation__container > li > .wp-block-navigation-item__content:focus-visible {
  color: var(--efeu-grau);
}

/* Im Klick-Modus wird der Elternpunkt ein <button>. Er muss aussehen wie ein
   Menuepunkt, nicht wie ein System-Knopf. */
.efeu-nav .wp-block-navigation-submenu__toggle {
  color: #000;
  padding: 0 10px;
  line-height: 40px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  display: flex;
  align-items: center;
  gap: .25rem;
  white-space: nowrap;
}

.efeu-nav .wp-block-navigation-submenu__toggle:hover,
.efeu-nav .wp-block-navigation-submenu__toggle[aria-expanded="true"] {
  color: var(--efeu-grau);
}

/* Aktuelle Seite erkennbar machen — hatte MegaMenu nicht, ist aber richtig */
.efeu-nav .current-menu-item > .wp-block-navigation-item__content,
.efeu-nav .current_page_item > .wp-block-navigation-item__content {
  text-decoration: underline;
  text-underline-offset: .4em;
  text-decoration-thickness: 2px;
}

/* Tastaturbedienung sichtbar machen */
.efeu-nav a:focus-visible,
.efeu-nav button:focus-visible {
  outline: 2px solid var(--efeu-gruen);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Untermenü (Desktop) ---------- */

.efeu-nav .wp-block-navigation__submenu-container {
  width: 250px;
  min-width: 250px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: var(--efeu-flyout);
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.efeu-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  color: #4a4a4a;
  padding: 14px 20px;
  line-height: 1.4;
  width: 100%;
}

.efeu-nav .wp-block-navigation__submenu-container li:not(:last-child) {
  border-bottom: 1px solid rgb(0 0 0 / 6%);
}

.efeu-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.efeu-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
  background-color: #fff;
  color: #000;
}

/* ---------- Kontakt als Knopf ---------- */

.efeu-nav .efeu-nav-cta > .wp-block-navigation-item__content {
  background-color: var(--efeu-gruen);
  color: #fff;
  border-radius: 10px;
  padding: 0 22px;
  margin-left: .5rem;
  font-weight: 600;
}

.efeu-nav .efeu-nav-cta > .wp-block-navigation-item__content:hover,
.efeu-nav .efeu-nav-cta > .wp-block-navigation-item__content:focus-visible {
  background-color: var(--efeu-gruen-dunkel);
  color: #fff;
}

/* ==========================================================================
   Mobil — Overlay
   Wichtig: Das <ul> erbt die Layoutklassen des <nav> (items-justified-right,
   no-wrap). Im Overlay ist das falsch, also wird hier bewusst zurueckgesetzt
   statt dagegen anzukaempfen.
   ========================================================================== */

@media (max-width: 1199px) {
  .efeu-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
  .efeu-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: none;
  }

  .efeu-nav .wp-block-navigation__responsive-container-open {
    min-width: var(--efeu-tap);
    min-height: var(--efeu-tap);
    align-items: center;
    justify-content: center;
    color: #000;
  }
  .efeu-nav .wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }
}

/* ---------- Buehne ---------- */

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open {
  background-color: #fff;
  padding: 0;
}

/* Der Dialog wird zur Spalte: erst der Schliessen-Knopf, darunter das Menue.
   Vorher lag der Knopf absolut positioniert ueber dem ersten Eintrag. */
.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__responsive-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 1rem 1.5rem 3rem;
}

/* Der Dialog bekommt beim Oeffnen programmatisch den Fokus — dort gehoert
   kein sichtbarer Ring hin, das war der Rahmen um „Start" und das X. */
.efeu-nav .wp-block-navigation__responsive-dialog:focus,
.efeu-nav .wp-block-navigation__responsive-dialog:focus-visible {
  outline: none;
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__responsive-container-close {
  position: static;
  align-self: flex-end;
  margin: 0 0 .5rem;
  min-width: var(--efeu-tap);
  min-height: var(--efeu-tap);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}
.efeu-nav .wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; }

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__responsive-container-content {
  width: 100%;
  padding: 0;
}

/* ---------- Die Liste: geerbte Ausrichtung zuruecksetzen ---------- */

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__container {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  gap: 0;
  padding: 0;
  margin: 0;
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item {
  width: 100%;
  align-items: stretch;
  border-bottom: 1px solid rgb(0 0 0 / 8%);
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content,
.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-submenu__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  min-height: var(--efeu-tap);
  padding: .625rem 0;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #000;
  white-space: normal;
}

/* Der Pfeil des Umschalters ans Zeilenende */
.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-submenu__toggle { justify-content: space-between; }

/* ---------- Untermenue im Overlay ---------- */

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__submenu-container {
  position: static;
  width: 100%;
  min-width: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-left: 3px solid var(--efeu-gruen);
  padding-left: 1rem;
  margin: 0 0 .75rem;
  opacity: 1;
  transform: none;
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__submenu-container .wp-block-navigation-item {
  border-bottom: 0;
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  font-size: 1.0625rem;
  color: #4a4a4a;
  min-height: 2.75rem;
  padding: .375rem 0;
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background: transparent;
  color: #000;
}

/* ---------- Kontakt: mittig, innerhalb des Randes ---------- */

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open .efeu-nav-cta {
  border-bottom: 0;
  margin-top: 1.75rem;
  width: 100%;
}

.efeu-nav .wp-block-navigation__responsive-container.is-menu-open
  .efeu-nav-cta > .wp-block-navigation-item__content {
  justify-content: center;
  text-align: center;
  background-color: var(--efeu-gruen);
  color: #fff;
  border-radius: 10px;
  margin: 0;
  padding: .875rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  box-sizing: border-box;
}

/* Wer Bewegung reduziert haben will, bekommt keine */
@media (prefers-reduced-motion: reduce) {
  .efeu-nav * { transition: none !important; }
}
