/* ==========================================================================
   base.css
   1) Reset  2) Element defaults  3) Utilities  4) Shared primitives
   لا يحتوي أي تخطيط للأقسام (موجود في layout.css).
   ========================================================================== */

/* ---------- 1) Reset ---------- */

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

ul,
ol {
  list-style: none;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

address {
  font-style: normal;
}

[hidden] {
  display: none !important;
}

/* ---------- 2) Element defaults ---------- */

body {
  min-height: 100vh;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
}

h1 {
  font-size: var(--font-size-2xl);
}

h2 {
  font-size: var(--font-size-xl);
}

h3 {
  font-size: var(--font-size-lg);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  padding: var(--space-2) var(--space-4);
  background-color: transparent;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-base);
  cursor: pointer;
}

:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- 3) Utilities ---------- */

/* إخفاء مرئي مع بقاء المحتوى متاحاً لقارئات الشاشة */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* رابط تخطي المحتوى: مخفي حتى يحصل على التركيز بلوحة المفاتيح */
.skip-link {
  position: absolute;
  top: 0;
  right: 0;
  z-index: var(--z-floating);
  padding: var(--space-3) var(--space-4);
  color: var(--color-on-action);
  background-color: var(--color-action);
  transform: translateY(-100%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 4) Shared primitives ---------- */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-min-height);
  padding: var(--space-2) var(--space-5);
  font-weight: var(--font-weight-bold);
  text-align: center;
  text-decoration: none;
  border: var(--border-width) solid var(--color-action);
  border-radius: var(--radius-base);
  cursor: pointer;
}

.btn--primary {
  color: var(--color-on-action);
  background-color: var(--color-action);
}

.btn--primary:hover {
  background-color: var(--color-action-hover);
  border-color: var(--color-action-hover);
}

.btn--secondary {
  color: var(--color-text);
  background-color: transparent;
}

.btn--secondary:hover {
  background-color: var(--color-hover-surface);
}

/* Placeholder: عنصر نائب يظهر بوضوح أنه ينتظر محتواه لاحقاً */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  color: var(--color-placeholder-text);
  text-align: center;
  background-color: var(--color-placeholder-background);
}


