/**
 * BAYA site-wide baseline: predictable box model, overflow safety,
 * media defaults, touch-friendly forms on phones, reduced motion.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

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

/* Long copy / URLs wrap instead of forcing horizontal scroll */
p,
li,
dd,
blockquote,
td,
th {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.marquee-item {
  overflow-wrap: normal;
}

/* Coarse pointers: easier taps on inputs and primary actions */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea {
    min-height: 44px;
  }
}

/* iOS Safari: 16px+ on common fields reduces focus-zoom */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea {
    font-size: max(1rem, 16px);
  }
}

/* Keyboard focus visibility for accessibility */
:focus-visible {
  outline: 2px solid #1A4389;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Safe area for mobile browsers with bottom bars */
@media (max-width: 1023px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Smoother touch scrolling on mobile */
* {
  -webkit-overflow-scrolling: touch;
}

/* Prevent horizontal overflow on all pages */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

@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;
  }
}
