/*
 * engine_overrides.css — host-side overrides that compensate for gaps/bugs in
 * the arqu_ui (Metronic/KTUI) engine layout, kept OUT of application.css so the
 * "things we override because the engine doesn't ship them" live in one isolated,
 * easy-to-retire place. Loaded after the engine CSS and id's utilities (see
 * layouts/_head). Each block names the upstream gap it works around; remove a
 * block when the engine ships the fix.
 *
 * BREAKPOINT EQUIVALENCE (keep in sync): the 64rem media queries below are the
 * engine's single desktop breakpoint — `var(--kt-drawer-enable)` flips at 64rem
 * (arqu_ui layout.css), which equals Tailwind's `lg` token and, at the default
 * 16px root font-size, 1024px. The screenshot harness encodes the same value as
 * `LG_BREAKPOINT_PX = 1024` (test/system/design_screenshots_test.rb). If the
 * engine ever changes the drawer breakpoint or the root font-size changes, update
 * all three together (here, Tailwind config, and the test constant).
 */

/*
 * Desktop drawer reset — works around arqu-co/arqu-ui#121.
 *
 * The app shell (layouts/_app_nav.html.erb) doubles its `.kt-header-nav` as a
 * responsive off-canvas drawer below 64rem. KTDrawer applies the off-canvas
 * classes (`kt-drawer kt-drawer-start` → position:fixed, inset:0, slid
 * off-screen) plus inline transform/inset styles when enabled, and is supposed to
 * drop them at >=64rem (where `--kt-drawer-enable:false`). But KTDrawer reads the
 * width at init and does NOT re-evaluate on resize, so a
 * load-at-mobile-then-resize-to-desktop (or a tablet rotate) leaves the panel
 * stuck off-canvas at desktop width and the nav leaks off-screen-left (the engine
 * ships no reset at all for a drawer-ified header-nav).
 *
 * This block re-asserts the desktop layout regardless of KTDrawer's stale state.
 * It is deliberately tied to KTDrawer's current inline-style implementation
 * (hence the !important, which is what beats those inline styles) and is a
 * STOPGAP — remove it once the engine ships the robust desktop reset / resize
 * re-evaluation tracked in arqu-co/arqu-ui#121.
 */
@media (min-width: 64rem) {
  /* App top-nav: always inline static chrome in the header row. */
  .kt-app-layout .kt-header-nav {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    z-index: auto;
    width: auto;
    flex-direction: row;
    background-color: transparent;
    box-shadow: none;
    transition: none;
  }

  /* A stale-open drawer can also leave its fixed dark backdrop behind at desktop;
     never show the nav drawer's backdrop above the breakpoint. */
  .kt-app-layout .kt-drawer-backdrop {
    display: none;
  }
}
