/* ============================================================
   شبكة الأنوار الخمسة — Base Stylesheet
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
  direction: rtl;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body, 'Cairo', sans-serif);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
  color: var(--color-text);
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

/* ── Media ── */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Forms & Interactive ── */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

ul[role="list"], ol[role="list"] { list-style: none; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-hover); }

table { border-collapse: collapse; width: 100%; }

/* ── Selection ── */
::selection {
  background: oklch(from var(--color-primary) l c h / 0.20);
  color: var(--color-text);
}

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Transitions for interactive elements ── */
a, button, [role="button"], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    opacity var(--transition-interactive),
    transform var(--transition-interactive);
}

/* ── Reduced Motion ── */
@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;
  }
}

/* ── Accessibility ── */
.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;
}

/* ── Layout Containers ── */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow  { max-width: var(--content-narrow); }
.container--default { max-width: var(--content-default); }
.container--wide    { max-width: var(--content-wide); }

@media (max-width: 768px) {
  .container { padding-inline: var(--space-4); }
}

/* ── Section Spacing ── */
.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.section--sm {
  padding-block: clamp(var(--space-8), 4vw, var(--space-16));
}

/* ── Dark Section Override ── */
.section--dark {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-text);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-dark-text);
}
.section--dark p,
.section--dark li {
  color: var(--color-dark-muted);
}

/* ── Divider ── */
hr {
  border: none;
  border-top: 1px solid var(--color-divider);
  margin-block: var(--space-8);
}

/* ── Scroll-Driven Reveal Animations ── */
.reveal {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
  .reveal--delay-1 { animation-delay: 80ms; }
  .reveal--delay-2 { animation-delay: 160ms; }
  .reveal--delay-3 { animation-delay: 240ms; }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Stagger for grid children */
.reveal-stagger > * {
  opacity: 1;
}
@supports (animation-timeline: scroll()) {
  .reveal-stagger > * {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 70%;
  }
  .reveal-stagger > *:nth-child(1) { animation-delay: 0ms; }
  .reveal-stagger > *:nth-child(2) { animation-delay: 80ms; }
  .reveal-stagger > *:nth-child(3) { animation-delay: 160ms; }
  .reveal-stagger > *:nth-child(4) { animation-delay: 240ms; }
  .reveal-stagger > *:nth-child(5) { animation-delay: 320ms; }
  .reveal-stagger > *:nth-child(6) { animation-delay: 400ms; }
}

/* ── Gradient Text Utility ── */
.text-gradient {
  background: linear-gradient(
    135deg in oklab,
    var(--color-primary) 0%,
    var(--color-gold) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── Gold Accent Line ── */
.accent-line {
  display: inline-block;
  width: 3rem;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
  border-radius: var(--radius-full);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge--primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
/* ترتيب العنوان والوسم بجانب بعضهما في المنتصف */
.service-card__title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}

/* تنسيق الوسم ليكون بارزاً وفخماً */
.badge--gold {
  background-color: var(--color-gold, #d97706);
  color: #ffffff;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem; /* خط أصغر بقليل من العنوان */
  font-weight: 700;
  border-radius: 50px; /* جعل الأطراف دائرية تماماً */
  transform: translateY(-6px); /* رفع الوسم للأعلى بمقدار 3 بكسل */
  /* ظل ذهبي خفيف جداً لتعزيز البروز */
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25); 
}

/* ── Section Label ── */
.section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 2px;
  background: var(--color-gold);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ── Skeleton Loader ── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 25%,
    var(--color-surface-dynamic) 50%,
    var(--color-surface-offset) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── Number with tabular numerals ── */
.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum', 'lnum';
}
html {
  scroll-padding-top: 5rem; /* يضمن صحة التنقل عبر الروابط */
}