/* =========================================================================
   currency.ae — nav.css
   The mobile burger (≡) menu for the primary nav. Injected by the middleware on
   every page (paired with chrome.js's navInner + nav.js), so it lives in ONE
   place and never touches the site-wide styles.css cache.

   Desktop (>600px): .nav-menu is display:contents — the links flow as direct
   flex items of .site-nav, byte-identical to the original inline nav (header
   parity preserved); the burger is hidden.
   Mobile (≤600px): the burger shows; .nav-menu collapses and, when opened,
   drops down as a clean panel.
   ========================================================================= */

.site-nav { position: relative; } /* anchor for the dropdown panel */

/* Secondary-text contrast nudge, site-wide (nav.css is injected on every page, so
   this overrides the styles.css token without a full-site cache bump). Brighter
   dim-grey = more legible AED sub-lines / timestamps on the dark background. */
:root { --text-dim: #83a99b; }  /* was #6f978a */

/* The menu wrapper is invisible to layout on desktop → links behave exactly as
   before (flex row, gap:22px from .site-nav). */
.nav-menu { display: contents; }

.nav-burger {
  display: none; /* desktop */
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  width: 42px;
  height: 38px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-burger:hover { color: var(--text); }
.nav-burger:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.nav-burger__icon line { transition: transform 0.22s var(--ease), opacity 0.18s var(--ease); transform-origin: center; }
/* Open state → morph the three bars into an ✕. */
.nav-burger[aria-expanded="true"] { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.nav-burger[aria-expanded="true"] .nav-burger__l1 { transform: translateY(5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .nav-burger__l2 { opacity: 0; }
.nav-burger[aria-expanded="true"] .nav-burger__l3 { transform: translateY(-5px) rotate(-45deg); }

/* Mobile = the site's existing header breakpoint (≤699px; desktop is ≥700px). */
@media (max-width: 699px) {
  .nav-burger { display: inline-flex; }

  /* styles.css makes the mobile header a 2-ROW COLUMN (brand row + a full-bleed
     framed nav row). Override it to a SINGLE ROW: logo (+ tagline, kept as-is) on
     the left, ≡ hard-right. Higher specificity + !important to beat those rules. */
  .site-header .site-header__inner {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    column-gap: 12px;
  }
  .site-header .brand { align-self: center; flex: 0 1 auto; min-width: 0; }
  .site-header .brand__lockup { min-width: 0; }
  /* Tagline stays ONE line and fully visible on every real device (≥344px). At the
     absolute narrowest (≤~343px) it ellipsizes a hair rather than pushing the
     burger off-row — a safety valve, not a size change. */
  .site-header .brand__tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Undo the framed full-bleed nav row → the nav is just the burger, hard-right. */
  .site-header .site-nav {
    width: auto !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    border-top: 0 !important;
    padding-top: 0 !important;
    margin-left: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  /* Collapsed by default; a real (non-contents) box so it can be a panel. */
  .nav-menu { display: none; }
  .nav-menu.is-open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 208px;
    max-width: min(84vw, 280px);
    padding: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 60;
    animation: navMenuIn 0.16s var(--ease);
  }
  .nav-menu.is-open a {
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 0.95rem; /* readable in the panel, not the tight header size */
    color: var(--text-muted);
  }
  .nav-menu.is-open a:hover { color: var(--text); background: var(--surface-3); }
  /* The active item's underline reads oddly in a stacked panel — use a gold dot. */
  .nav-menu.is-open a.is-active::after,
  .nav-menu.is-open a[aria-current="page"]::after {
    content: none;
  }
  .nav-menu.is-open a.is-active,
  .nav-menu.is-open a[aria-current="page"] {
    color: var(--text);
    background: rgba(232, 200, 116, 0.1);
  }
}

@keyframes navMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-burger__icon line { transition: none; }
  .nav-menu.is-open { animation: none; }
}
