/*
  TAQELAH Custom CSS
  Mobile-first utilities and iOS safe area support
*/

/* iOS Safe Area Support */
.safe {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Hide scrollbars on horizontal scroll containers */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Snap scrolling for mobile filter buttons */
.snap-x {
  scroll-snap-type: x mandatory;
}

.snap-center {
  scroll-snap-align: center;
}

/* Hide Alpine.js elements before initialization */
[x-cloak] {
  display: none !important;
}

/* Screen reader only utility (for accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Line clamp utilities for text truncation */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Reduce motion for accessibility */
@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;
  }
}

/* Focus visible styles for better keyboard navigation */
*:focus-visible {
  outline: 2px solid #E10600;
  outline-offset: 2px;
}

/* Swiper pagination custom styles for touch-friendly bullets */
.swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background-color: #D1D5DB;
  opacity: 1;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  background-color: #E10600;
  width: 32px;
  border-radius: 6px;
}

/* Ensure images maintain aspect ratio */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent layout shift from images */
img[width][height] {
  height: auto;
}

/* Better tap highlight color for mobile */
* {
  -webkit-tap-highlight-color: rgba(225, 6, 0, 0.1);
}

/* Smooth scrolling (respects prefers-reduced-motion) */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Custom selection color */
::selection {
  background-color: #E10600;
  color: #FFFFFF;
}

/* Form input styles for better mobile experience */
input[type="email"],
input[type="text"],
input[type="tel"],
input[type="url"],
textarea,
select {
  font-size: 16px; /* Prevents iOS zoom on focus */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Better focus styles for form elements */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  ring: 2px;
  ring-color: #E10600;
}

/* Prevent text size adjust on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
