/*
 * Menus of the template (mod_menu).
 *
 * The template does not use the toggle buttons of the Joomla 6 core menu. Sub menus are opened by hover (main menu,
 * nexus.css) and by click, tap or keyboard. scripts.js sets the class "is-open" on the list item of an open sub menu;
 * the server adds the class "trail-open" to the entries of the active trail (see html/mod_menu/default.php).
 */

/* The main menu shows no chevrons (like the Joomla 4 version of the template). */
.mod-menu .parent-indicator,
.hornav .parent-indicator {
  display: none;
}

/* Entries with sub menu items are operable by click. */
.mod-menu li.deeper > .mod-menu__heading,
.mod-menu li.deeper > .mod-menu__separator {
  cursor: pointer;
}

/*
 * Main menu (horizontal): an open sub menu looks exactly like the hover state of nexus.css and works on every level.
 */
.hornav li.is-open > ul {
  display: block;
  opacity: 1;
  visibility: visible;
  -webkit-transform: scale(1);
          transform: scale(1);
}

.hornav > ul > li > ul > li.is-open > ul,
.hornav > ul > li > ul > li > ul > li.is-open > ul {
  left: 220px;
  top: 0 !important;
}

.hornav > ul > li > ul > li > ul > li > ul {
  left: 240px;
  top: 0 !important;
}

/*
 * Menus in the side columns (vertical): sub menus are closed, except those of the active trail, which stay open
 * after the page was loaded. A click on an entry without link opens and closes its sub menu.
 */
.sidecol_block .mod-menu li.deeper > ul {
  display: none;
}

.sidecol_block .mod-menu li.deeper.trail-open > ul,
.sidecol_block .mod-menu li.deeper.is-open > ul {
  display: block;
}

/*
 * Keyboard focus. nexus.css removes the outline of mouse focus in the main menu; the visible focus ring for keyboard
 * users needs a selector that is at least as specific as the former rules.
 */
.mod-menu a:focus-visible,
.mod-menu [role="button"]:focus-visible,
.hornav > ul > li > a:focus-visible,
.hornav > ul > li > span:focus-visible,
.hornav > ul > li > ul a:focus-visible,
.hornav > ul > li > ul span:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
  .hornav ul ul {
    transition: none;
  }
}
