/* ==========================================================================
   BMCA — الجمعية التعاونية لإدارة المباني
   نظام التصميم وأنماط الموقع  —  مكتوب يدويًا، مستقل تمامًا عن Webflow
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) الخطوط
   Saudi Font: الملفات الرسمية في public/fonts/saudi/ (Regular 400 + Bold 700)
   إن لم تكن موجودة يسقط العنوان تلقائيًا إلى Noto Sans Arabic بلا أي خطأ.
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   الخط السعودي — الملفات الرسمية من وزارة الثقافة، منسوخة كما هي بلا تحويل
   ولا إعادة تسمية. الحزمة الرسمية تحتوي وزنين فقط: Regular 400 و Bold 700.
   لا يوجد Medium، فلم يُعرَّف.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Saudi";
  src: url("/fonts/saudi/SaudiWeb-Bold.woff2") format("woff2"),
       url("/fonts/saudi/SaudiWeb-Bold.woff")  format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ملف Regular 400 موجود في المستودع لكنه غير مُعرَّف هنا عمدًا:
   العناوين التي تستخدم الخط السعودي كلها بوزن 700، فلا يُحمَّل وزن غير مستخدم. */

/* --------------------------------------------------------------------------
   2) الرموز (Design tokens)
   -------------------------------------------------------------------------- */
:root {
  /* الهوية */
  --navy:   #17324D;
  --teal:   #147D78;
  --copper: #C98245;
  --sand:   #E8DECF;
  --ivory:  #F7F6F2;
  --white:  #FFFFFF;

  /* مشتقات وظيفية */
  --line:        #E5DED2;
  --line-dark:   #2A4A68;
  --ink:         var(--navy);
  --ink-soft:    #40566E;
  --on-dark:     #FFFFFF;
  --on-dark-soft:#E8DECF;
  --field-ink:   #1F2D2C;
  --teal-dark:   #0F625E;
  --focus:       #C98245;

  /* الخطوط */
  --font-head: "Noto Sans Arabic", "Tahoma", sans-serif;
  --font-body: "Noto Sans Arabic", "Tahoma", sans-serif;

  /* القياسات */
  --container: 1200px;
  --gutter: 32px;
  --section-y: 96px;
  --radius-card: 16px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-h: 84px;

  /* الحركة */
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* --------------------------------------------------------------------------
   3) إعادة الضبط
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* clip بدل hidden: يمنع التمرير الأفقي دون كسر position: sticky */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p { margin: 0; }

/* --------------------------------------------------------------------------
   الخط السعودي — العربية فقط
   القيد `html[lang="ar"]` يمنع تسرّبه إلى /en/ نهائيًا.
   لم يُغيَّر أي حجم أو line-height أو لون أو مسافة — استبدال عائلة الخط فقط.
   -------------------------------------------------------------------------- */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] .about__words {
  font-family: "Saudi", "Noto Sans Arabic", "Tahoma", sans-serif;
}

/* H3 و H4 وعناوين البطاقات تعود إلى Noto Sans Arabic بوزن 700 —
   ليبقى الخط السعودي خطَّ هوية للعناوين الكبيرة لا خطًّا عامًّا. */
html[lang="ar"] h3,
html[lang="ar"] h4 {
  font-family: "Noto Sans Arabic", "Tahoma", sans-serif;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   4) RTL — محاذاة يمين دائمًا، وعزل صحيح للمصطلحات اللاتينية
   -------------------------------------------------------------------------- */
html[dir="rtl"] body { direction: rtl; }

p, li, label, td, th,
.card_text, .about_text, .vm_text, .service_desc,
.ondemand_text, .how_desc, .sector_desc, .why_text,
.hero_text, .section_subtitle, .national_text {
  text-align: start;              /* لا justify إطلاقًا — start = يمين في العربية، يسار في الإنجليزية */
  text-wrap: pretty;
}

