/** navbar.css  -  parseMenu recipe: horizontal menu bar + panel menus
    version 2026-11-24

    Loaded by parseMenu.php (after the skin's CSS). Colours are custom
    properties - override them in a skin theme or customize.css.
    Foldmark icons (foldmark_f / foldmark_u) are CSS masks painted in
    the current text colour, so they follow any colour scheme.          **/

:root {
  --nav-bg:          var(--c-header-bg, rgb(233, 230, 223)) ;
  --nav-color:       rgb( 30,  82, 125) ;
  --nav-hover-bg:    rgba(0, 0, 0, 0.07) ;
  --nav-drop-bg:     rgb(215, 209, 197) ;
  --nav-drop-color:  var(--nav-color) ;
  --nav-pad:         0.6em 1em ;
}


/*-------------------------------------------------------------*\
    BAR
\*-------------------------------------------------------------*/
.pm-bar {
  background: var(--nav-bg) ;
  color:      var(--nav-color) ;
}

.pm-bar .menu {
  display:          flex ;
  flex-wrap:        wrap ;
  justify-content:  flex-end ;
  margin:              0 ;
  padding:             0 ;
  list-style:       none ;
}

.pm-bar .menu > li {
  position:      relative ;
  display:           flex ;
  align-items:     center ;
}

.pm-bar .menu > li > a,
.pm-bar .pm-head {
  display:           flex ;
  align-items:     center ;
  gap:              0.4em ;
  padding:   var(--nav-pad) ;
  color:          inherit ;
  font:           inherit ;
  line-height:        1.2 ;
  text-decoration:   none ;
  background:        none ;
  border:               0 ;
  cursor:         pointer ;
}
.pm-bar .menu > li > a:hover,
.pm-bar .pm-head:hover,
.pm-bar li.pm-open > .pm-head { background: var(--nav-hover-bg) ; }

/* top-level text with no link and no dropdown */
.pm-bar .menu > li:not(:has(> a)):not(:has(> .Dropli)):not(:has(> .pm-head)) { padding: var(--nav-pad) ; }

/* Toggle beside a heading that is also a link.
   Mouse screens: hover opens the menu, so the toggle stays out of sight
   until a keyboard user Tabs to it. Touch screens (tablets): always shown. */
.pm-bar .pm-fold { margin-left: -0.7em ; padding: 0 0.6em 0 0.2em ; }
@media (hover: hover) and (pointer: fine) {
  .pm-bar .pm-fold:not(:focus-visible) {
    position:   absolute ;
    width:           1px ;
    height:          1px ;
    padding:           0 ;
    margin:            0 ;
    overflow:     hidden ;
    clip-path: inset(50%) ;
  }
}


/*-------------------------------------------------------------*\
    TOGGLES AND THE FOLDMARK ICON  (bar and panel)
\*-------------------------------------------------------------*/
.pm-fold {
  display:     inline-flex ;
  align-items:      center ;
  justify-content:  center ;
  align-self:      stretch ;
  color:           inherit ;
  background:         none ;
  border:                0 ;
  cursor:          pointer ;
}

.pm-fm {
  display:     inline-block ;
  flex:              none ;
  width:            1.9em ;
  height:             1em ;
  background-color: currentColor ;
  -webkit-mask: url(foldmark_f.svg) center / contain no-repeat ;
          mask: url(foldmark_f.svg) center / contain no-repeat ;
}
[aria-expanded="true"] > .pm-fm {
  -webkit-mask-image: url(foldmark_u.svg) ;
          mask-image: url(foldmark_u.svg) ;
}

/* Touch screens: a full-size target, whatever the icon size */
@media (pointer: coarse) {
  .pm-fold, .pm-head { min-width: 44px ; min-height: 44px ; }
}


/*-------------------------------------------------------------*\
    DROPDOWNS (bar)
\*-------------------------------------------------------------*/
.pm-bar .Dropli {
  display:          none ;
  position:     absolute ;
  top:              100% ;
  left:                0 ;
  z-index:            20 ;
  min-width:        12em ;
  margin:              0 ;
  padding:       0.4em 0 ;
  list-style:       none ;
  text-align:       left ;
  background: var(--nav-drop-bg) ;
  color:      var(--nav-drop-color) ;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) ;
}
.pm-bar li.pm-flip > .Dropli { left: auto ; right: 0 ; }   /* would run off the right edge */
.pm-bar li.pm-open > .Dropli { display: block ; }

/* Without JS: hover and keyboard focus still open them */
.pm-bar:not(.pm-js) .menu > li:hover > .Dropli,
.pm-bar:not(.pm-js) .menu > li:focus-within > .Dropli { display: block ; }

.pm-bar .Dropli li { display: block ; }
.pm-bar .Dropli a  { display: block ; padding: 0.4em 1.2em ; color: inherit ; text-decoration: none ; }
.pm-bar .Dropli a:hover,
.pm-bar .Dropli a:focus-visible { background: var(--nav-hover-bg) ; }
.pm-bar .Dropli li:not(:has(a)):not(:has(hr)) { padding: 0.4em 1.2em ; opacity: 0.75 ; }   /* labels like "Software:" */


/*-------------------------------------------------------------*\
    PANEL MENUS  (a copy of the bar, shown stacked - e.g. a phone overlay)
\*-------------------------------------------------------------*/
.pm-panel, .pm-panel .Dropli { list-style: none ; margin: 0 ; padding: 0 ; }

.pm-panel > li {
  display:     flex ;
  flex-wrap:   wrap ;
  align-items: center ;
}
.pm-panel > li > a,
.pm-panel > li > .pm-head,
.pm-panel > li:not(:has(> a)):not(:has(> .pm-head)) {
  flex:             1 ;
  display:       flex ;
  align-items: center ;
  justify-content: space-between ;
  min-height:    44px ;
  padding:     0 1rem ;
  font:       inherit ;
  text-align:    left ;
  text-decoration: none ;
  background:    none ;
  border:           0 ;
}
.pm-panel > li > .pm-head { color: inherit ; cursor: pointer ; }   /* links keep their link colour */
.pm-panel > li > .pm-fold { min-height: 44px ; padding: 0 1rem 0 0.5rem ; }   /* icon lines up with the headings' */

.pm-panel .Dropli           { display: none ; flex-basis: 100% ; padding-left: 1rem ; }
.pm-panel li.pm-open > .Dropli { display: block ; }
.pm-panel .Dropli li        { min-height: 40px ; display: flex ; align-items: center ; padding: 0 1rem ; }
.pm-panel .Dropli a         { color: inherit ; text-decoration: none ; flex: 1 ; }

.pm-bar .hrli, .pm-bar .lihr,
.pm-panel .hrli, .pm-panel .lihr {
  width: auto ; max-width: none ; height: 0 ;
  margin: 0.3em 1em ;
  border: 0 ; border-top: 1px solid currentColor ; opacity: 0.4 ;
}
.pm-panel .hrli, .pm-panel .lihr { flex: 1 ; }   /* rows are flex: give the rule a width */
.pm-panel .spacer { display: none ; }
