/*
 * Avatorial marketing nav — direction A ("The Approval Desk").
 *
 * Everything reads from tokens.css so the nav can never drift from the app
 * or from the image renderers. Namespaced .av-* to sit beside the legacy
 * .nx-* styles while the rest of the site is rebuilt page by page.
 *
 * Two rules from the UX audit are load-bearing here and are marked below:
 *   - every interactive target is at least 44px tall
 *   - the mega opens on click, never on hover
 */

/* The token face, self-hosted in assets/fonts.css. Arabic has no coverage in
   Plus Jakarta Sans and falls through to the system face by design. */
.av-topbar, .av-nav, .av-sheet { font-family: var(--font-sans); }

/* ---- skip link ---------------------------------------------------------- */
/* Hidden by transform, not by a large negative offset: under dir="rtl" a
   left:-9999px element extends the scrollable area and gives the whole page
   a horizontal scrollbar. */
.av-skip {
  position: absolute; top: 0; inset-inline-start: 0; z-index: 200;
  background: var(--c-primary); color: #fff; padding: 12px 18px;
  border-end-end-radius: var(--r-md); font-weight: 700; text-decoration: none;
  transform: translateY(-200%);
}
.av-skip:focus { transform: translateY(0); }

/* ---- invariant strip ---------------------------------------------------- */
/* Scrolls away; the bar below it stays. Carries the one claim a competitor
   cannot copy, so a visitor who never opens the menu still meets it. */
.av-topbar {
  background: var(--c-primary); color: #C7D6E6;
  font-size: 12.5px; line-height: 1.4; text-align: center;
  padding: 9px 20px;
}
.av-topbar a { color: #fff; font-weight: 700; text-decoration: none; margin-left: 8px; white-space: nowrap; }
.av-topbar a:hover { text-decoration: underline; }

/* ---- bar ---------------------------------------------------------------- */
.av-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border-subtle);
}
.av-bar {
  max-width: 1180px; margin: 0 auto;
  padding: 10px var(--sp-lg);
  display: flex; align-items: center; gap: 26px;
}
.av-brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.av-brand img { height: 26px; width: auto; display: block; }

.av-menu { display: flex; align-items: center; gap: 4px; }
/* 44px minimum, on desktop too: the same rule serves the tablet breakpoint. */
.av-top {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 12px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; font-family: inherit; color: var(--c-ink);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.av-top:hover { color: var(--c-primary); }
.av-top.av-on { color: var(--c-primary); border-bottom-color: var(--c-border); }
.av-top[aria-expanded='true'] { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.av-caret { width: 11px; height: 7px; color: var(--c-ink-muted); transition: transform .18s ease; }
.av-top[aria-expanded='true'] .av-caret { transform: rotate(180deg); }

.av-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.av-signin {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  font-weight: 600; font-size: 15px; line-height: 1; font-family: inherit; color: var(--c-ink-muted); text-decoration: none;
}
.av-signin:hover { color: var(--c-ink); }
.av-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  background: var(--c-primary); color: var(--c-on-primary);
  border-radius: var(--r-pill); font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit; text-decoration: none;
}
.av-cta:hover { background: var(--c-primary-hover); }

.av-burger {
  display: none; width: 44px; height: 44px; margin-left: auto;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.av-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--c-ink); }

/* ---- mega panel --------------------------------------------------------- */
/* Absolutely positioned so opening it never shifts the page below. */
.av-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-raised);
  z-index: 40;
}
.av-panel[hidden] { display: none; }
.av-panel-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 26px var(--sp-lg) 30px;
  display: grid; grid-template-columns: 1fr 1fr 320px; gap: 34px;
}
.av-colhead {
  margin: 0 0 12px; font-size: 11.5px; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase; color: var(--c-ink-muted);
}
.av-item {
  display: flex; gap: 12px; align-items: flex-start;
  min-height: 44px; padding: 9px 10px; margin: 0 -10px;
  border-radius: var(--r-md); text-decoration: none; color: inherit;
}
.av-item:hover { background: var(--c-canvas); }
.av-ic {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--c-surface-muted); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
}
.av-i { width: 17px; height: 17px; }
.av-itxt { display: block; min-width: 0; }
.av-itxt strong { display: block; font-size: 15px; font-weight: 700; }
.av-itxt span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--c-ink-muted); }