/* المصطلحات اللاتينية داخل النص العربي: BMCA / SLA / KPI …
   العزل يمنع انتقال النقطة أو القوس إلى الطرف الخاطئ. */
bdi, .ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* الحقول التي يكتب فيها الزائر لاتينية: بريد وهاتف وأرقام */
input[type="email"],
input[type="tel"],
input[type="number"] {
  direction: ltr;
  text-align: right;
}

/* لا نقاط قائمة أصلية */
ul, ol { list-style: none; margin: 0; padding: 0; }

/* --------------------------------------------------------------------------
   5) الوصولية
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 50%;
  transform: translate(50%, -200%);
  z-index: 200;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translate(50%, 0); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   6) الحاوية والأقسام
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--white { background: var(--white); }
.section--navy  { background: var(--navy); }

/* هامش تمرير يعوّض الشريط الثابت */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.section_label {
  font-size: 15px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 12px;
}

.section_heading { font-size: 32px; line-height: 1.44; margin-bottom: 16px; }
.section_subtitle {
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  max-width: 68ch;
}

/* --------------------------------------------------------------------------
   7) الأزرار
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--teal); color: var(--white); }
.btn--primary:hover { background: var(--teal-dark); }

.btn--secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--secondary:hover { background: var(--navy); color: var(--white); }

/* --------------------------------------------------------------------------
   8) شريط التنقل
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ivory);
  padding-block: 16px;
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(23, 50, 77, .06);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.nav__logo { width: 72px; height: auto; }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav__link {
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  padding-block: 6px;
  position: relative;
  transition: color .2s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform .25s var(--ease);
}
.nav__link:hover, .nav__link[aria-current="true"] { color: var(--teal); }
.nav__link:hover::after,
.nav__link[aria-current="true"]::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.nav__cta {
  background: var(--teal);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: background-color .2s var(--ease);
}
.nav__cta:hover { background: var(--teal-dark); }

/* مبدّل اللغة */
.langswitch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}
.langswitch__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 1;
}
.langswitch__item[aria-current="true"] { background: var(--sand); }
.langswitch__item[aria-disabled="true"] {
  color: #9AA6B2;
  cursor: not-allowed;
}
.langswitch__flag { width: 18px; height: 13px; border-radius: 2px; display: block; }
.langswitch__item[aria-disabled="true"] .langswitch__flag { opacity: .55; }

/* تلميح "قريبًا" */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translateY(0); }

/* زر القائمة على الجوال */
.nav__toggle {
  display: none;
  width: 46px; height: 46px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav__toggle-bars { display: block; width: 20px; height: 14px; position: relative; }
.nav__toggle-bars span {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease), top .25s var(--ease);
}
.nav__toggle-bars span:nth-child(1) { top: 0; }
.nav__toggle-bars span:nth-child(2) { top: 6px; }
.nav__toggle-bars span:nth-child(3) { top: 12px; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.nav__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 50, 77, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
  z-index: 90;
}
body.menu-open .nav__backdrop { opacity: 1; pointer-events: auto; }
body.menu-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   9) الواجهة الرئيسية (Hero)
   -------------------------------------------------------------------------- */
.hero { padding-block: var(--section-y); }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 46px;
}
.hero__title {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.32;
  margin-bottom: 20px;
  max-width: 18ch;
  /* بلا margin تلقائي: الصندوق يلتصق ببداية السطر — يمين في العربية ويسار في
     الإنجليزية — فيتحاذى العنوان مع الفقرة أسفله تمامًا.
     كان `margin-inline-start: auto` يدفعه بعيدًا عن حرف البداية. */
  margin-inline-end: auto;
}
.hero__title span { display: block; }
.hero__text {
  font-size: 18px;
  line-height: 1.68;
  margin-bottom: 28px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__figure { margin: 0; }
.hero__img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   10) من نحن
   -------------------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.61fr 1fr;
  align-items: center;
  gap: 48px;
}
.about__text + .about__text { margin-top: 16px; }
.about__text { font-size: 17px; line-height: 1.72; }

