/*
 * Mobile menu (hu, 2026-10-05). The CSS-only menu (#side-menu checkbox +
 * fixed #navbarNavDropdown panel, child-theme.css, <= 820 px) did not stop
 * the page behind it from scrolling, and its overflow:hidden cut off items
 * that did not fit the screen. Loaded on every page after child-theme.min.css.
 */

@media screen and (max-width: 820px) {
  /* Page behind the open menu does not scroll (no-op where :has() is unsupported). */
  html:has(#side-menu:checked),
  html:has(#side-menu:checked) body {
    overflow: hidden;
  }

  /* The open panel scrolls itself when the menu is taller than the screen.
     The panel starts 50 px down (margin-top in child-theme.css), so its
     height is reduced by that much to keep the last items reachable. */
  .side-menu:checked ~ #navbarNavDropdown {
    height: calc(100% - 50px);
    max-height: calc(100% - 50px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}
