/* ===========================================================================
   Site — الهيدر، الواجهة الرئيسية، الأقسام، الفوتر
   =========================================================================== */

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-4);
}
.brand {
  display: flex; align-items: center; gap: var(--sp-3);
  text-decoration: none; color: var(--c-ink-900); flex-shrink: 0;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-brand-500), var(--c-brand-700));
  color: #fff; box-shadow: var(--sh-sm);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: var(--fw-black); font-size: var(--fs-md); }
.brand-tag { font-size: var(--fs-xs); color: var(--text-muted); }

.nav-toggle {
  margin-inline-start: auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--r-md); cursor: pointer; color: var(--c-ink-700);
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav { margin-inline-start: auto; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: var(--sp-1);
}
.site-nav a {
  display: block; padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--c-ink-700); text-decoration: none;
  border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.site-nav a:hover { background: var(--c-brand-50); color: var(--c-brand-700); }
.site-nav a[aria-current="page"] { background: var(--c-brand-100); color: var(--c-brand-700); font-weight: var(--fw-bold); }

.header-cta { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

/* الجوال: قائمة منسدلة كاملة العرض */
@media (max-width: 1023px) {
  /* backdrop-filter على الهيدر ينشئ "كتلة احتواء" تحصر أي عنصر position:fixed
     بداخله، فكانت لوحة التنقل تُرسم خلف الهيدر ولا تُرى. تعطيله على الجوال
     يعيد للـ fixed سلوكه الطبيعي بالنسبة لنافذة العرض. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--header-bg, #fff); }

  /* لوحة تملأ الشاشة: لا تعتمد على ارتفاع الهيدر (الذي يتغيّر بوجود الشريط
     العلوي) ولا يحجبها شريط الجوال الثابت. */
  .site-nav {
    position: fixed; inset: 0;
    background: var(--surface);
    padding: calc(var(--header-h) + var(--sp-4)) var(--sp-5) var(--sp-8);
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease), visibility var(--dur-base);
    z-index: var(--z-modal);
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  /* زر الإغلاق يبقى فوق اللوحة */
  .nav-toggle { position: relative; z-index: calc(var(--z-modal) + 1); }

  /* قفل التمرير: نستخدم position:fixed على body بدل overflow:hidden
     لأن الأخير لا يمنع التمرير على iOS، فتبدو الصفحة "معلّقة". */
  body.nav-open { position: fixed; inset-inline: 0; width: 100%; overflow: hidden; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: var(--sp-1); }
  .site-nav a { padding: var(--sp-4); font-size: var(--fs-md); border-radius: var(--r-md); }
  .header-cta .btn span { display: none; }
  .header-cta .btn { padding-inline: var(--sp-4); }
}
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .site-nav { margin-inline-start: auto; }
  .header-cta { margin-inline-start: var(--sp-4); }
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: var(--sp-12) var(--sp-16);
  background:
    radial-gradient(circle at 88% 12%, var(--c-accent-100) 0%, transparent 42%),
    radial-gradient(circle at 6% 88%, var(--c-sky-100) 0%, transparent 46%),
    linear-gradient(170deg, var(--c-brand-50), var(--surface) 72%);
}
.hero-inner {
  display: grid; gap: var(--sp-10); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .hero { padding-block: var(--sp-20) var(--sp-24); }
  .hero-inner { grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-12); }
}
.hero h1 { margin-bottom: var(--sp-4); }
.hero-lead {
  font-size: var(--fs-md); color: var(--c-ink-700);
  max-width: 52ch; margin-bottom: var(--sp-8);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: var(--sp-8);
  margin-top: var(--sp-10); padding-top: var(--sp-8);
  border-top: 1px solid var(--c-brand-200);
}
.hero-stat b { display: block; font-size: var(--fs-xl); color: var(--c-brand-700); font-weight: var(--fw-black); }
.hero-stat span { font-size: var(--fs-sm); color: var(--text-muted); }

