/*
  orpheus-menu-overlay.css
  2026-11-19 takahashi

  Overlay (position:absolute) dropdown for the Orpheus top menu bar
  (Orpheus-menu-bar.inc / Orpheus-menu-items.inc).

  Goals:
   - keep the existing visual design (colors/labels/icons are untouched,
     they are still generated by the same PHP functions)
   - opening a category must NOT push the rest of the page down
     (native <details> used to expand inline and break the layout)
   - hovering a category with the mouse previews its menu immediately;
     clicking/tapping keeps it open (needed for touch devices, and for
     keeping it open while the mouse moves down into the panel)
*/

.ormenu-cat{
  position: relative;
  display: inline-block;
}

.ormenu-label{
  cursor: pointer;
  user-select: none;
}
.ormenu-label:focus{
  outline: 2px solid #3366ff;
  outline-offset: 2px;
}

/* the dropdown itself: absolutely positioned so it overlays the page
   instead of taking up space in the normal flow */
.ormenu-panel{
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  min-width: 220px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* hover-preview on desktop: just resting the pointer on the category
   reveals its contents, no click needed */
.ormenu-cat:hover > .ormenu-panel{
  display: block;
}

/* click/tap toggle (also used by keyboard & touch, where :hover
   doesn't apply) - driven by the "ormenu-open" class in
   Orpheus-menu-bar.inc's inline script */
.ormenu-cat.ormenu-open > .ormenu-panel{
  display: block;
}

/* smartphone: menu categories stack to full width so the dropdown
   doesn't get clipped at the right edge of the screen */
@media (max-width: 760px){
  .ormenu-panel{
    left: 0;
    right: 0;
    min-width: 0;
  }
}
