/* css/components/responsive.css */

/*
 * Mobile layout applies when:
 * - viewport width ≤768px (phones portrait, narrow windows), or
 * - landscape with limited height (typical phone horizontal: wide width would otherwise skip mobile-only rules).
 */
/* ============================================
   DESKTOP DEFAULTS
   ============================================ */
.header-nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ============================================
   LEGACY MOBILE-ONLY SCREEN
   Kept hidden so the real app remains available
   on phones.
   ============================================ */
#mobile-only-screen {
  display: none !important;
}

@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  html,
  body {
    width: 100%;
    /* App-like shell: the page must never slide sideways or rubber-band.
       `clip` (unlike `hidden`) creates no scroll container at all. */
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior: none;
  }

  body {
    min-height: 100dvh;
    background: linear-gradient(180deg, #e9f7ff 0%, #f7fbff 44%, #f4f7ff 100%);
    -webkit-text-size-adjust: 100%;
    /* Vertical scrolling only: horizontal swipes are ignored so the whole
       page cannot drift. Inner horizontal scrollers still work because the
       gesture is implemented by the inner scroller, not by body. */
    touch-action: pan-y;
  }

  #app {
    display: block;
    min-width: 0;
  }

  .app-container {
    max-width: 100%;
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) 0 max(26px, env(safe-area-inset-bottom)) 12px;
    box-sizing: border-box;
  }

  #main-content {
    min-width: 0;
    width: 100%;
  }

  img,
  svg,
  canvas,
  video {
    max-width: 100%;
  }

  button,
  [role="button"],
  .part-number {
    /* min-height: 44px; */
  }

}

/* Exercise view: use minimal horizontal padding to maximize reading width */
@media (max-width: 768px) {
  body:has(.dashboard-layout--exercise) .app-container {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: 0;
  }
}