.hero-art { position: relative; }
.hero-art-frame {
  border-radius: var(--r-2xl); overflow: hidden;
  box-shadow: var(--sh-lg); aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--c-brand-100), var(--c-sky-100));
  display: grid; place-items: center;
}
.hero-art-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-art-frame .icon { width: 90px; height: 90px; color: var(--c-brand-300); }

/* بطاقة عائمة صغيرة فوق الصورة — تُخفى على الجوال لتفادي الزحام */
.hero-float {
  position: absolute; inset-block-end: -18px; inset-inline-start: -18px;
  background: var(--surface); border-radius: var(--r-lg);
  padding: var(--sp-4); box-shadow: var(--sh-lg);
  display: none; align-items: center; gap: var(--sp-3);
  border: 1px solid var(--border);
}
@media (min-width: 900px) { .hero-float { display: flex; } }
.hero-float .icon { color: var(--c-accent-600); }

/* أشكال زخرفية خفيفة — CSS خالص، لا صور، لا تكلفة تحميل */
.blob {
  position: absolute; border-radius: 50%; filter: blur(46px);
  opacity: 0.5; pointer-events: none;
}
.blob-1 { width: 300px; height: 300px; background: var(--c-accent-200); top: -110px; inset-inline-end: -90px; }
.blob-2 { width: 240px; height: 240px; background: var(--c-sky-200); bottom: -100px; inset-inline-start: -70px; }

/* --- Section shell ------------------------------------------------------- */
.section { padding-block: var(--sp-16); }
.section-sunken { background: var(--surface-sunken); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-8);
}
.section-head p { color: var(--text-muted); margin: var(--sp-1) 0 0; max-width: 56ch; }
.section-head h2 { margin: 0; }

.page-hero {
  padding-block: var(--sp-12);
  background: linear-gradient(170deg, var(--c-brand-50), var(--surface));
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { margin-bottom: var(--sp-2); }
.page-hero p { color: var(--c-ink-700); max-width: 60ch; margin: 0; }

/* --- Feature list -------------------------------------------------------- */
.feature {
  display: flex; gap: var(--sp-4); padding: var(--sp-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform var(--dur-base) var(--ease-out-soft), box-shadow var(--dur-base) var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.feature-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--c-brand-100); color: var(--c-brand-700);
}
.feature h3 { font-size: var(--fs-base); margin-bottom: var(--sp-1); }
.feature p { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; line-height: var(--lh-snug); }

/* --- Gallery strip ------------------------------------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .gallery-grid { grid-template-columns: repeat(6, 1fr); } }
.gallery-cell {
  aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden;
  background: var(--c-brand-50); display: grid; place-items: center;
  color: var(--c-brand-300);
}
.gallery-cell img { width: 100%; height: 100%; object-fit: cover;
                    transition: transform var(--dur-slow) var(--ease-out-soft); }
.gallery-cell:hover img { transform: scale(1.07); }

/* --- Article body (محتوى المحرر) ---------------------------------------- */
.prose { font-size: var(--fs-md); line-height: var(--lh-base); color: var(--c-ink-800, var(--c-ink-900)); }
.prose h2 { margin-top: var(--sp-10); }
.prose h3 { margin-top: var(--sp-8); }
.prose img { border-radius: var(--r-lg); margin-block: var(--sp-6); box-shadow: var(--sh-sm); }
.prose blockquote {
  margin: var(--sp-6) 0; padding: var(--sp-4) var(--sp-5);
  border-inline-start: 4px solid var(--c-brand-400);
  background: var(--c-brand-50); border-radius: var(--r-md);
  color: var(--c-ink-700);
}
.prose table { width: 100%; border-collapse: collapse; margin-block: var(--sp-6); font-size: var(--fs-sm); }
.prose th, .prose td { border: 1px solid var(--border); padding: var(--sp-3); text-align: start; }
.prose th { background: var(--surface-sunken); }

/* --- Contact ------------------------------------------------------------- */
.contact-item { display: flex; gap: var(--sp-4); align-items: flex-start; }
.contact-item .icon { color: var(--c-brand-600); margin-top: 3px; }
.contact-item b { display: block; font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-medium); }
.contact-item span, .contact-item a { font-size: var(--fs-base); color: var(--c-ink-900); }

