/*
 * Avo + global navigation: our menu owns the full-height left edge of the window;
 * the entire Avo page (its own top bar included) is shifted right of it; Avo's own
 * left sidebar is suppressed. The Avo page is wrapped in .viewport.avo-frame >
 * .gn-avo-page by the layout override (app/views/layouts/avo/application.html.erb),
 * so --nav-w (driven by the controller) cascades to the shift — collapse/expand
 * reflows the Avo page like a modern page. Loaded after components/global_navigation.css
 * in avo/partials/_pre_head.
 */

/* The frame wraps the Avo page. Unlike modern pages (where .viewport traps scroll
   in the .shell at height:100vh/overflow:hidden), Avo scrolls the document — so
   neutralize the base .viewport's height/overflow/background. */
.viewport.avo-frame {
  position: static;
  height: auto;
  min-height: 100vh;
  overflow: visible;
  background: transparent;
}

/* Menu: fixed to the left edge, full viewport height, width driven by --nav-w.
   Child combinator (> .panel) so this can't bleed into a nested .panel inside an
   Avo page's own content — same scoping discipline as components/global_navigation.css. */
/* top offsets by the dev slot-indicator bar height when present so the menu sits
   in the same place as on modern pages (where the in-flow .viewport already clears
   the bar via its body padding-top). --ops-slot-bar-h is set only by the dev
   SlotIndicatorMiddleware; in production the bar doesn't exist and the var falls
   back to 0px. top + bottom define the height (no explicit height, which would
   over-constrain and push the panel below the fold once top is non-zero). */
.viewport.avo-frame > .panel {
  position: fixed;
  top: var(--ops-slot-bar-h, 0px);
  bottom: 0;
  left: 0;
}

/* Avo's page, shifted right of the menu. border-box keeps it inside the viewport
   (no horizontal scroll). */
.viewport.avo-frame .gn-avo-page {
  box-sizing: border-box;
  min-height: 100vh;
  padding-left: var(--nav-w);
}

/* Avo's top bar is position:fixed w-full — re-anchor it to begin at the menu's
   right edge instead of spanning the whole window. */
.viewport.avo-frame .gn-avo-page .fixed.h-16 {
  left: var(--nav-w) !important;
  right: 0 !important;
  width: auto !important;
}

/* Suppress Avo's own sidebar + its toggle (our menu replaces them), and reclaim the
   space Avo reserves for the open sidebar. */
.avo-sidebar { display: none !important; }
[data-action*="sidebar#toggleSidebar"] { display: none !important; }
.content-area.sidebar-open { padding-left: 0 !important; }

/* Avo's top bar keeps a logo + menu-toggle block at its left — redundant now that
   our menu owns the left edge. Hide it; Avo's search + header shift to the bar's
   left edge (which is already re-anchored to the menu's right edge above). */
.viewport.avo-frame .gn-avo-page .fixed.h-16 > div:first-child { display: none !important; }

/* Avo's "FromDayOne Operations" home link is redundant — the global nav owns the
   brand and home. Remove it on every page (desktop + mobile). */
.viewport.avo-frame .gn-avo-page .fixed.h-16 a[href="/"] { display: none !important; }

/* Avo's ⌘K search-shortcut badge is chronically misaligned and the shortcut is
   unwanted — the search field itself stays clickable. Remove the badge on every page. */
.viewport.avo-frame .gn-avo-page .fixed.h-16 :has(> kbd) { display: none !important; }

/* ===== Mobile (< 768px): same top-bar + drawer presentation as modern pages =====
   The desktop embed above pins the panel to the left edge; below 768px it must
   instead be the slide-in drawer (the component CSS handles the panel's drawer
   transform via `.viewport > .panel`, but the .avo-frame-scoped pinning above wins
   on specificity, so re-assert the drawer positioning here). Avo's page drops the
   left offset and clears our 52px top bar; Avo's own navbar shifts below it. */
@media (max-width: 767px) {
  .viewport.avo-frame > .panel {
    width: 86%;
    max-width: 340px;
  }
  .viewport.avo-frame .gn-avo-page { padding-left: 0; padding-top: 52px; }
  /* Avo's own navbar is redundant on mobile — our top bar is the only chrome. Hide it
     entirely (it otherwise overlaps/bleeds through the drawer) and reclaim the space
     Avo's content area reserves for it (the pt-16 below the now-absent navbar). */
  .viewport.avo-frame .gn-avo-page .fixed.h-16 { display: none !important; }
  .viewport.avo-frame .gn-avo-page .content-area { padding-top: 0 !important; }
}