.about__words {
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--teal);
}

.about__visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sand);
  aspect-ratio: 128 / 100;
  min-height: 320px;
}
.about__visual img { width: 100%; height: 100%; object-fit: cover; }

/* رؤيتنا / رسالتنا */
.vm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.vm__card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px 22px;
}
.section--white .vm__card { background: var(--ivory); }
.vm__title { font-size: 18px; margin-bottom: 8px; }
.vm__text { font-size: 15px; line-height: 1.7; }

/* شارة لونية صغيرة تُستخدم في كل البطاقات */
.accent {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--teal);
  vertical-align: middle;
}
.accent--copper { background: var(--copper); }
.accent--lg { width: 16px; height: 16px; }

/* العنوان الذي يحمل علامة: العلامة أولًا ثم النص على السطر نفسه.
   في العربية تظهر العلامة يمين النص، وفي الإنجليزية يساره. */
h3:has(> .accent),
h4:has(> .accent) {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* رقم الخطوة صار داخل العنوان أيضًا: على سطره وقبله */
h3:has(> .step__num) {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* التوجهات الوطنية */
.national {
  margin-top: 48px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
}
.section--white .national { background: var(--ivory); }
.national p { font-size: 15px; line-height: 1.73; }

/* --------------------------------------------------------------------------
   11) البطاقات — نمط موحّد
   -------------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(23,50,77,.07); }
.card--ivory { background: var(--ivory); }
.card__title { font-size: 18px; margin-bottom: 8px; }
.card__text { font-size: 15px; line-height: 1.68; }

.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* --------------------------------------------------------------------------
   12) كيف نخدمك؟
   -------------------------------------------------------------------------- */
.howserve { margin-top: 72px; }
.howserve__heading { font-size: 30px; line-height: 1.44; margin-bottom: 12px; }
.howserve__desc { font-size: 17px; line-height: 1.72; margin-bottom: 24px; max-width: 72ch; }

.howserve__card {
  background: var(--white);
  border: 2px solid var(--teal);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.howserve__card h3 { font-size: 18px; }
.howserve__card p { font-size: 15px; line-height: 1.68; }
.howserve__tagline { font-size: 15px; font-weight: 700; color: var(--teal); }
.howserve__btn {
  margin-top: auto;
  align-self: flex-start;
  background: var(--teal);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: background-color .2s var(--ease);
}
.howserve__btn:hover { background: var(--teal-dark); }

/* --------------------------------------------------------------------------
   13) الخدمات — منظومة الإدارة المتكاملة
   -------------------------------------------------------------------------- */
.services__list { margin-top: 24px; }
.service {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}
.service__num {
  flex: 0 0 72px;
  font-family: var(--font-body);
  font-size: 40px;
  font-weight: 700;
  color: var(--copper);
  line-height: 1.1;
}
.service__title { font-size: 20px; margin-bottom: 6px; }
.service__desc { font-size: 15px; line-height: 1.68; }

/* خدمات حسب الطلب */
.ondemand { margin-top: 72px; }
.ondemand__heading { font-size: 30px; line-height: 1.44; margin-bottom: 12px; }
.ondemand__desc { font-size: 17px; line-height: 1.72; margin-bottom: 24px; max-width: 72ch; }
.ondemand__card { padding: 24px 20px; }
.ondemand__card h3 { font-size: 16px; margin-bottom: 8px; }
.ondemand__card p { font-size: 14px; line-height: 1.72; }

/* --------------------------------------------------------------------------
   14) كيف نعمل
   -------------------------------------------------------------------------- */
.step__num {
  display: inline-block;
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  color: var(--copper);
  line-height: 1.1;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 15px; line-height: 1.68; }

/* --------------------------------------------------------------------------
   15) القطاعات
   -------------------------------------------------------------------------- */
.sector { padding: 24px 22px; }
.sector h3 { font-size: 17px; margin-bottom: 8px; }
.sector p { font-size: 14px; line-height: 1.72; }

/* --------------------------------------------------------------------------
   16) لماذا الجمعية
   -------------------------------------------------------------------------- */
.why__list { display: grid; gap: 12px; margin-top: 24px; }
.why__item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
}
.why__dot {
  flex: 0 0 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--copper);
}
.why__text { font-size: 16px; line-height: 1.62; }

/* --------------------------------------------------------------------------
   17) نموذج التواصل
   -------------------------------------------------------------------------- */
.cta { background: var(--navy); padding-block: var(--section-y); }
.cta__inner { max-width: 900px; margin-inline: auto; padding-inline: var(--gutter); }
.cta__heading { font-size: clamp(24px, 3vw, 32px); color: var(--white); margin-bottom: 12px; line-height: 1.44; }
.cta__subtitle { font-size: 17px; color: var(--sand); line-height: 1.72; }

.form {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 34px;
}
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }

.label {
  font-size: 15px;
  font-weight: 500;
  color: #F2ECE0;
  margin-bottom: 8px;
}
.label .req { color: var(--copper); margin-inline-start: 2px; }

.input, .select, .textarea {
  width: 100%;
  background: var(--white);
  color: var(--field-ink);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 46px;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(201,130,69,.28);
  outline: none;
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: #E2725B;
  box-shadow: 0 0 0 3px rgba(226,114,91,.25);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2317324D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: left 14px center;
  background-repeat: no-repeat;
  padding-inline-start: 14px;
  padding-inline-end: 38px;
}

/* خيارات الاختيار — العلامة قبل النص دائمًا */
.choices { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #F2ECE0;
  font-size: 15px;
  cursor: pointer;
  min-height: 32px;
}
.choice input {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin: 0;
  accent-color: var(--copper);
  cursor: pointer;
}

.form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.submit {
  background: var(--teal);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 32px;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .2s var(--ease), opacity .2s var(--ease);
}
.submit:hover { background: var(--teal-dark); }
.submit[disabled] { opacity: .6; cursor: progress; }

.form__note { font-size: 13px; color: var(--sand); }

.form__msg {
  grid-column: 1 / -1;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.7;
  display: none;
}
.form__msg.is-visible { display: block; }
.form__msg--ok  { background: rgba(20,125,120,.18); border: 1px solid var(--teal); color: #EAF6F5; }
.form__msg--err { background: rgba(226,114,91,.16); border: 1px solid #E2725B; color: #FBE9E5; }

/* المنطق الشرطي: قائمة الخدمات تظهر مع "خدمة محددة" فقط */
.is-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   18) التذييل
   -------------------------------------------------------------------------- */
.footer { background: var(--navy); color: var(--on-dark); padding-block: 72px 32px; }
.footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}
.footer__name { font-size: 20px; font-weight: 700; color: var(--white); }
.footer__tagline { font-size: 15px; color: var(--sand); margin-top: 6px; }
.footer__logo { width: 90px; height: auto; margin-top: 20px; }
.footer__menu { display: grid; gap: 10px; align-content: start; }
.footer__link { font-size: 15px; color: var(--white); transition: color .2s var(--ease); }
.footer__link:hover { color: var(--sand); }
.footer__contact { display: grid; gap: 10px; align-content: start; }
.footer__contact div, .footer__contact a { font-size: 15px; color: var(--sand); }
.footer__contact a:hover { color: var(--white); }
.footer__bar {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
}
.footer__copy { font-size: 13px; color: var(--sand); }

/* --------------------------------------------------------------------------
   19) الحركة — بسيطة ومحترمة لتفضيلات المستخدم
   -------------------------------------------------------------------------- */
/* المحتوى ظاهر افتراضيًا. الإخفاء المؤقت لا يُطبَّق إلا إذا كان
   JavaScript يعمل فعلًا (الكلاس js يُضاف في <head>) — فلا يختفي نص أبدًا
   إن تعطّل السكربت أو لم يعمل المراقب. */