.map-frame { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* --- WhatsApp FAB -------------------------------------------------------- */
.wa-fab {
  position: fixed; inset-block-end: var(--sp-6); inset-inline-end: var(--sp-6);
  width: 56px; height: 56px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: #25d366; color: #fff; box-shadow: var(--sh-lg);
  z-index: var(--z-header); text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out-soft);
}
.wa-fab:hover { transform: scale(1.08); color: #fff; }
.wa-fab .icon { width: 28px; height: 28px; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--c-brand-800); color: var(--c-brand-100);
  padding-block: var(--sp-12) var(--sp-6); margin-top: var(--sp-16);
}
.footer-grid { display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer h3 { color: #fff; font-size: var(--fs-base); margin-bottom: var(--sp-4); }
.site-footer p { color: var(--c-brand-200); font-size: var(--fs-sm); line-height: var(--lh-snug); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a { color: var(--c-brand-100); text-decoration: none; font-size: var(--fs-sm); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); color: #fff; }
.footer-bottom {
  margin-top: var(--sp-10); padding-top: var(--sp-5);
  border-top: 1px solid rgba(255,255,255,0.13);
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  justify-content: space-between; font-size: var(--fs-xs); color: var(--c-brand-200);
}

/* --- Auth screens -------------------------------------------------------- */
.auth-screen {
  min-height: 100dvh; display: grid; place-items: center;
  padding: var(--sp-5);
  background:
    radial-gradient(circle at 80% 15%, var(--c-accent-100) 0%, transparent 45%),
    radial-gradient(circle at 12% 85%, var(--c-sky-100) 0%, transparent 45%),
    var(--c-brand-50);
}
.auth-card {
  width: 100%; max-width: 430px;
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); padding: var(--sp-8);
}
.auth-card .brand-mark { width: 52px; height: 52px; margin-bottom: var(--sp-5); }
.auth-card .brand-mark .icon { width: 28px; height: 28px; }
.auth-card h1 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.auth-card > p { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-6); }
.auth-foot { margin-top: var(--sp-6); text-align: center; font-size: var(--fs-sm); }

/* --- Error pages --------------------------------------------------------- */
.error-screen { min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-8); text-align: center; }
.error-code {
  font-size: clamp(5rem, 20vw, 9rem); font-weight: var(--fw-black);
  line-height: 1; color: var(--c-brand-200); margin-bottom: var(--sp-2);
}
.error-screen h1 { margin-bottom: var(--sp-3); }
.error-screen p { color: var(--text-muted); max-width: 46ch; margin-inline: auto var(--sp-8); }

/* ===========================================================================
   الشعار
   =========================================================================== */
.brand-logo {
  width: var(--logo-w, 160px);
  height: var(--logo-h, 48px);
  max-height: calc(var(--header-h) - 16px);
}
@media (max-width: 767px) {
  .brand-logo { width: var(--logo-mw, 120px); height: auto; }
}

/* ===========================================================================
   شرائح الصفحة الرئيسية
   =========================================================================== */
.slider { position: relative; overflow: hidden; background: var(--c-brand-100); }
.slider-track { display: flex; transition: transform 520ms var(--ease-out-soft); }
@media (prefers-reduced-motion: reduce) { .slider-track { transition: none; } }

.slide {
  position: relative; flex: 0 0 100%;
  height: var(--slider-h, 420px);
  display: block; text-decoration: none; color: inherit;
}
.slide img { width: 100%; height: 100%; display: block; }

