/* =====================================================================
   الرابية الخضراء — نظام التصميم (Neo-Classic Modern / RTL)
   ===================================================================== */

:root {
  /* ألوان الهوية */
  --navy-900: #061622;
  --navy-800: #0A2131;
  --navy-700: #0E2B3D;
  --navy-600: #15394f;
  --navy-500: #1E4B65;
  --green-600: #2F8B41;
  --green-500: #3FA14E;
  --green-400: #57B968;
  --green-100: #E7F4EA;
  --brass-500: #C2A36B;
  --brass-200: #EADFC7;
  --ivory: #F8F7F3;
  --sand: #EFEDE6;
  --ink: #16212B;
  --muted: #6B7A87;

  --radius: 14px;
  --shadow-soft: 0 1px 2px rgba(10, 33, 49, .04), 0 12px 32px -12px rgba(10, 33, 49, .18);
  --shadow-lift: 0 2px 4px rgba(10, 33, 49, .06), 0 26px 50px -20px rgba(10, 33, 49, .28);
  --header-h: 88px;
}

/* ---------- أساسيات ---------- */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; overflow-x: hidden; }

body {
  font-family: 'Tajawal', system-ui, 'Segoe UI', sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: 'El Messiri', 'Tajawal', serif;
  line-height: 1.45;
  letter-spacing: 0;
}

.font-latin { font-family: 'Cormorant Garamond', 'El Messiri', serif; }
.num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

::selection { background: var(--green-500); color: #fff; }

/* شريط التمرير */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--sand); }
::-webkit-scrollbar-thumb { background: #c3ccd3; border-radius: 99px; border: 2px solid var(--sand); }
::-webkit-scrollbar-thumb:hover { background: var(--green-500); }

/* ---------- الحاوية ---------- */
.container-x { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 1024px) { .container-x { padding-inline: 32px; } }

/* ---------- عناصر كلاسيكية ---------- */

/* عنوان القسم بزخرفة رفيعة */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: var(--green-600); text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 34px; height: 1px; background: var(--brass-500);
}
.eyebrow.centered::after {
  content: ""; width: 34px; height: 1px; background: var(--brass-500);
}

.section-title {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  color: var(--navy-700);
}
.section-title .accent { color: var(--green-500); }

/* فاصل زخرفي */
.rule-ornate {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0;
}
.rule-ornate::before, .rule-ornate::after {
  content: ""; height: 1px; width: 64px;
  background: linear-gradient(to left, transparent, var(--brass-500));
}
.rule-ornate::after { background: linear-gradient(to right, transparent, var(--brass-500)); }
.rule-ornate i {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--green-500); display: block;
}

/* إطار مزدوج نيو-كلاسيك */
.frame-double {
  position: relative;
  border: 1px solid rgba(14, 43, 61, .12);
  border-radius: var(--radius);
}
.frame-double::after {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid rgba(194, 163, 107, .35);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
}

/* البطاقات */
.card {
  background: #fff;
  border: 1px solid rgba(14, 43, 61, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s, border-color .45s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: rgba(63,161,78,.35); }

/* زخرفة زاوية مائلة مستوحاة من الهوية */
.corner-slash { position: relative; overflow: hidden; }
.corner-slash::before {
  content: ""; position: absolute; top: -40px; left: -40px;
  width: 110px; height: 110px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--green-500), transparent 70%);
  opacity: .16; pointer-events: none;
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: 10px; font-weight: 700; font-size: 15px;
  transition: all .3s ease; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--green-500); color: #fff; box-shadow: 0 10px 24px -12px rgba(63,161,78,.9); }
.btn-primary:hover { background: var(--green-600); transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(63,161,78,1); }

