/* JHACAL iOS/iPad Compatibility Bundle
   Shared across all apps for consistent mobile behaviour.
   Include BEFORE app-specific CSS for correct cascade. */

/* ── Safe Area Utilities ── */
.safe-top    { padding-top:    env(safe-area-inset-top, 0); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }
.safe-left   { padding-left:   env(safe-area-inset-left, 0); }
.safe-right  { padding-right:  env(safe-area-inset-right, 0); }

/* ── Touch Interaction Improvements ── */
button, a, [role="button"], [tabindex="0"],
input[type="submit"], input[type="button"],
.tile, .btn, .launch-tile, .app-tile {
  touch-action: manipulation;                /* eliminates 300ms tap delay */
  -webkit-tap-highlight-color: transparent;
}

/* Apple Human Interface Guidelines: 44pt minimum touch target */
button, [role="button"],
input[type="submit"], input[type="button"] {
  min-height: 44px;
}

/* ── Smooth Scrolling for iOS ── */
[style*="overflow"],
.modal-body, .card, .content-scroll,
.scroll-container {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;    /* prevents scroll chaining */
}

/* ── Prevent iOS text size adjustment ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── Reduced Motion Support ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Prevent overscroll bounce on body (iOS Safari) ── */
body {
  overscroll-behavior: none;
}

/* ── Fix for iOS 100vh including address bar ── */
/* Use this class on elements that should be exactly viewport height */
.full-height {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height — iOS Safari respects this */
}