.slide-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, #1c1f1b, transparent 65%);
  pointer-events: none;
}
.slide-caption {
  position: absolute; inset-block-end: 0; inset-inline: 0;
  padding: var(--sp-8) var(--sp-6);
  color: #fff; max-width: 760px;
}
.slide-caption h2 { color: #fff; margin-bottom: var(--sp-2); font-size: var(--fs-xl); }
.slide-caption p { color: rgba(255,255,255,0.92); font-size: var(--fs-base); margin-bottom: var(--sp-4); }
@media (min-width: 768px) {
  .slide-caption { padding: var(--sp-10) var(--sp-12); }
  .slide-caption h2 { font-size: var(--fs-2xl); }
}

.slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: rgba(255,255,255,0.9); color: var(--c-ink-900);
  border: 0; cursor: pointer; box-shadow: var(--sh-sm);
  transition: background var(--dur-fast) var(--ease);
}
.slider-nav:hover { background: #fff; }
.slider-prev { inset-inline-start: var(--sp-4); }
.slider-next { inset-inline-end: var(--sp-4); }

.slider-dots {
  position: absolute; inset-block-end: var(--sp-4); inset-inline: 0;
  display: flex; justify-content: center; gap: var(--sp-2);
}
.slider-dots button {
  width: 10px; height: 10px; padding: 0; border-radius: var(--r-full);
  border: 0; cursor: pointer; background: rgba(255,255,255,0.55);
  transition: background var(--dur-fast) var(--ease), width var(--dur-fast) var(--ease);
}
.slider-dots button.is-active { background: #fff; width: 26px; }

/* ===========================================================================
   الخبر المميز
   =========================================================================== */
.spotlight {
  display: grid; gap: 0;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--sh-sm);
}
@media (min-width: 860px) { .spotlight { grid-template-columns: 1.1fr 1fr; } }

.spot-media { height: var(--spot-h, 320px); background: var(--c-brand-50); }
.spot-media img { width: 100%; height: 100%; display: block; }

.spot-body { padding: var(--sp-8); display: flex; flex-direction: column; justify-content: center; }
.spot-body h2 { margin-bottom: var(--sp-3); }
.spot-body p { color: var(--c-ink-700); margin-bottom: var(--sp-6); }
.spot-body .btn { align-self: flex-start; }

/* ===========================================================================
   شرائح الصفحة الرئيسية
   =========================================================================== */
.slider { position: relative; overflow: hidden; background: var(--c-brand-100); }
.slider-track { display: flex; transition: transform 520ms var(--ease-out-soft); }
@media (prefers-reduced-motion: reduce) { .slider-track { transition: none; } }

.slide {
  position: relative; flex: 0 0 100%;
  height: var(--slider-h, 420px);
  display: block; text-decoration: none; color: inherit;
}
.slide img { width: 100%; height: 100%; display: block; }

.slide-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, #1c1f1b, transparent 65%);
  pointer-events: none;
}
.slide-caption {
  position: absolute; inset-block-end: 0; inset-inline: 0;
  padding: var(--sp-8) var(--sp-6);
  color: #fff; max-width: 760px;
}
.slide-caption h2 { color: #fff; margin-bottom: var(--sp-2); font-size: var(--fs-xl); }
.slide-caption p { color: rgba(255,255,255,0.92); font-size: var(--fs-base); margin-bottom: var(--sp-4); }
@media (min-width: 768px) {
  .slide-caption { padding: var(--sp-10) var(--sp-12); }
  .slide-caption h2 { font-size: var(--fs-2xl); }
}

.slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: rgba(255,255,255,0.9); color: var(--c-ink-900);
  border: 0; cursor: pointer; box-shadow: var(--sh-sm);
  transition: background var(--dur-fast) var(--ease);
}
.slider-nav:hover { background: #fff; }
.slider-prev { inset-inline-start: var(--sp-4); }
.slider-next { inset-inline-end: var(--sp-4); }

.slider-dots {
  position: absolute; inset-block-end: var(--sp-4); inset-inline: 0;
  display: flex; justify-content: center; gap: var(--sp-2);
}
.slider-dots button {
  width: 10px; height: 10px; padding: 0; border-radius: var(--r-full);
  border: 0; cursor: pointer; background: rgba(255,255,255,0.55);
  transition: background var(--dur-fast) var(--ease), width var(--dur-fast) var(--ease);
}
.slider-dots button.is-active { background: #fff; width: 26px; }

/* ===========================================================================
   الخبر المميز
   =========================================================================== */
.spotlight {
  display: grid; gap: 0;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--sh-sm);
}
@media (min-width: 860px) { .spotlight { grid-template-columns: 1.1fr 1fr; } }

.spot-media { height: var(--spot-h, 320px); background: var(--c-brand-50); }
.spot-media img { width: 100%; height: 100%; display: block; }

.spot-body { padding: var(--sp-8); display: flex; flex-direction: column; justify-content: center; }
.spot-body h2 { margin-bottom: var(--sp-3); }
.spot-body p { color: var(--c-ink-700); margin-bottom: var(--sp-6); }
.spot-body .btn { align-self: flex-start; }

/* ===========================================================================
   القائمة الجانبية للموقع العام
   =========================================================================== */
.dt-avatar {
  width: 26px; height: 26px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--c-brand-600); color: #fff;
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
@media (max-width: 480px) { .dt-text { display: none; } .login-cta span { display: none; } }

/* ===========================================================================
   الشريط العلوي · أزرار الهيدر · شريط الجوال · البحث
   القيم تأتي من متغيرات يضبطها المدير من /admin/appearance
   =========================================================================== */

/* --- الشريط العلوي ------------------------------------------------------- */
.topbar {
  background: var(--topbar-bg, var(--c-accent-600));
  color: var(--topbar-text, #fff);
  font-size: var(--fs-sm);
}
.topbar-inner {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  min-height: 38px; padding-block: var(--sp-1);
}
.tb-item {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: inherit; text-decoration: none;
  font-size: 0.8125rem; line-height: 1.4;
  position: relative;
}
.tb-item + .tb-item::before {
  content: ''; position: absolute; inset-inline-start: calc(var(--sp-5) / -2);
  top: 15%; bottom: 15%; width: 1px; background: currentColor; opacity: 0.35;
}
.tb-item:hover { color: inherit; text-decoration: underline; }
.tb-item .icon { width: 15px; height: 15px; opacity: 0.9; }
.tb-html :is(a) { color: inherit; }

@media (max-width: 767px) {
  .topbar-inner { gap: var(--sp-1) var(--sp-4); justify-content: center; }
  .tb-item { font-size: 0.75rem; }
  .tb-item + .tb-item::before { display: none; }
}

/* --- الهيدر ------------------------------------------------------------- */
.site-header {
  background: color-mix(in srgb, var(--header-bg, #fff) 92%, transparent);
  color: var(--header-text, var(--c-ink-700));
}
.site-nav a { color: var(--header-text, var(--c-ink-700)); }

.header-cta { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

.hdr-icon {
  position: relative;
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1.5px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); color: var(--c-ink-700);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.hdr-icon:hover { border-color: var(--c-brand-400); background: var(--c-brand-50); color: var(--c-brand-700); }
.hdr-icon .icon { width: 18px; height: 18px; }
.hdr-icon-primary {
  background: var(--c-brand-600); border-color: var(--c-brand-600); color: #fff;
}
.hdr-icon-primary:hover { background: var(--c-brand-700); border-color: var(--c-brand-700); color: #fff; }

.hdr-badge {
  position: absolute; top: -4px; inset-inline-end: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--c-accent-600); color: #fff;
  font-size: 0.625rem; font-weight: var(--fw-bold); font-style: normal;
  border-radius: var(--r-full); border: 2px solid var(--surface);
}

.hdr-user {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 4px var(--sp-3) 4px 4px;
  border: 1.5px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); text-decoration: none; color: var(--c-ink-700);
  transition: border-color var(--dur-fast) var(--ease);
}
.hdr-user:hover { border-color: var(--c-brand-400); color: var(--c-brand-700); }
.hu-avatar {
  width: 30px; height: 30px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--c-brand-600); color: #fff;
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.hu-name { font-size: 0.8125rem; font-weight: var(--fw-bold); max-width: 120px;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .hu-name { display: none; } .hdr-user { padding: 4px; } }

.hdr-search {
  position: relative; display: flex; align-items: center;
}
.hdr-search .icon {
  position: absolute; inset-inline-start: var(--sp-3);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.hdr-search input {
  width: 190px; min-height: 40px;
  padding: 0 var(--sp-9) 0 var(--sp-3);
  padding-inline-start: var(--sp-9);
  font-family: var(--font-body); font-size: var(--fs-sm);
  border: 1.5px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); color: var(--text);
  transition: width var(--dur-base) var(--ease), border-color var(--dur-fast) var(--ease);
}
.hdr-search input:focus { outline: none; border-color: var(--c-brand-500); box-shadow: var(--sh-focus); width: 230px; }
@media (max-width: 1023px) { .hdr-search { display: none; } }

/* --- شريط الجوال الثابت -------------------------------------------------- */
.mobile-bar {
  position: fixed; inset-block-end: 0; inset-inline: 0;
  display: flex; z-index: var(--z-header);
  background: var(--mbar-bg, #fff);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(28, 31, 27, 0.07);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-bar a {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: var(--sp-2) 2px;
  color: var(--mbar-icon, var(--text-muted));
  text-decoration: none; font-size: 0.625rem; font-weight: var(--fw-medium);
  transition: color var(--dur-fast) var(--ease);
}
.mobile-bar a.is-active { color: var(--mbar-on, var(--c-brand-600)); }
.mobile-bar a.is-active .mb-icon::after {
  content: ''; position: absolute; inset-block-start: -6px; inset-inline: 30%;
  height: 3px; border-radius: 0 0 3px 3px; background: currentColor;
}
.mb-icon { position: relative; display: grid; place-items: center; }
.mb-icon .icon { width: 20px; height: 20px; }
.mb-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-badge {
  position: absolute; top: -5px; inset-inline-end: -8px;
  min-width: 15px; height: 15px; padding: 0 3px;
  display: grid; place-items: center;
  background: var(--c-accent-600); color: #fff;
  font-size: 0.5625rem; font-style: normal; font-weight: var(--fw-bold);
  border-radius: var(--r-full);
}
@media (min-width: 768px) { .mobile-bar { display: none; } }
/* مساحة أسفل الصفحة حتى لا يغطي الشريط آخر المحتوى */
@media (max-width: 767px) { body.has-mobile-bar { padding-bottom: 62px; } }

/* --- صفحة البحث --------------------------------------------------------- */
.search-page-form { position: relative; display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.search-page-form .icon {
  position: absolute; inset-inline-start: var(--sp-4); top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-page-form .input { padding-inline-start: var(--sp-10); }

.search-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.search-results a {
  display: flex; gap: var(--sp-4); align-items: flex-start;
  padding: var(--sp-4); text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.search-results a:hover { border-color: var(--c-brand-400); transform: translateY(-2px); color: inherit; }
.search-results img { width: 90px; height: 68px; object-fit: cover; border-radius: var(--r-md); flex-shrink: 0; }
.search-results h3 { font-size: var(--fs-base); margin: var(--sp-2) 0 var(--sp-1); }
.search-results p { font-size: var(--fs-sm); color: var(--text-muted); margin: 0 0 var(--sp-1); }
.search-results small { font-size: var(--fs-xs); color: var(--text-muted); }

/* --- الفوتر يتبع لون المظهر --------------------------------------------- */
.site-footer { background: var(--footer-bg, var(--c-brand-800)); }

/* مقياس الخط العام */
html { font-size: calc(100% * var(--theme-scale, 1)); }

/* --- تأكيد إرسال نموذج التواصل ------------------------------------------- */
.contact-success {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  background: var(--c-success-bg, #e8f5e9);
  border: 1.5px solid var(--c-success-bd, #a5d6a7);
  border-radius: var(--r-xl);
}
.cs-icon {
  display: grid; place-items: center;
  width: 64px; height: 64px; margin: 0 auto var(--sp-4);
  border-radius: var(--r-full);
  background: var(--c-brand-600); color: #fff;
}
.cs-icon .icon { width: 30px; height: 30px; }
.contact-success h2 { margin: 0 0 var(--sp-2); }
.contact-success p { color: var(--c-ink-700); margin-bottom: var(--sp-5); }
