/* ============================================================
   Mobile / tablet menu: toggle button + full-page dropdown.
   The breakpoint and icon size are printed by inc/mobile-menu.php
   (Appearance > Customize > Mobile menu), so none of that is here.
   ============================================================ */

/* ---------- toggle button (hidden on desktop) ---------- */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin: -6px -6px -6px 4px;
  padding: 6px;
  background: none;
  border: 0;
  border-radius: 10px;
  line-height: 0;
  color: var(--sf-ice);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle:focus-visible,
.mobile-menu__close:focus-visible {
  outline: 2px solid var(--sf-cyan);
  outline-offset: 2px;
}

/* both states: the PNG you upload, or the built-in SVG */
.menu-toggle img,
.mobile-menu__close img {
  display: block;
  height: var(--sf-menu-icon, 28px);
  width: auto;
  max-width: calc(var(--sf-menu-icon, 28px) * 2.4);
}
.menu-toggle svg,
.mobile-menu__close svg {
  display: block;
  width: var(--sf-menu-icon, 28px);
  height: var(--sf-menu-icon, 28px);
  stroke: currentColor;
}

/* ---------- full-page overlay ---------- */
.mobile-menu {
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: var(--sf-void);
  color: var(--sf-ice);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, visibility 0s linear .35s;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .35s ease, visibility 0s;
}
body.menu-open { overflow: hidden; }
.segfault-aisle .mobile-menu { display: none; }

/* animated server racks + a veil that keeps the menu text readable */
.mobile-menu__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.mobile-menu__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 45%, rgba(2, 5, 10, .80) 0%, rgba(2, 5, 10, .55) 55%, rgba(2, 5, 10, .30) 100%),
    linear-gradient(to bottom, rgba(2, 5, 10, .75), rgba(2, 5, 10, 0) 22%, rgba(2, 5, 10, 0) 78%, rgba(2, 5, 10, .85));
}

/* top bar: identical position to the header, so the close image sits where the hamburger was */
.mobile-menu__bar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  min-height: 76px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.mobile-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -6px -6px -6px 4px;
  padding: 6px;
  background: none;
  border: 0;
  border-radius: 10px;
  line-height: 0;
  color: var(--sf-ice);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* menu items */
.mobile-menu__body {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.mobile-menu__body > ul {
  margin: auto 0;
  padding: 0;
  list-style: none;
}
.mobile-menu__body li { margin: 0; padding: 0; list-style: none; }
.mobile-menu__body a {
  display: inline-block;
  padding: 8px 0;
  font-family: var(--sf-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 6.2vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
  transition: color .2s, transform .2s;
}
.mobile-menu__body a::before {
  content: "> ";
  color: var(--sf-cyan);
  opacity: 0;
  margin-left: -1.1em;
  transition: opacity .2s, margin .2s;
}
.mobile-menu__body a:hover,
.mobile-menu__body a:focus-visible { color: var(--sf-cyan); outline: none; }
.mobile-menu__body a:hover::before,
.mobile-menu__body a:focus-visible::before { opacity: 1; margin-left: 0; }
.mobile-menu__body .current-menu-item > a,
.mobile-menu__body .current_page_item > a { color: var(--sf-cyan); }
.mobile-menu__body .current-menu-item > a::before,
.mobile-menu__body .current_page_item > a::before { opacity: 1; margin-left: 0; }

/* sub-menus (build them with drag & indent in Appearance > Menus) */
.mobile-menu__body .sub-menu {
  margin: 2px 0 10px 4px;
  padding: 0 0 0 16px;
  list-style: none;
  border-left: 1px solid var(--sf-line);
}
.mobile-menu__body .sub-menu a {
  font-family: var(--sf-mono);
  font-weight: 500;
  font-size: clamp(1rem, 3.6vw, 1.3rem);
  color: var(--sf-dim);
  padding: 5px 0;
}
.mobile-menu__body .sub-menu .sub-menu a { font-size: clamp(.9rem, 3.2vw, 1.1rem); }

/* staggered entrance */
.mobile-menu__body > ul > li {
  opacity: 0;
  transform: translateY(16px);
}
.mobile-menu.is-open .mobile-menu__body > ul > li {
  opacity: 1;
  transform: none;
  transition: opacity .45s ease, transform .45s ease;
  transition-delay: calc(var(--i, 0) * 55ms + 120ms);
}

.mobile-menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--sf-line);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sf-dim);
}
.mobile-menu__foot a { font-family: inherit; font-size: 12px; font-weight: 500; }
.mobile-menu__foot a::before { content: none; }
.mobile-menu__foot .site-cart { display: inline-block; padding: 7px 14px; }

@media (max-width: 560px) {
  .mobile-menu__body { padding: 4px 18px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu, .mobile-menu.is-open { transition-duration: .01s; }
  .mobile-menu__body > ul > li { transform: none; transition: none !important; }
}
