/* ============================================================
   الأكاديمية الحزبية لحزب الإصلاح — Main Styles
   الأساسيات + الطباعة + التخطيط + الأقسام + المرافق (Utilities)
   ملاحظة: نستخدم الخصائص المنطقية (margin-inline, inset-inline...)
   لتعمل تلقائيًا في الاتجاهين RTL/LTR.
   ============================================================ */

/* ---------- إعادة الضبط الأساسية ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-200);
  line-height: var(--lh-body);
  color: var(--text);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t-base), color var(--t-base);
  overflow-x: hidden;
}

/* ---------- الطباعة ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--text-strong);
  line-height: var(--lh-tight);
  font-weight: 700;
  margin: 0 0 var(--sp-3);
}
h1 { font-size: var(--fs-700); }
h2 { font-size: var(--fs-600); }
h3 { font-size: var(--fs-500); }
h4 { font-size: var(--fs-400); }

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--brand-primary-700); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 var(--sp-4); padding-inline-start: 1.25rem; }

hr { border: 0; border-top: 1px solid var(--border-color); margin: var(--sp-6) 0; }

::selection { background: var(--brand-primary-300); color: #fff; }

/* ---------- إتاحة الوصول ---------- */
:focus-visible {
  outline: 3px solid var(--brand-primary-300);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 2000;
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; color: #fff; }

.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;
}

/* ---------- الحاوية والأقسام ---------- */
.container { max-width: var(--container-max); }

.section { padding-block: var(--section-y); }
.section--surface { background: var(--bg-surface); }
.section--tight { padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem); }

.section-head {
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: var(--sp-7);
  text-align: center;
}
.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-100);
  letter-spacing: 0.02em;
  color: var(--color-primary);
  background: var(--brand-primary-100);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--sp-3);
}
.section-head p { color: var(--text-muted); font-size: var(--fs-300); margin-bottom: 0; }
.section-head--start { text-align: start; margin-inline: 0; }

/* ---------- مرافق لونية ونصية ---------- */
.text-brand { color: var(--color-primary) !important; }
.text-gold { color: var(--brand-gold) !important; }
.text-muted-2 { color: var(--text-muted) !important; }
.bg-brand { background: var(--color-primary) !important; color: #fff; }
.bg-soft { background: var(--bg-surface) !important; }
.fw-600 { font-weight: 600 !important; }
.min-w-0 { min-width: 0 !important; }
.fw-800 { font-weight: 800 !important; }
.text-strong { color: var(--text-strong) !important; }
.lead-2 { font-size: var(--fs-300); color: var(--text-muted); }

/* شارة "محتوى تجريبي" */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-50);
  font-weight: 700;
  color: var(--brand-gold);
  background: rgba(201, 162, 39, 0.12);
  border: 1px dashed var(--brand-gold);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
}

/* فاصل زخرفي بهوية السنبلة */
.divider-leaf {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; color: var(--brand-gold); margin: var(--sp-5) 0;
}
.divider-leaf::before, .divider-leaf::after {
  content: ""; height: 1px; width: 60px;
  background: linear-gradient(to var(--_dir, left), transparent, var(--brand-gold));
}

/* ---------- خلفيات الهوية ---------- */
.bg-pattern {
  position: relative;
  background-color: var(--bg-surface);
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 22px 22px;
}
.bg-gradient-brand {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-700) 55%, var(--brand-accent) 130%);
  color: #fff;
}
.bg-gradient-brand h1, .bg-gradient-brand h2, .bg-gradient-brand h3 { color: #fff; }

/* ---------- الهيرو ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 2.5rem + 6vw, 7rem);
  overflow: hidden;
  isolation: isolate;
}
.hero__title {
  font-size: var(--fs-800);
  font-weight: 800;
  margin-bottom: var(--sp-4);
}
.hero__lead {
  font-size: var(--fs-300);
  max-width: 60ch;
  margin-bottom: var(--sp-5);
  opacity: 0.95;
}
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.35;
  z-index: -1;
}

/* ---------- الهيرو: الصورة المؤطّرة + بطاقات زجاجية عائمة ---------- */
.hero-visual { position: relative; max-width: 440px; margin-inline: auto; }
.hero-visual__frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-lg);
  border: 5px solid rgba(255, 255, 255, 0.14);
}
.hero-visual__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-visual__frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(20, 63, 24, 0.42));
}
.hero-visual__blob {
  position: absolute; inset-block-start: -12%; inset-inline-end: -12%;
  width: 62%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle at 50% 50%, var(--brand-gold), transparent 68%);
  opacity: 0.55; filter: blur(26px);
}
.hero-chip {
  position: absolute; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; border-radius: var(--radius-lg); color: #fff;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: var(--shadow-md);
  animation: heroChipIn 0.7s ease both;
}
.hero-chip__ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.22); color: #fff;
}
.hero-chip__txt { line-height: 1.15; }
.hero-chip__txt b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; }
.hero-chip__txt small { font-size: 0.72rem; opacity: 0.92; }
.hero-chip--tl { inset-block-start: 9%; inset-inline-start: -9%; animation-delay: 0.35s; }
.hero-chip--br { inset-block-end: 9%; inset-inline-end: -9%; max-width: 62%; animation-delay: 0.55s; }
@keyframes heroChipIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; } }
@media (max-width: 575.98px) {
  .hero-chip--tl { inset-inline-start: -4%; }
  .hero-chip--br { inset-inline-end: -4%; }
  .hero-chip__txt small { font-size: 0.66rem; }
}

