/* ─────────────────────────────────────────────────────
   OSUS Reset & Base
   ───────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

html:not([dir="ltr"]) {
  direction: rtl;
}

html[dir="ltr"] {
  direction: ltr;
}

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

body {
  font-family: var(--font-arabic);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--warm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  overflow-y: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  right: 0;
  z-index: var(--z-cursor);
  padding: var(--space-3) var(--space-6);
  background: var(--orange);
  color: var(--text-on-orange);
  font-weight: var(--weight-bold);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--duration-fast) var(--ease-decelerate);
}

.skip-link:focus {
  top: 0;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Media */
img, video, svg {
  display: block;
  max-width: 100%;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Typography defaults */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

p {
  max-width: 65ch;
}

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

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

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

/* Horizontal scroll container */
.overflow-x-auto {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Visually hidden (accessible) */
.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;
}

/* Number formatting */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Scroll padding for anchor links */
:target {
  scroll-margin-top: calc(var(--header-height) + 2rem);
}
