/* ============================================================
   مهد — Base + Components
   يعتمد على tokens.css — لا ألوان خام هنا
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-sm));
}

body {
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-reg);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-sm);
  top: -100px;
  z-index: var(--z-modal);
  background: var(--accent);
  color: var(--text-on-accent);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-bold);
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible { top: var(--space-sm); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  line-height: var(--lh-head);
  color: var(--text-strong);
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { text-wrap: pretty; }

/* الأرقام واللاتينية دائمًا LTR داخل نص عربي */
.ltr, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--fs-sm);
  font-weight: var(--fw-med);
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}
/* ② خط رفيع ذهبي، والنص نفسه كحلي */
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--gold-line);
  flex: none;
}

.tag-en {
  font-family: var(--font-en);
  font-style: italic;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text-subtle);
}

.lead {
  font-size: var(--fs-md);
  font-weight: var(--fw-light);
  color: var(--text-muted);
  max-width: 60ch;
}

/* ① الاستخدام النصي الوحيد للذهبي: كلمة مميّزة داخل عنوان */
em, .accent { color: var(--gold); font-style: normal; }
strong { font-weight: var(--fw-bold); color: var(--text-strong); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { max-width: var(--container-narrow); }

.section {
  padding-block: clamp(var(--space-2xl), 9vw, var(--space-4xl));
  border-top: var(--rule);
}
.section--flush { border-top: 0; }
.section--alt { background: var(--surface-alt); }
.section--dark { background: var(--surface-page); }

.section-head { max-width: 62ch; margin-bottom: var(--space-xl); }
.section-head h2 { margin-bottom: var(--space-sm); }

.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: 48px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--btn-radius);
  border: 1.5px solid transparent;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { background: var(--navy-900); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
/* على الكحلي يصير الزر كريميًا، وعند المرور يزداد بياضًا */
.on-dark .btn-primary:hover { background: var(--white); }

.btn-outline { border-color: var(--border-strong); color: var(--text-strong); }
.btn-outline:hover { border-color: var(--text-strong); background: rgba(11, 31, 62, .06); }
.on-dark .btn-outline:hover { background: rgba(245, 239, 227, .08); }

.btn-ghost { color: var(--accent); padding-inline: var(--space-2xs); }
.btn-ghost:hover { color: var(--accent-hover); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* رابط بسهم — السهم يتبع اتجاه الكتابة */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  color: var(--accent);
  font-weight: var(--fw-med);
  transition: gap var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.link-arrow svg { transition: transform var(--dur-base) var(--ease-out); }
[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
.link-arrow:hover { gap: var(--space-2xs); color: var(--accent-hover); }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  box-shadow: var(--card-shadow);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent-soft);
}
.card h3 { margin-bottom: var(--space-2xs); }
.card p { color: var(--text-muted); font-size: var(--fs-sm); }

.card-num {
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  letter-spacing: .1em;
  margin-bottom: var(--space-xs);
}

/* ④ أيقونة صغيرة ذهبية داخل إطار كحلي رفيع */
.icon-frame {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--gold);
  margin-bottom: var(--space-md);
}
.icon-frame svg { width: 21px; height: 21px; }

/* ---------- Stats ---------- */
.stat-n {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 2px;
  direction: ltr;
  justify-content: flex-start;
}
[dir="rtl"] .stat-n { justify-content: flex-end; flex-direction: row-reverse; }
.stat-n .unit { color: var(--accent); font-size: .62em; }
.stat-l {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--space-2xs);
  max-width: 26ch;
}
.stat { padding-top: var(--space-md); border-top: 2px solid var(--gold-line); }

/* ---------- Divider ---------- */
/* ③ فاصل رفيع ذهبي */
.rule-accent {
  width: 48px;
  height: 2px;
  background: var(--gold-line);
  border: 0;
  margin-block: var(--space-md);
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.header[data-scrolled="true"] {
  border-bottom-color: var(--header-border);
  box-shadow: var(--shadow-xs);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
}
/* الشعار وحده يحمل اسم العلامة — لا نص مرافق */
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand-logo { width: auto; display: block; }
.brand-logo--header { height: 40px; }
.brand--footer { min-height: 0; margin-bottom: var(--space-md); }
.brand-logo--footer { height: 104px; }
@media (max-width: 620px) { .brand-logo--header { height: 34px; } }

.nav { display: flex; align-items: center; gap: clamp(.5rem, 2vw, 1.75rem); }
.nav a {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: var(--fw-med);
  color: var(--text-muted);
  padding-block: var(--space-2xs);
  transition: color var(--dur-base) var(--ease-out);
}
.nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: var(--origin, right);
  transition: transform var(--dur-base) var(--ease-out);
}
.nav a:hover { color: var(--text-strong); }
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--text-strong); font-weight: var(--fw-bold); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-2xs); }

