@media (max-width: 760px) {
  .mobile-nav:not([open]) > nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mobile-nav[open] > nav {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    touch-action: pan-y;
  }
}

/* Menu clicks scroll via JS with a manually computed header offset
   (mobile-menu-fix-v5.js); scroll-padding-top on <html> only covers
   direct #hash page loads. The bundled CSS also sets scroll-margin-top
   on .section, which stacks on top of scroll-padding and doubles the
   offset, leaving a strip of the previous section visible below the
   sticky header. */
.section {
  scroll-margin-top: 0 !important;
}

/* iOS Safari can wedge its scroll engine when the user touches the
   screen during a native smooth anchor scroll (scroll-behavior:smooth
   on <html>) — the page stops responding to touch scrolling entirely.
   Jump instantly on touch devices instead; desktop keeps the glide. */
@media (hover: none), (pointer: coarse) {
  html {
    scroll-behavior: auto !important;
  }
}
