/* Mobile menu module — self-contained, no Tailwind conflicts.
   Uses opacity + visibility (not transform) so it works on every mobile
   browser including older iOS Safari that misbehaves with transformed
   fixed elements under a backdrop-filtered ancestor. */

/* Hamburger button */
#mobile-menu-btn {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 90;
}
#mobile-menu-btn span,
#mobile-menu-btn .bar {
  pointer-events: none;
}
#mobile-menu-btn .bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink, #F5F1EA);
  transition: transform 240ms ease, opacity 200ms ease, width 240ms ease;
  transform-origin: center;
}
#mobile-menu-btn .bar:nth-child(3) { width: 14px; }
#mobile-menu-btn.is-open .bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#mobile-menu-btn.is-open .bar:nth-child(2) { opacity: 0; }
#mobile-menu-btn.is-open .bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); width: 22px; }

/* Drawer */
#mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 80;
  background: var(--bg, #15110E);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 0s linear 280ms;
}
#mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 280ms ease, visibility 0s linear 0s;
}
#mobile-menu a {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-secondary, #A39B8F);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 200ms ease;
}
#mobile-menu a:hover,
#mobile-menu a.active { color: var(--ink, #F5F1EA); }

/* Lock document scroll while drawer is open */
html.menu-open,
html.menu-open body { overflow: hidden; }

/* Hide on desktop; mobile by default */
@media (min-width: 768px) {
  #mobile-menu,
  #mobile-menu-btn { display: none !important; }
}
