/*  ========================================================================
    # Header - third menu level (task8)
    ========================================================================

    Markup: classes/Components/Header.php, HeaderMenuMobile.php.
    Lives outside dist/ (no build toolchain here), enqueued by
    functions/header-subsubmenu.php. Colours, shadow, spacing and easing
    copy the existing .c-header__submenu rules in the dist bundle.
*/

/* Desktop: hover bridge for the first dropdown
   ==========================================================================
   The dist rules open .c-header__submenu at top: calc(100% + 10px), leaving a
   10px strip between the top-level link and the dropdown where nothing is
   hovered, so a slow pointer closes the menu on its way down. This invisible
   strip belongs to the dropdown and keeps :hover alive across the gap. It is
   only hit-testable while the dropdown is visible. (::before is the arrow.) */

.c-header__submenu::after {
  bottom: 100%;
  content: "";
  height: 12px;
  left: 0;
  position: absolute;
  right: 0;
}

/* Desktop: flyout to the right of the second-level entry
   ========================================================================== */

.c-header__submenu-entry {
  align-self: stretch;
  display: flex;
  position: relative;
  /* stretch the hover area over the submenu's right padding (50px),
     so the pointer can travel to the flyout without closing it */
  margin-right: -50px;
  padding-right: 50px;
}

.c-header__submenu-entry > a {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.c-header__submenu-entry > a::after {
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  content: "";
  height: 6px;
  transform: rotate(45deg);
  width: 6px;
}

.c-header__submenu-entry:hover > a,
.c-header__submenu-entry:focus-within > a {
  color: #e7680c;
}

.c-header__subsubmenu {
  background-color: #fffdfd;
  box-shadow: 0 0 25px 0 #00000026;
  display: flex;
  flex-flow: column nowrap;
  gap: 16px;
  left: 100%;
  min-width: 160px;
  opacity: 0;
  padding: 26px 50px 26px 26px;
  position: absolute;
  top: -26px;
  transition: all .2s cubic-bezier(.455, .03, .515, .955) 0s;
  visibility: hidden;
  z-index: 1;
}

.c-header__submenu-entry:hover > .c-header__subsubmenu,
.c-header__submenu-entry:focus-within > .c-header__subsubmenu {
  opacity: 1;
  visibility: visible;
}

/* Mobile: third level always shown, indented under its parent
   ========================================================================== */

.c-header-menu-mobile__subgroup,
.c-header-menu-mobile__subsubmenu {
  align-items: flex-start;
  display: flex;
  flex-flow: column nowrap;
  gap: 14px;
}

.c-header-menu-mobile__subsubmenu {
  margin-left: 20px;
}
