/* ============================================================
   Base Styles — Reset + RTL-first Foundation + Typography + Grid
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  transition:
    background var(--motion-standard) var(--ease-standard),
    color var(--motion-standard) var(--ease-standard);
}

/* اللغة الإنجليزية أو الأرقام يمكن أن تستخدم خط لاتيني عند الحاجة */
[dir="ltr"],
.ltr {
  font-family: var(--font-family-en);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}
input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

/* حالة التركيز الموحدة للوصولية */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* شريط تمرير هادئ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
  background-clip: content-box;
}

/* -----------------------------------------------------------
   التدرج الطباعي — Typography Classes
   ----------------------------------------------------------- */
.text-display {
  font-size: var(--font-size-display);
  line-height: var(--line-height-display);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
}
.text-page-title {
  font-size: var(--font-size-page-title);
  line-height: var(--line-height-title);
  font-weight: var(--font-weight-bold);
}
.text-section-title {
  font-size: var(--font-size-section-title);
  line-height: var(--line-height-title);
  font-weight: var(--font-weight-semibold);
}
.text-card-title {
  font-size: var(--font-size-card-title);
  line-height: var(--line-height-title);
  font-weight: var(--font-weight-semibold);
}
.text-body {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-regular);
}
.text-label {
  font-size: var(--font-size-label);
  line-height: var(--line-height-label);
  font-weight: var(--font-weight-medium);
}
.text-helper {
  font-size: var(--font-size-helper);
  line-height: var(--line-height-label);
  color: var(--text-secondary);
}
.text-caption {
  font-size: var(--font-size-caption);
  line-height: var(--line-height-label);
  color: var(--text-tertiary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-tertiary {
  color: var(--text-tertiary);
}
.text-primary-color {
  color: var(--color-primary);
}

/* حركة الظهور العام لعناصر تدخل الصفحة */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-in {
  animation: fadeInUp var(--motion-slow) var(--ease-decelerate) both;
}
