/* Restore the header dropdown behaviour that the theme's stripped JS provided.
   The submenu <ul> is visibility:hidden until it gets .is-active (added on click
   by nav.js). On desktop (hover-capable) we also reveal it on hover/focus. */

/* Open on hover (desktop) and focus-within (keyboard + touch tap). Pure CSS so
   it never depends on script timing. */
body > div > header ps-header-nav .nav-item:hover > ul,
body > div > header ps-header-nav .nav-item:focus-within > ul {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
body > div > header ps-header-nav .nav-item:hover > button svg,
body > div > header ps-header-nav .nav-item:focus-within > button svg {
  transform: rotate(180deg);
}

/* Click/touch state (nav.js toggles .is-active on the <ul>). */
body > div > header ps-header-nav .nav-item > ul.is-active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
body > div > header ps-header-nav .nav-item > button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Bridge the small gap between the trigger and the menu so moving the cursor
   onto the menu doesn't drop the :hover. */
body > div > header ps-header-nav .nav-item > ul::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