.lang-toggle {
  min-height: 44px;
  min-width: 48px;
  padding-inline: var(--space-xs);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: .08em;
  color: var(--text-strong);
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.lang-toggle:hover { border-color: var(--accent); background: rgba(11, 31, 62, .06); }

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--text-strong);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2xs) var(--gutter) var(--space-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out),
                visibility var(--dur-base);
  }
  .nav[data-open="true"] { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav a { padding-block: var(--space-sm); border-bottom: 1px solid var(--border-faint); font-size: var(--fs-base); }
  .nav a::after { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--surface-page);
  padding-block: var(--space-2xl) var(--space-lg);
  border-top: var(--rule);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.35fr;
  gap: var(--space-xl) var(--space-lg);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 1000px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); } }

.footer h2 {
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  letter-spacing: .08em;
  color: var(--text-subtle);
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
}

/* عمود العلامة */
.footer-name {
  font-family: var(--font-head);
  font-size: var(--fs-md);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  margin-bottom: var(--space-3xs);
}
.footer-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 34ch;
  margin-bottom: var(--space-md);
}

.social-row { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  transition: color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.social svg { width: 19px; height: 19px; }
.social:hover {
  color: var(--text-on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

/* أعمدة الروابط */
.footer-links { display: grid; gap: var(--space-2xs); }
.footer-links a,
.footer-contact a:not(.btn) {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  transition: color var(--dur-base) var(--ease-out);
}
.footer-links a:hover,
.footer-contact a:not(.btn):hover { color: var(--accent); }

/* عمود التواصل */
.footer-contact {
  display: grid;
  gap: var(--space-2xs);
  justify-items: start;
  font-style: normal;   /* <address> */
}
.footer-addr {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 26ch;
  line-height: 1.7;
}
.btn-wa {
  margin-top: var(--space-2xs);
  min-height: 44px;
  padding: .7rem 1.15rem;
  font-size: var(--fs-sm);
}
.btn-wa svg { width: 18px; height: 18px; }

/* الشريط السفلي */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  text-align: center;
}
.footer-bottom a { transition: color var(--dur-base) var(--ease-out); }
.footer-bottom a:hover { color: var(--accent); }
.footer-sep { opacity: .45; }
@media (max-width: 560px) { .footer-sep { display: none; } .footer-bottom { gap: var(--space-3xs); flex-direction: column; } }

/* ---------- Closer (CTA) ---------- */
.closer { background: var(--surface-inverse); text-align: center; }
.closer .container { max-width: 58ch; }
.closer h2 { margin-bottom: var(--space-sm); }
.closer p { color: var(--text-muted); margin-bottom: var(--space-lg); }
.closer .btn-row { justify-content: center; }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--space-3xs); margin-bottom: var(--space-md); }
.field label { font-size: var(--fs-sm); font-weight: var(--fw-med); color: var(--text-strong); }
.field .req { color: var(--danger-600); }
.field input, .field textarea {
  width: 100%;
  min-height: 48px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  padding: var(--field-pad-y) var(--field-pad-x);
  color: var(--text-body);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 31, 62, .16);
}
.field .hint { font-size: var(--fs-xs); color: var(--text-subtle); }
.field[data-invalid="true"] input,
.field[data-invalid="true"] textarea { border-color: var(--danger-600); }
.field .err { font-size: var(--fs-xs); color: var(--danger-600); }

.form-status { font-size: var(--fs-sm); margin-top: var(--space-sm); min-height: 1.5em; }
.form-status[data-state="err"] { color: var(--danger-600); }
.form-status[data-state="ok"] { color: var(--success-600); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}
.reveal[data-visible="true"] { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 60ms; }
.reveal.d2 { transition-delay: 120ms; }
.reveal.d3 { transition-delay: 180ms; }
.reveal.d4 { transition-delay: 240ms; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .header, .footer, .closer, .hero-map, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