.btn-navy { background: var(--navy-700); color: #fff; }
.btn-navy:hover { background: var(--navy-800); transform: translateY(-2px); }

.btn-outline { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-outline:hover { background: #fff; color: var(--navy-700); border-color: #fff; }

.btn-ghost { border-color: rgba(14,43,61,.18); color: var(--navy-700); background: #fff; }
.btn-ghost:hover { border-color: var(--green-500); color: var(--green-600); }

.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 16px 34px; font-size: 16px; }

/* ---------- الرأس ---------- */
.topbar { background: var(--navy-800); color: #cfdae2; font-size: 13.5px; }
.topbar a:hover { color: #fff; }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(14,43,61,.08);
  transition: box-shadow .3s, background .3s;
}
.site-header.is-stuck { box-shadow: 0 10px 30px -18px rgba(10,33,49,.5); }

.nav-link {
  position: relative; padding: 10px 2px; font-weight: 600; font-size: 15.5px;
  color: var(--navy-700); transition: color .25s;
}
.nav-link::after {
  content: ""; position: absolute; bottom: 2px; right: 50%; transform: translateX(50%);
  width: 0; height: 2px; background: var(--green-500); transition: width .3s ease;
}
.nav-link:hover { color: var(--green-600); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--green-600); }

/* قائمة الجوال */
.mobile-menu {
  position: fixed; inset: 0 0 0 auto; width: min(86vw, 360px); z-index: 90;
  background: #fff; transform: translateX(100%); transition: transform .4s cubic-bezier(.2,.8,.2,1);
  box-shadow: -20px 0 60px -30px rgba(0,0,0,.6); overflow-y: auto;
}
/* في RTL زر القائمة على اليسار، فتنزلق اللوحة من اليسار */
html[dir="rtl"] .mobile-menu { inset: 0 auto 0 0; transform: translateX(-100%); box-shadow: 20px 0 60px -30px rgba(0,0,0,.6); }
.mobile-menu.open { transform: translateX(0); }
.menu-backdrop {
  position: fixed; inset: 0; background: rgba(6,22,34,.55); z-index: 85;
  opacity: 0; visibility: hidden; transition: .35s; backdrop-filter: blur(2px);
}
.menu-backdrop.open { opacity: 1; visibility: visible; }

/* ---------- الواجهة الرئيسية (Hero) ---------- */
.hero {
  position: relative; min-height: clamp(520px, 78vh, 760px);
  background: var(--navy-800); color: #fff; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .28; transform: scale(1.06);
  animation: heroZoom 18s ease-in-out infinite alternate;
}
@keyframes heroZoom { to { transform: scale(1); } }

.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1000px 520px at 85% 20%, rgba(63,161,78,.22), transparent 60%),
    linear-gradient(to left, rgba(6,22,34,.94) 12%, rgba(6,22,34,.72) 55%, rgba(6,22,34,.55));
}
.hero > .container-x { position: relative; z-index: 2; }

/* أشرطة مائلة من الهوية */
.hero-slashes { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5; }
.hero-slashes span {
  position: absolute; width: 180%; height: 16px; background: rgba(63,161,78,.22);
  transform: rotate(-16deg);
}
.hero-slashes span:nth-child(1) { top: 12%; right: -40%; }
.hero-slashes span:nth-child(2) { top: 20%; right: -40%; height: 6px; background: rgba(255,255,255,.1); }
.hero-slashes span:nth-child(3) { bottom: 14%; right: -40%; height: 10px; background: rgba(63,161,78,.14); }

.hero-slide { display: none; }
.hero-slide.active { display: block; animation: fadeUp .9s ease both; }

.hero-dots { display: flex; gap: 10px; }
.hero-dots button {
  width: 34px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.28); transition: .35s;
}
.hero-dots button.active { background: var(--green-500); width: 52px; }

/* ---------- ترويسة الصفحات الداخلية ---------- */
.page-head {
  position: relative; background: var(--navy-800); color: #fff;
  padding: clamp(60px, 9vw, 104px) 0 clamp(48px, 7vw, 76px); overflow: hidden;
}
.page-head::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M0 60 60 0M-15 45 45-15M15 75 75 15' stroke='%23ffffff' stroke-opacity='.05' stroke-width='10' fill='none'/%3E%3C/svg%3E");
}
.page-head::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(760px 320px at 80% 0%, rgba(63,161,78,.3), transparent 62%);
}
.page-head > * { position: relative; z-index: 2; }

.breadcrumb { font-size: 14px; color: rgba(255,255,255,.72); }
.breadcrumb a:hover { color: var(--green-400); }
.breadcrumb span.sep { margin-inline: 8px; opacity: .5; }

/* ---------- أقسام ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: linear-gradient(180deg, #fff, var(--sand)); }
.section-navy { background: var(--navy-800); color: #fff; }

/* شبكة إحصاءات */
.stat-card { text-align: center; padding: 26px 16px; }
.stat-num {
  font-family: 'Cormorant Garamond', serif; font-weight: 700;
  font-size: clamp(38px, 5vw, 56px); line-height: 1; color: var(--green-400);
}

/* ---------- صور ---------- */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-contain { width: 100%; height: 100%; object-fit: contain; display: block; }
.ratio-4-3 { aspect-ratio: 4/3; }
.ratio-16-9 { aspect-ratio: 16/9; }
.ratio-1-1 { aspect-ratio: 1/1; }