.reveal { opacity: 1; transform: none; }

html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  will-change: opacity, transform;
}
html.js .reveal.is-in { opacity: 1; transform: none; }

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

/* --------------------------------------------------------------------------
   20) الاستجابة
   -------------------------------------------------------------------------- */

/* ≤ 1200 : تضييق الفجوات */
@media (max-width: 1200px) {
  :root { --section-y: 84px; }
  .hero__img { height: 400px; }
}

/* ≤ 1080 : شبكات أضيق */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1.35fr 1fr; gap: 32px; }
}

/* ≤ 900 : قائمة الجوال + عمود واحد للواجهة */
@media (max-width: 900px) {
  :root { --nav-h: 78px; }

  .nav__toggle { display: inline-flex; position: relative; z-index: 96; }
  .nav__brand  { position: relative; z-index: 96; }

  .nav__menu {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(320px, 86vw);
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 96px 24px 32px;
    box-shadow: -12px 0 40px rgba(23,50,77,.14);
    transform: translateX(105%);
    transition: transform .3s var(--ease), visibility 0s linear .3s;
    z-index: 95;
    overflow-y: auto;
    visibility: hidden;      /* لا تُركّز روابطها ولا تُوسّع الصفحة وهي مغلقة */
  }
  html[dir="rtl"] .nav__menu { transform: translateX(-105%); }
  body.menu-open .nav__menu {
    transform: translateX(0) !important;
    visibility: visible;
    transition: transform .3s var(--ease), visibility 0s;
  }

  .nav__menu .nav__link {
    font-size: 17px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .nav__menu .nav__link::after { display: none; }

  /* مبدّل اللغة ينتقل إلى داخل القائمة على الجوال */
  .nav__menu .langswitch {
    margin-top: 20px;
    align-self: flex-start;
  }
  .nav__menu .langswitch__item { padding: 10px 12px; font-size: 14px; }

  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__title { max-width: none; }
  .hero__img { height: 300px; }

  .about__grid { grid-template-columns: 1fr; gap: 28px; }
  .about__visual { min-height: 260px; aspect-ratio: 16 / 10; }

  .howserve, .ondemand { margin-top: 56px; }
}

/* ≤ 768 : عمود واحد لكل الشبكات */
@media (max-width: 768px) {
  :root { --section-y: 64px; --gutter: 24px; }

  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .vm { grid-template-columns: 1fr; }

  .section_heading,
  .howserve__heading,
  .ondemand__heading { font-size: 26px; }

  .form { grid-template-columns: 1fr; gap: 18px; }
  .cta__inner { padding-inline: var(--gutter); }

  .service { gap: 16px; padding-block: 22px; }
  .service__num { flex-basis: 54px; font-size: 32px; }

  .footer__grid { flex-direction: column; gap: 28px; }
}

/* ≤ 560 : جوال */
@media (max-width: 560px) {
  :root { --gutter: 20px; --section-y: 56px; }

  body { font-size: 16px; }
  .hero__text { font-size: 17px; }
  .about__text { font-size: 16px; }
  .section_subtitle, .howserve__desc, .ondemand__desc { font-size: 16px; }
  .hero__img { height: 240px; }
  .about__visual { min-height: 210px; }
  .card, .howserve__card { padding: 20px 18px; }
  .national { padding: 22px 18px; }
  .choices { gap: 10px 16px; }
}

/* ≤ 380 : أضيق الشاشات */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .section_heading, .howserve__heading, .ondemand__heading { font-size: 23px; }
  .nav__logo { width: 60px; }
  .nav__cta { padding: 10px 14px; font-size: 14px; }
  .langswitch__item { padding: 7px 8px; font-size: 12px; }
}

/* الطباعة */
@media print {
  .nav, .nav__backdrop, .cta, .footer__menu { display: none; }
  body { background: #fff; }
}
