/* Explain: Browser compatibility and touch interaction styles. */
/* 1) الأساسيات: منع التكبير التلقائي للنص على iOS ومنع وميض اللمس */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 2) منع التحديد/القائمة الطويلة عند الضغط المطوّل على الأزرار والروابط (iOS/Safari) */
a,
button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 3) تناسق لون تحديد النص عبر المتصفحات */
::selection {
    background-color: var(--primary-color, #e60000);
    color: #ffffff;
}
::-moz-selection {
    background-color: var(--primary-color, #e60000);
    color: #ffffff;
}

/* 4) إطار واضح للتركيز عبر لوحة المفاتيح (Safari و Firefox و Chromium) */
:focus-visible {
    outline: 2px solid var(--primary-color, #e60000);
    outline-offset: 2px;
}

/* 5) تطبيع عناصر النموذج عبر المتصفحات */
input,
select,
textarea,
button {
    font-family: inherit;
}

input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 6) الوسائط: منع السحب العرضي ومنع حواف الاختيار */
img,
video {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

audio,
video {
    -webkit-playsinline: true;
}

/* 7) تمرير iOS سلس داخل اللوحات والقوائم دون كسر تمرير الصفحة */
.overflow-y-auto,
.overflow-auto {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 8) احترام تفضيل تقليل الحركة (إمكانية الوصول) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}