Issue #3557364: Move mobile detection from PHP to JS to avoid cache issues
Closes #3557364
Moves the prevent-auto-open-on-mobile logic from PHP (user-agent detection) to JavaScript (window.matchMedia). This eliminates per-visitor cache variations in Drupal page cache and Varnish.
Applied the patch from the issue, resolved a minor conflict in the event listener block.