/* ═══════════════════════════════════════════════════════════════════════
   menu.css · mobile hamburger + side-panel navigation
   Hidden on desktop · activates ≤720px viewport.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Hamburger button (in runhead) ─── */
.hamburger{
  display:none;
  width:44px;
  height:44px;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  background:transparent;
  border:0;
  cursor:pointer;
  padding:0;
  margin-right:.5rem;
}
.hamburger span{
  display:block;
  width:22px;
  height:1.5px;
  background:rgba(248,247,245,.92);
  transition:transform .35s ease, opacity .35s ease, background .35s ease;
}
.runhead.is-scrolled .hamburger span{
  background:var(--ink);
}
body.menu-open .hamburger span:nth-child(1){
  transform:translateY(6.5px) rotate(45deg);
}
body.menu-open .hamburger span:nth-child(2){
  opacity:0;
}
body.menu-open .hamburger span:nth-child(3){
  transform:translateY(-6.5px) rotate(-45deg);
}

/* ─── Overlay ─── */
.mobile-nav-overlay{
  position:fixed;
  inset:0;
  background:rgba(44,44,43,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .35s ease;
  z-index:85;
}
.mobile-nav-overlay.is-open{
  opacity:1;
  pointer-events:auto;
}

/* ─── Side panel ─── */
.mobile-nav{
  position:fixed;
  top:0;right:0;bottom:0;
  width:78%;
  max-width:340px;
  background:var(--bg);
  z-index:90;
  transform:translateX(100%);
  visibility:hidden;
  transition:transform .4s var(--ease-archival), visibility 0s .4s;
  display:flex;
  flex-direction:column;
  padding:5rem var(--pad) 3rem;
  border-left:1px solid var(--rule);
}
.mobile-nav.is-open{
  transform:translateX(0);
  visibility:visible;
  transition:transform .4s var(--ease-archival), visibility 0s 0s;
}

.mobile-nav-close{
  position:absolute;
  top:1rem;right:1.25rem;
  width:44px;height:44px;
  background:transparent;
  border:0;
  font-family:var(--serif);
  font-size:2rem;
  line-height:1;
  color:var(--ink);
  cursor:pointer;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.mobile-nav nav ul{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:1.5rem;
  padding:0;
}
.mobile-nav nav a{
  font-family:var(--serif);
  font-size:1.75rem;
  color:var(--ink);
  text-decoration:none;
  position:relative;
  padding-left:1rem;
  transition:padding-left .3s ease;
}
.mobile-nav nav a:hover,
.mobile-nav nav a:focus{
  padding-left:1.5rem;
}
.mobile-nav nav a::before{
  content:"";
  position:absolute;
  left:0;
  top:50%;
  width:0;
  height:1px;
  background:var(--accent);
  transition:width .3s ease;
}
.mobile-nav nav a[aria-current="page"]{
  color:var(--accent-dk);
}
.mobile-nav nav a[aria-current="page"]::before{
  width:.5rem;
}

.mobile-nav-foot{
  margin-top:auto;
  padding-top:2rem;
  border-top:1px solid var(--rule);
  font-size:.6rem;
  color:var(--mute);
}

/* ─── Theme toggle row in mobile menu ─── */
.mobile-nav-theme{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1.5rem 0;
  margin-top:2rem;
  border-top:1px solid var(--rule);
}
.mobile-theme-label{
  font-size:.65rem;
  letter-spacing:.25em;
  text-transform:uppercase;
  color:var(--mute);
}
.theme-toggle-mobile .toggle-track{
  background:var(--rule);
  border-color:var(--rule-stronger);
}
.theme-toggle-mobile .toggle-thumb{
  background:var(--ink);
}
.theme-toggle-mobile.is-dark .toggle-thumb{
  background:var(--bg);
}
.theme-toggle-mobile .toggle-icon-sun{
  color:#A07A1A;
}
.theme-toggle-mobile .toggle-icon-moon{
  color:#4A5F73;
}


/* ─── Show on mobile only ─── */
@media (max-width: 720px){
  .runhead{
    grid-template-columns:1fr auto !important;
  }
  .runhead-nav{display:none}
  .runhead-right{display:none}
  .hamburger{
    display:flex;
    justify-self:end;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce){
  .mobile-nav,.mobile-nav-overlay,.hamburger span{
    transition:none;
  }
}
