/*
 * Navbar dropdown hover-overlap fix (project-owned override, not part of the
 * vendored Webflow export).
 *
 * Root cause: the vendored Webflow runtime
 * (cdn.prod.website-files.com/.../js/webflow.*.js) opens a hover dropdown by
 * immediately adding the `w--open` class to the new panel, and force-closes
 * any other open dropdown by triggering its internal "w-close" handler.
 * That handler sets the dropdown's internal `open` state to false right
 * away, but the class that actually controls paint (`w--open`, which flips
 * `display:none` -> `display:block`) is only removed after the panel's
 * `data-delay="250"` timeout fires. Because the incoming panel's `w--open`
 * class is added synchronously while the outgoing panel's `w--open` class
 * lingers for up to 250ms, both panels are simultaneously `display:block`
 * and visibly overlap whenever the pointer moves directly from one nav item
 * to another.
 *
 * Fix: instead of patching the vendored JS/state machine, constrain what is
 * actually painted. A dropdown panel is only allowed to be visible while its
 * own trigger/panel pair is genuinely hovered or contains focus. This makes
 * the visible state track the pointer in real time, independent of
 * Webflow's internal delayed class cleanup, so at most one panel is ever
 * visible. `w--open` itself is left completely alone (Webflow still owns
 * open/close bookkeeping, aria-expanded, Escape-to-close, etc.).
 *
 * Scoped to `(hover: hover) and (pointer: fine)` so touch/mobile devices
 * (where Webflow already disables hover mode and falls back to tap-to-toggle
 * navigation) are entirely untouched by this rule.
 */
@media (hover: hover) and (pointer: fine) {
  .w-nav .w-dropdown-list.w--open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .w-nav .w-dropdown:hover > .w-dropdown-list.w--open,
  .w-nav .w-dropdown:focus-within > .w-dropdown-list.w--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .w-nav .w-dropdown-list.w--open {
    transition: opacity 150ms ease, visibility 150ms ease;
  }
}
