/* ==========================================================================
   حِلْية — HILYA | الأساسيات والتصفير والخطوط (Base & Typography)
   ========================================================================== */

/* استيراد الخطوط الرسمية من Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap');

/* تصفير الصندوق والقياسات */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-main);
  background-color: var(--color-bg-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* تلوين النصوص المحددة */
::selection {
  background-color: var(--color-surface-rose);
  color: var(--color-primary);
}

/* رابط التخطي للمحتوى الأساسي لسهولة الوصول (Skip Link) */
.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: var(--space-md);
  background: var(--color-primary);
  color: #ffffff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
  outline: none;
  box-shadow: var(--focus-ring);
}

/* العناوين والطباعة */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  line-height: var(--line-height-tight);
  text-wrap: balance;
}

h1 { font-size: var(--font-size-3xl); margin-bottom: var(--space-md); }
h2 { font-size: var(--font-size-2xl); margin-bottom: var(--space-sm); }
h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-xs); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-main);
}

p.lead {
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-champagne-dark);
}

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

ul, ol {
  list-style: none;
}

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

/* الحاويات وشبكات التخطيط الأساسية */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

@media (min-width: 768px) {
  .container, .container-narrow {
    padding-inline: var(--space-xl);
  }
}

/* فئات مساعدة للنصوص والعناصر */
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-end { text-align: end; }
.text-muted { color: var(--color-text-muted); }
.text-champagne { color: var(--color-champagne-dark); }
.text-primary { color: var(--color-primary); }

.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-numeric);
}

/* عزل قارئات الشاشة */
.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;
}

/* الفواصل الزخرفية الرفيعة */
.divider {
  height: 1px;
  background-color: var(--color-border);
  margin-block: var(--space-xl);
  border: none;
}

.divider-champagne {
  height: 2px;
  width: 48px;
  background: linear-gradient(90deg, var(--color-champagne), transparent);
  margin-block: var(--space-md);
  border: none;
}
