/* ============================================================
   Maze of Tales — shared mobile nav + full-screen menu drawer
   Loaded by index.html and work.html. Edit menu behaviour HERE.
   Relies on brand tokens (--gold, --bg, --text, --font-display,
   --font-arabic) defined in each page's :root.
   ============================================================ */

/* ===========================================
   MOBILE NAV, hamburger + full-screen drawer
   Hidden on desktop. The thread motif carries into the menu.
   =========================================== */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 210;
  width: 30px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--gold);
  transition: transform 0.4s ease, opacity 0.3s ease, top 0.4s ease;
}
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { top: 18px; }
body.menu-open .nav-toggle span:nth-child(1) { top: 10px; transform: rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 96px 24px 48px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu .thread { margin-bottom: 8px; }
.mobile-menu-links {
  list-style: none;
  text-align: center;
  margin: 0;
  padding: 0;
}
.mobile-menu-links li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
body.menu-open .mobile-menu-links li { opacity: 1; transform: translateY(0); }
body.menu-open .mobile-menu-links li:nth-child(1) { transition-delay: 0.10s; }
body.menu-open .mobile-menu-links li:nth-child(2) { transition-delay: 0.16s; }
body.menu-open .mobile-menu-links li:nth-child(3) { transition-delay: 0.22s; }
body.menu-open .mobile-menu-links li:nth-child(4) { transition-delay: 0.28s; }
body.menu-open .mobile-menu-links li:nth-child(5) { transition-delay: 0.34s; }
body.menu-open .mobile-menu-links li:nth-child(6) { transition-delay: 0.40s; }
.mobile-menu-links a {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.7;
  color: var(--text);
  letter-spacing: 0.01em;
}
.mobile-menu-links a:hover,
.mobile-menu-links a:focus-visible { color: var(--gold); }
.mobile-menu-ar {
  margin-top: 36px;
  font-family: var(--font-arabic);
  font-style: italic;
  font-size: 20px;
  color: var(--gold);
  direction: rtl;
}
/* Dedicated close (×) — lives inside the menu (top layer) so it's always tappable */
.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.35s ease 0.1s, color 0.3s ease;
}
body.menu-open .mobile-menu-close { opacity: 1; }
.mobile-menu-close:hover,
.mobile-menu-close:focus-visible { color: var(--text); }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
}
@media (min-width: 721px) {
  .mobile-menu { display: none; }
}
body.menu-open { overflow: hidden; }

/* Small-phone polish */
@media (max-width: 380px) {
  .mobile-menu-links a { font-size: 30px; }
}
