/**
 * native-ios.css — Safe-area adaptations for the iOS WKWebView wrapper.
 *
 * Every rule is scoped under `html.platform-ios`, a class set only by the
 * Capacitor bridge when running inside the iOS app. On the web this file is a
 * complete no-op, so the deployed PWA is unaffected.
 *
 * Requires `viewport-fit=cover` in the viewport meta (set in the HTML head) so
 * `env(safe-area-inset-*)` resolves to real notch / home-indicator values.
 */

/* Pad the document for the notch (top) and home indicator (bottom). */
html.platform-ios body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Avoid the soft black bar bleeding through during rubber-band scroll. */
  background-color: var(--theme-bg-light, #fdf2f8);
}

html.platform-ios body.dark {
  background-color: #0f0f1a;
}

/*
 * Lift bottom-anchored floating controls (FABs, timers, toasts) clear of the
 * home indicator. The base layout uses Tailwind bottom-6 (1.5rem) / bottom-24
 * (6rem); we add the inset on top of those so they never sit under the bar.
 */
html.platform-ios .fixed.bottom-6 {
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
html.platform-ios .fixed.bottom-4 {
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
html.platform-ios .fixed.bottom-20 {
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}
html.platform-ios .fixed.bottom-24 {
  bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
}

/* Sticky modal footers should also clear the home indicator. */
html.platform-ios .sticky.bottom-0 {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/*
 * Disable the iOS long-press text-selection / callout on tappable chrome so
 * the app feels native (inputs and editable content keep normal behavior).
 */
html.platform-ios button,
html.platform-ios .theme-btn,
html.platform-ios [onclick] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html.platform-ios input,
html.platform-ios textarea,
html.platform-ios select,
html.platform-ios [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
