diff --git a/ht_booking/assets/views/base.html b/ht_booking/assets/views/base.html
index 54b62dd..2caa442 100644
--- a/ht_booking/assets/views/base.html
+++ b/ht_booking/assets/views/base.html
@@ -67,19 +67,30 @@
}
}
- /* Mobile: a backdrop behind an open navbar dropdown. It absorbs taps
- outside the menu — closing the dropdown rather than letting the tap
- reach the page — and dims the page to show the menu is modal. It sits
- below the dropdown content (z-50) so the menu items stay tappable. */
+ /* Mobile: a dimming backdrop behind an open navbar dropdown, driven by
+ CSS alone. `:has()` shows it whenever a dropdown holds focus; a tap
+ outside the menu blurs the trigger, which closes the dropdown. The
+ delayed `visibility` transition keeps the backdrop hit-testable for a
+ beat after that tap, so the tap lands on the backdrop instead of
+ falling through to the page. It sits below the dropdown content
+ (z-50) so the menu items stay tappable. */
#nav-backdrop { display: none; }
@media (max-width: 767px) {
#nav-backdrop {
+ display: block;
position: fixed;
inset: 0;
z-index: 40;
background-color: rgba(0, 0, 0, 0.25);
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity 0.15s ease, visibility 0s linear 0.2s;
+ }
+ .navbar:has(.dropdown:focus-within) ~ #nav-backdrop {
+ opacity: 1;
+ visibility: visible;
+ transition: opacity 0.15s ease, visibility 0s;
}
- #nav-backdrop.nav-backdrop--on { display: block; }
}
{% block head %}{% endblock head %}
@@ -139,11 +150,15 @@