.zoom-wrap { overflow: hidden; }
.zoom-wrap img { transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.card:hover .zoom-wrap img, .zoom-wrap:hover img { transform: scale(1.07); }

/* ---------- الوسوم / الشارات ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
}
.badge-green { background: var(--green-100); color: var(--green-600); }
.badge-navy { background: rgba(14,43,61,.08); color: var(--navy-700); }
.badge-brass { background: rgba(194,163,107,.16); color: #8a6d2f; }

/* ---------- المقالات (محتوى منسّق) ---------- */
.prose-ar { font-size: 17.5px; line-height: 2.1; color: #2b3a46; }
.prose-ar > * + * { margin-top: 1.15em; }
.prose-ar h2 {
  font-size: 25px; color: var(--navy-700); margin-top: 1.9em; padding-inline-start: 14px;
  border-inline-start: 4px solid var(--green-500);
}
.prose-ar h3 { font-size: 21px; color: var(--navy-700); margin-top: 1.6em; }
.prose-ar p { text-align: justify; }
.prose-ar a { color: var(--green-600); text-decoration: underline; text-underline-offset: 4px; }
.prose-ar ul, .prose-ar ol { padding-inline-start: 24px; }
.prose-ar ul { list-style: none; }
.prose-ar ul > li { position: relative; padding-inline-start: 22px; margin-bottom: 8px; }
.prose-ar ul > li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 14px;
  width: 7px; height: 7px; background: var(--green-500); transform: rotate(45deg);
}
.prose-ar ol { list-style: arabic-indic; }
.prose-ar ol > li { margin-bottom: 8px; }
.prose-ar img { border-radius: var(--radius); margin-block: 1.6em; width: 100%; }
.prose-ar blockquote {
  border-inline-start: 3px solid var(--brass-500);
  background: rgba(194,163,107,.08);
  padding: 18px 22px; border-radius: 10px; font-size: 18px; color: var(--navy-700);
}
.prose-ar table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose-ar th, .prose-ar td { border: 1px solid rgba(14,43,61,.12); padding: 10px 14px; text-align: start; }
.prose-ar th { background: var(--sand); font-weight: 700; color: var(--navy-700); }

/* ---------- النماذج ---------- */
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--navy-700); margin-bottom: 7px; }
.field-label .req { color: #dc2626; }

.field {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1px solid rgba(14,43,61,.16); background: #fff;
  font-family: inherit; font-size: 15px; color: var(--ink);
  transition: border-color .25s, box-shadow .25s;
}
.field:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(63,161,78,.12);
}
.field::placeholder { color: #9aa7b2; }
textarea.field { min-height: 140px; resize: vertical; line-height: 1.9; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7A87' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 16px center; padding-left: 40px; }

.field-error { border-color: #dc2626 !important; }
.error-text { color: #dc2626; font-size: 13px; margin-top: 5px; display: block; }

/* ---------- الأكورديون ---------- */
.acc-item { border-bottom: 1px solid rgba(14,43,61,.1); }
.acc-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; text-align: start; font-weight: 700; font-size: 17px; color: var(--navy-700);
  transition: color .25s;
}
.acc-btn:hover { color: var(--green-600); }
.acc-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: var(--green-100); color: var(--green-600); display: grid; place-items: center; transition: transform .35s, background .25s; }
.acc-item.open .acc-icon { transform: rotate(45deg); background: var(--green-500); color: #fff; }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .45s cubic-bezier(.2,.8,.2,1); }
.acc-body-inner { padding-bottom: 20px; color: var(--muted); line-height: 2; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--navy-900); color: #b9c6d0; }
.site-footer a { transition: color .25s; }
.site-footer a:hover { color: var(--green-400); }
.footer-title {
  font-family: 'El Messiri', serif; font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 20px; position: relative; padding-bottom: 12px;
}
.footer-title::after {
  content: ""; position: absolute; bottom: 0; inset-inline-start: 0;
  width: 42px; height: 2px; background: var(--green-500);
}

/* ---------- حركات الظهور ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }
.reveal[data-delay="5"] { transition-delay: .5s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- شريط الماركات المتحرك ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(to left, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(to left, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---------- أزرار عائمة ---------- */
.fab {
  position: fixed; inset-inline-end: 22px; z-index: 70;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; box-shadow: var(--shadow-lift);
  transition: transform .3s, opacity .3s, visibility .3s;
}
.fab-wa { bottom: 22px; background: #25D366; color: #fff; }
.fab-top { bottom: 84px; background: var(--navy-700); color: #fff; opacity: 0; visibility: hidden; }
.fab-top.show { opacity: 1; visibility: visible; }
.fab:hover { transform: translateY(-4px) scale(1.06); }

/* ---------- تحميل الصور ---------- */
img { max-width: 100%; }
.skeleton { background: linear-gradient(90deg, #eef1f3 25%, #e3e8ec 50%, #eef1f3 75%); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- الطباعة ---------- */
@media print {
  .site-header, .site-footer, .fab, .no-print { display: none !important; }
  body { background: #fff; }
}