/* The spotlight earns the third column by carrying what a link list can't. */
.av-spot {
  position: relative; overflow: hidden;
  background: var(--c-primary); color: #fff;
  border-radius: var(--r-lg); padding: 22px;
}
.av-spot-tag {
  display: inline-block; background: rgba(255,255,255,.14); color: var(--c-approve-soft);
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
  padding: 5px 10px; border-radius: var(--r-pill);
  /* A tier name, not prose: bidi would otherwise render it "+TEAM" in Arabic. */
  direction: ltr; unicode-bidi: isolate;
}
.av-spot-h { margin: 14px 0 8px; font-size: 19px; line-height: 1.25; font-weight: 800; color: #fff; }
.av-spot p { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: #B9CCE0; max-width: 30ch; }
.av-spot-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  background: #fff; color: var(--c-primary); border-radius: var(--r-pill);
  font-weight: 700; font-size: 14px; line-height: 1; font-family: inherit; text-decoration: none; position: relative; z-index: 1;
}
.av-spot-img { position: absolute; right: -14px; bottom: -18px; width: 104px; height: auto; opacity: .95; }

.av-panel-foot { border-top: 1px solid var(--c-border-subtle); background: var(--c-canvas); }
.av-panel-foot-in {
  max-width: 1180px; margin: 0 auto; padding: 12px var(--sp-lg);
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap; font-size: 14px;
}
.av-invariant { color: var(--c-ink-muted); }
.av-panel-foot-in a { color: var(--c-primary); font-weight: 600; text-decoration: none; }
.av-panel-foot-in a:hover { text-decoration: underline; }

/* ---- mobile sheet ------------------------------------------------------- */
.av-scrim {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(15,23,42,.42);
}
.av-scrim[hidden], .av-sheet[hidden] { display: none; }

.av-sheet {
  position: fixed; inset: 0; z-index: 120;
  background: var(--c-surface);
  display: flex; flex-direction: column;
}
.av-sheet-top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--c-border-subtle);
}
.av-sheet-x {
  margin-left: auto; width: 44px; height: 44px;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface); font-size: 22px; line-height: 1;
  color: var(--c-ink); cursor: pointer;
}

.av-levels { position: relative; flex: 1; overflow: hidden; }
.av-level {
  position: absolute; inset: 0; background: var(--c-surface);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transition: transform .26s ease;
}
.av-l2 { transform: translateX(100%); border-left: 1px solid var(--c-border-subtle); }
.av-levels.at2 .av-l1 { transform: translateX(-28%); }
.av-levels.at2 .av-l2 { transform: translateX(0); }
/* Level 1 is inert once level 2 covers it, so a swipe or a stray tap cannot
   activate a link the user can no longer see. */
.av-levels.at2 .av-l1 { visibility: hidden; }

.av-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 8px 18px;
  background: none; border: 0; border-bottom: 1px solid var(--c-border-subtle);
  text-align: left; text-decoration: none; color: inherit;
  font: inherit; cursor: pointer;
}
.av-row strong { font-size: 16.5px; font-weight: 650; }
.av-row .av-chev { margin-left: auto; color: var(--c-ink-muted); font-size: 22px; line-height: 1; }
.av-row-spot { background: var(--c-canvas); }

/* Sticky: on a long feature list the way back must not scroll out of reach. */
.av-backrow {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 0 16px;
  background: var(--c-canvas); border: 0; border-bottom: 1px solid var(--c-border-subtle);
  font-weight: 800; font-size: 16px; line-height: 1; font-family: inherit; color: var(--c-primary); cursor: pointer;
}
.av-backrow span { font-size: 24px; line-height: 1; }
.av-grouphead {
  margin: 0; padding: 18px 18px 6px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--c-ink-muted);
}
.av-sheet-cta { padding: 18px; display: grid; gap: 10px; }
.av-sheet-cta .av-cta, .av-sheet-cta .av-signin { justify-content: center; width: 100%; }
/* Fills the dead space under the CTAs on a tall phone rather than leaving
   the sheet looking half-loaded. Decorative, so alt="" and no link. */
.av-sheet-mascot { display: block; width: 120px; height: auto; margin: 18px auto 0; opacity: .5; }
.av-sheet-foot {
  margin: 0; padding: 14px 18px;
  border-top: 1px solid var(--c-border-subtle); background: var(--c-canvas);
  font-size: 13px; line-height: 1.5; color: var(--c-ink-muted);
}

/* ---- breakpoint --------------------------------------------------------- */
/* 960px is where four top-level items plus both actions stop fitting. */
@media (max-width: 960px) {
  .av-menu, .av-actions { display: none; }
  .av-burger { display: flex; }
  .av-panel { display: none !important; }
  .av-topbar { font-size: 12px; padding: 8px 14px; }
  .av-topbar a { display: inline-block; margin-left: 6px; }
}
@media (min-width: 961px) {
  .av-sheet, .av-scrim { display: none !important; }
}

/* Arabic. Mirrors the sheet's slide direction and the spotlight art. */
[dir='rtl'] .av-l2 { transform: translateX(-100%); }
[dir='rtl'] .av-levels.at2 .av-l1 { transform: translateX(28%); }
[dir='rtl'] .av-levels.at2 .av-l2 { transform: translateX(0); }
[dir='rtl'] .av-spot-img { right: auto; left: -14px; transform: scaleX(-1); }
[dir='rtl'] .av-actions, [dir='rtl'] .av-burger { margin-left: 0; margin-right: auto; }
[dir='rtl'] .av-row .av-chev { margin-left: 0; margin-right: auto; transform: scaleX(-1); }
[dir='rtl'] .av-sheet-x { margin-left: 0; margin-right: auto; }
/* "Next" points left when the text runs right-to-left. */
[dir='rtl'] .av-topbar a span, [dir='rtl'] .av-panel-foot-in a span { display: inline-block; transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .av-level, .av-caret { transition: none; }
}

/* Navigation is not content. Printing the legal pages should not waste the
   first page on a menu the reader cannot click. */
@media print {
  .av-topbar, .av-nav, .av-sheet, .av-scrim, .av-skip { display: none !important; }
}