/* ---------- الهيرو: سلايدر بعرض كامل (Carousel) ---------- */
.hero-carousel { position: relative; overflow: hidden; }
.hero-slide {
  position: relative;
  /* يملأ كامل ارتفاع الشاشة أسفل الهيدر الثابت (بحدٍّ أدنى للشاشات القصيرة) */
  min-height: max(520px, calc(100vh - var(--header-h)));
  background-size: cover; background-position: center;
  display: flex; align-items: center;
}
@supports (height: 100svh) {
  .hero-slide { min-height: max(520px, calc(100svh - var(--header-h))); }
}
.hero-slide::before {   /* تعتيم متدرّج يُغمِّق جهة النص (inline-end) */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to right, rgba(10, 30, 13, 0.30) 0%, rgba(11, 32, 14, 0.72) 58%, rgba(11, 32, 14, 0.9) 100%);
}
html[dir="ltr"] .hero-slide::before {
  background: linear-gradient(to left, rgba(10, 30, 13, 0.30) 0%, rgba(11, 32, 14, 0.72) 58%, rgba(11, 32, 14, 0.9) 100%);
}
.hero-slide .container { position: relative; z-index: 1; }
.hero-slide__content { max-width: 640px; color: #fff; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: var(--sp-4);
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: var(--fs-100);
  padding: 0.4rem 0.95rem; border-radius: var(--radius-pill);
}
.hero-slide__title { color: #fff; font-size: var(--fs-800); font-weight: 800; line-height: 1.15; margin-bottom: var(--sp-4); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.28); }
.hero-slide__lead { font-size: var(--fs-300); max-width: 56ch; margin-bottom: var(--sp-5); color: rgba(255, 255, 255, 0.92); }
.hero-slide__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
@keyframes heroContentIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; } }
.carousel-item.active .hero-slide__content { animation: heroContentIn 0.75s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* أزرار التنقّل الدائرية */
.hero-carousel .carousel-control-prev, .hero-carousel .carousel-control-next { width: 72px; opacity: 1; z-index: 3; }
.hero-carousel .carousel-control-prev-icon, .hero-carousel .carousel-control-next-icon {
  width: 50px; height: 50px; border-radius: 50%; background-size: 42% 42%;
  background-color: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color var(--t-fast), transform var(--t-fast);
}
.hero-carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.hero-carousel .carousel-control-next:hover .carousel-control-next-icon { background-color: var(--brand-gold); transform: scale(1.06); }

/* نقاط التنقّل */
.hero-carousel .carousel-indicators { margin-bottom: 1.4rem; z-index: 3; }
.hero-carousel .carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.55); opacity: 1; transition: width var(--t-base), background var(--t-base); }
.hero-carousel .carousel-indicators .active { background: var(--brand-gold); width: 28px; border-radius: 6px; }

@media (max-width: 575.98px) {
  .hero-carousel .carousel-control-prev, .hero-carousel .carousel-control-next { display: none; }
}

/* شارة الصفحة الداخلية (Page banner) */
.page-banner {
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  position: relative;
}
.page-banner .breadcrumb { margin: 0; }
.page-banner .breadcrumb, .page-banner .breadcrumb a { color: rgba(255,255,255,0.85); }
.page-banner .breadcrumb-item.active { color: #fff; }
.page-banner .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.6); }

/* ---------- شبكة الإحصاءات ---------- */
.stat {
  text-align: center;
  padding: var(--sp-5);
}
.stat__num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1;
  color: var(--color-primary);
  display: block;
}
.stat__label { color: var(--text-muted); font-size: var(--fs-100); margin-top: var(--sp-2); }

/* على الأقسام المتدرّجة الداكنة: أرقام/تسميات/أيقونات المؤشرات فاتحة لتُقرأ بوضوح */
.bg-gradient-brand .stat__num { color: #fff; }
.bg-gradient-brand .stat__label { color: rgba(255, 255, 255, 0.85); }
.bg-gradient-brand .stat .text-brand { color: var(--brand-gold) !important; }

/* ---------- الفوتر ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding-top: var(--sp-8);
}
.site-footer h5 { color: #fff; font-size: var(--fs-300); margin-bottom: var(--sp-4); }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.site-footer .footer-links { list-style: none; padding: 0; margin: 0; }
.site-footer .footer-links li { margin-bottom: var(--sp-2); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: var(--sp-7);
  padding-block: var(--sp-4);
  font-size: var(--fs-100);
}
.footer-brand__logo { width: 64px; height: 60px; object-fit: contain; background:#fff; border-radius: 14px; padding:4px 6px; }

/* ---------- الظهور التدريجي البديل (بدون AOS) ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--t-slow), transform var(--t-slow); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- زر العودة للأعلى ---------- */
.to-top {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline-end: 1.25rem;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--color-primary);
  color: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all var(--t-base);
  z-index: 1000;
  cursor: pointer;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------- حالات فارغة / هيكل تحميل ---------- */
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--text-muted); }
.empty-state i { font-size: 3rem; color: var(--border-color); margin-bottom: var(--sp-3); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface) 37%, var(--bg-surface-2) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
