/* ──────────────────────────────────────────────────────────────
   Shared site navigation (main menu + hamburger drawer) — RTL
   Loaded on every public page, paired with /site-nav.js
   Breakpoint: 1100px (keep in sync with BREAKPOINT in site-nav.js)
   ────────────────────────────────────────────────────────────── */

/* Never let anything push the page sideways on small screens. */
html { overflow-x: hidden; }

.mnav-toggle { display: none; }

/* ── Main menu (desktop bar) ──
   One menu on every page. The page's own links are retired by a class the
   script adds, so with JS off the original navigation is left untouched. */
.snav-replaced { display: none !important; }

/* ── Brand lockup ──
   Wordmark in the off-white, the name under it in the brand yellow. */
.snav-brand {
  display: block;
  flex: 0 0 auto;
  font-family: 'Heebo', 'Assistant', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  color: #f5f0eb;
  text-decoration: none;
  transition: opacity 0.25s ease;
}
.snav-brand span {
  display: block;
  font-size: 0.6em;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--accent, #e8c97e);
}
.snav-brand:hover { opacity: 0.85; }
.snav-brand:focus-visible { outline: 2px solid var(--accent, #e8c97e); outline-offset: 3px; }

.snav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  margin-inline-start: auto;
}
.snav-links li { list-style: none; }
.snav-links a {
  display: block;
  padding: 4px 0;
  color: rgba(245, 240, 235, 0.7);
  font-family: 'Heebo', 'Assistant', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.snav-links a:hover,
.snav-links a:focus-visible { color: var(--accent, #e8c97e); }
.snav-links a[aria-current] {
  color: var(--accent, #e8c97e);
  border-bottom-color: var(--accent, #e8c97e);
}
.snav-links a:focus-visible { outline: 2px solid var(--accent, #e8c97e); outline-offset: 3px; }

@media (max-width: 1100px) {
  /* Hide the desktop menu; keep the brand and our toggle. */
  nav > *:not(.snav-brand):not(.mnav-toggle) { display: none !important; }

  .mnav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    margin-inline-start: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(232, 201, 126, 0.28);
    border-radius: 6px;
    background: rgba(13, 27, 46, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.25s ease, background 0.25s ease;
  }
  .mnav-toggle:focus-visible { outline: 2px solid var(--accent, #e8c97e); outline-offset: 2px; }

  .snav-brand { font-size: 1.12rem; }
}

@media (max-width: 380px) {
  .snav-brand { font-size: 1rem; }
}

.mnav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent, #e8c97e);
  transition: transform 0.28s ease, opacity 0.2s ease;
}
html.mnav-open .mnav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
html.mnav-open .mnav-toggle span:nth-child(2) { opacity: 0; }
html.mnav-open .mnav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Backdrop ── */
.mnav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(5, 11, 20, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}
html.mnav-open .mnav-backdrop {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

/* ── Drawer ── */
.mnav-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1500;
  width: min(330px, 86vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--black, #0d1b2e);
  border-left: 1px solid rgba(232, 201, 126, 0.16);
  box-shadow: -18px 0 46px rgba(0, 0, 0, 0.45);
  font-family: 'Heebo', sans-serif;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
}
html.mnav-open .mnav-panel {
  transform: none;
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

.mnav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 22px 16px;
  border-bottom: 1px solid rgba(245, 240, 235, 0.08);
}
.mnav-brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f5f0eb;
  line-height: 1.3;
}
.mnav-brand span {
  display: block;
  font-size: 0.62em;
  font-weight: 400;
  color: var(--accent, #e8c97e);
}
.mnav-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(245, 240, 235, 0.14);
  border-radius: 6px;
  background: transparent;
  color: rgba(245, 240, 235, 0.75);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.mnav-close:hover { color: var(--accent, #e8c97e); border-color: rgba(232, 201, 126, 0.4); }
.mnav-close:focus-visible { outline: 2px solid var(--accent, #e8c97e); outline-offset: 2px; }

.mnav-list {
  position: static;
  display: block;
  flex: 1 1 auto;
  padding: 10px 0 18px;
}
.mnav-group {
  margin: 16px 22px 6px;
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(232, 201, 126, 0.55);
}
.mnav-list a {
  display: block;
  padding: 12px 22px;
  color: rgba(245, 240, 235, 0.78);
  font-size: 0.95rem;
  font-weight: 300;
  text-decoration: none;
  border-right: 2px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  overflow-wrap: anywhere;
}
.mnav-list a:hover { color: var(--accent, #e8c97e); background: rgba(232, 201, 126, 0.05); }
.mnav-list a:focus-visible { outline: 2px solid var(--accent, #e8c97e); outline-offset: -2px; }
.mnav-list a[aria-current] {
  color: var(--accent, #e8c97e);
  border-right-color: var(--accent, #e8c97e);
  background: rgba(232, 201, 126, 0.06);
}

.mnav-foot {
  padding: 16px 22px calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(245, 240, 235, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mnav-foot a {
  color: rgba(245, 240, 235, 0.6);
  font-size: 0.88rem;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}
.mnav-foot a:hover { color: var(--accent, #e8c97e); }

/* Lock the page behind the drawer. */
html.mnav-open,
html.mnav-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .mnav-panel,
  .mnav-backdrop,
  .mnav-toggle span { transition-duration: 0.01ms !important; }
}

@media (min-width: 1101px) {
  .mnav-panel,
  .mnav-backdrop { display: none; }
}
