/* xGrowth primary navigation: mobile menu correction (2026-11-20).
   Additive. Link immediately AFTER /navigation-footer-assets/navigation-refinement.css.
   Scope: nav#xgn and its header only. No markup other than the Contact item, no script, no change to the
   desktop row, logo, theme control or header CTA. Every rule is (0,3,1) or higher, above the (0,3,0)
   navigation.css rules it refines, so the result does not depend on stylesheet order.

   1. Contact menu item (li.xgn-item.xgn-mobile-only, after About). It uses the existing top-level
      .xgn-item / .xgn-link styling. It is shown only in the menu panel (900px and below); the desktop row
      (901px and up) stays exactly as before, where the header CTA already covers Contact.
   2. Panel height. navigation.css limits the panel to 100dvh minus the 78px header, which assumes the header
      starts at the top of the viewport. With the WordPress admin bar (46px at 782px and below, 32px above)
      the panel ran past the viewport bottom by that offset, so the last item (About) could not be fully
      reached at maximum scroll (confirmed at 360x640: panel bottom 686, About clipped by 11px). The limit
      now subtracts the admin bar height when the bar is present; it is 0 otherwise, so pages without the
      admin bar keep the same panel height. Overestimating the offset (for example after the bar scrolls
      away on narrow phones) only makes the panel a little shorter; it stays scrollable.
   3. Bottom reach. The list keeps its 24px bottom padding plus any device safe-area inset.
   4. Home only: the phone sticky CTA (.sticky, z-index 60, fixed 12px from the bottom) sits above the header
      (z-index 50), so it can cover the bottom of the open panel. While the menu is open the header is raised
      to z-index 61, so the panel is never covered. Browsers without :has() keep today's behavior. */

@media (min-width:901px){
  .nav .xgn .xgn-item.xgn-mobile-only{display:none}
}

@media (max-width:900px){
  header.nav .xgn{--xgn-offset:0px}

  /* WordPress admin bar: WordPress publishes its height as --wp-admin--admin-bar--height; the fallbacks are
     its standard heights. Two separate rules so a browser without :has() still applies the body-class rule. */
  body.admin-bar header.nav .xgn{--xgn-offset:var(--wp-admin--admin-bar--height,32px)}
  html:has(#wpadminbar) header.nav .xgn{--xgn-offset:var(--wp-admin--admin-bar--height,32px)}

  header.nav .xgn .xgn-panel{
    max-height:calc(100vh - var(--xgn-head) - var(--xgn-offset));
    max-height:calc(100dvh - var(--xgn-head) - var(--xgn-offset))
  }
  header.nav .xgn .xgn-list{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}

  header.nav:has(.xgn[data-open]){z-index:61}
}

@media (max-width:782px){
  body.admin-bar header.nav .xgn{--xgn-offset:var(--wp-admin--admin-bar--height,46px)}
  html:has(#wpadminbar) header.nav .xgn{--xgn-offset:var(--wp-admin--admin-bar--height,46px)}
}
