/* ============================================================
   المُنظِّم | AL-MUNAZZIM — Base Reset & Typography
   ============================================================ */

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

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

body {
  font-family: var(--font-current);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100%;
  min-height: 100dvh;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* الخط الإنجليزي يستخدم Manrope تلقائياً عبر font-family fallback في النصوص اللاتينية */
html[lang="en"] body {
  font-family: var(--font-en);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* التمرير */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* حالة التركيز عبر لوحة المفاتيح — لا نخفيها إطلاقاً */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--olive-300);
  color: var(--olive-950);
}

/* شريط تمرير مخصص خفيف */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--stone-300);
  border-radius: var(--radius-full);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--stone-700);
}

[hidden] {
  display: none !important;
}
