/* ==========================================================================
   شمس — hero.css
   بانر الشرائح (Hero Slider) + الحركات
   يُحمَّل في الصفحة الرئيسية فقط.
   ========================================================================== */

.hero-slider {
  --hs-dur: 7000ms; /* مدة العرض التلقائي — يضبطها JS أيضًا */
  position: relative;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
  min-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      110% 78% at 78% 6%,
      color-mix(in srgb, var(--navy-500) 68%, transparent),
      transparent 58%
    ),
    linear-gradient(195deg, var(--navy-700) 0%, var(--navy-900) 58%, var(--navy-950) 100%);
  z-index: -3;
}

/* --------------------------------------------------------------------------
   1. الشرائح
   -------------------------------------------------------------------------- */
.hs-viewport {
  position: relative;
  flex: 1;
  display: grid;
}

/* الشريحة تملأ كامل ارتفاع المنطقة حتى تغطّيها اللوحة الفنية بالكامل */
.hs-slide {
  grid-area: 1 / 1;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  padding-block: clamp(4rem, 2.5rem + 7vw, 7.5rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.85s var(--ease), visibility 0.85s var(--ease);
}

.hs-slide > .wrap {
  width: 100%;
}

.hs-slide.is-active {
  opacity: 1;
  visibility: visible;
}

/* اللوحة البصرية */
.hs-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.hs-art svg {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  transform: scale(1.09);
  transform-origin: 50% 70%;
  transition: transform 1.1s var(--ease);
}

/* كن بيرنز — زحف بطيء أثناء عرض الشريحة */
.hs-slide.is-active .hs-art svg {
  animation: hsKenBurns var(--hs-dur) linear forwards;
}

@keyframes hsKenBurns {
  from {
    transform: scale(1.09) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.005) translate3d(0, -1.1%, 0);
  }
}

/* انسياب الموج — دورة الموجة 400 وحدة */
.hs-waves {
  animation: hsDrift 26s linear infinite;
}

@keyframes hsDrift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-400px);
  }
}

/* نبض هالة الشمس */
.hs-glow {
  animation: hsPulse 7.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes hsPulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.09);
  }
}

/* الدوائر تتنفّس */
.hs-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: hsBreathe 12s ease-in-out infinite;
}

.hs-ring:nth-of-type(2) {
  animation-delay: -3s;
}
.hs-ring:nth-of-type(3) {
  animation-delay: -6s;
}

@keyframes hsBreathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.035);
    opacity: 0.55;
  }
}

/* خطوط الشعار ترتسم عند دخول الشريحة */
.hs-rule {
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
}

.hs-slide.is-active .hs-rule {
  animation: hsDraw 1.1s var(--ease-out) forwards;
}

.hs-slide.is-active .hs-rule:nth-of-type(2) {
  animation-delay: 0.12s;
}
.hs-slide.is-active .hs-rule:nth-of-type(3) {
  animation-delay: 0.24s;
}

@keyframes hsDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* --------------------------------------------------------------------------
   2. محتوى الشريحة — دخول متدرّج
   -------------------------------------------------------------------------- */
.hs-content {
  position: relative;
  max-width: 64ch;
}

/* العناصر تدخل من جهة البداية (اليمين في RTL) مع ارتفاع خفيف */
.hs-anim {
  opacity: 0;
  transform: translate(38px, 10px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.hs-slide.is-active .hs-anim {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 105ms + 160ms);
}

.hs-kicker {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.42rem 1rem;
  border: 1px solid color-mix(in srgb, var(--white) 22%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--white) 7%, transparent);
  font-size: var(--fs-xs);
  color: color-mix(in srgb, var(--white) 82%, transparent);
  margin-bottom: 1.6rem;
  backdrop-filter: blur(6px);
}

.hs-kicker strong {
  color: var(--lime-300);
  font-family: var(--font-display);
  font-weight: 600;
}

.hs-title {
  font-size: var(--fs-display);
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  max-width: 19ch;
}

.hs-title .accent {
  color: var(--lime-300);
}

.hs-lead {
  font-size: var(--fs-lead);
  line-height: 1.9;
  color: color-mix(in srgb, var(--white) 76%, var(--navy-300));
  max-width: 54ch;
  margin: 0;
}

.hs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.1rem;
}

/* --------------------------------------------------------------------------
   3. أدوات التحكّم
   -------------------------------------------------------------------------- */
.hs-ui {
  position: relative;
  z-index: 3;
  border-top: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
  background: color-mix(in srgb, var(--navy-950) 46%, transparent);
  backdrop-filter: blur(10px);
}

.hs-ui-inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 0.4rem + 1.2vw, 1.75rem);
  padding-block: 0.9rem;
}

/* أزرار السابق/التالي */
.hs-arrow {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--white) 26%, transparent);
  background: transparent;
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.26s var(--ease), border-color 0.26s var(--ease),
    color 0.26s var(--ease), transform 0.2s var(--ease-out);
}

.hs-arrow svg {
  width: 16px;
  height: 16px;
}

.hs-arrow:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy-900);
}

.hs-arrow:active {
  transform: scale(0.94);
}

/* المؤشّرات مع شريط التقدّم */
.hs-dots {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 0.2rem + 0.9vw, 1rem);
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.hs-dots li {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.hs-dot {
  width: 100%;
  background: none;
  border: 0;
  padding: 0.7rem 0;
  cursor: pointer;
  text-align: start;
  color: color-mix(in srgb, var(--white) 52%, transparent);
  font-family: var(--font-display);
  font-size: 0.78rem;
  transition: color 0.26s var(--ease);
  display: grid;
  gap: 0.5rem;
}

.hs-dot:hover {
  color: var(--white);
}

.hs-dot[aria-selected="true"] {
  color: var(--white);
}

.hs-dot-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-dot-track {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--white) 20%, transparent);
  overflow: hidden;
}

.hs-dot-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lime);
  border-radius: 2px;
}

.hs-dot[aria-selected="true"] .hs-dot-track i {
  animation: hsProgress var(--hs-dur) linear forwards;
}

.hero-slider.is-paused .hs-dot[aria-selected="true"] .hs-dot-track i {
  animation-play-state: paused;
}

/* عند إيقاف التشغيل التلقائي نُظهر الشريحة النشطة ممتلئة */
.hero-slider.is-stopped .hs-dot[aria-selected="true"] .hs-dot-track i {
  animation: none;
  width: 100%;
}

@keyframes hsProgress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* زر التشغيل/الإيقاف — مطلب إتاحة للمحتوى المتحرّك تلقائيًا */
.hs-play {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--white) 26%, transparent);
  background: transparent;
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.26s var(--ease), color 0.26s var(--ease),
    border-color 0.26s var(--ease);
}

.hs-play svg {
  width: 13px;
  height: 13px;
}

.hs-play:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy-900);
}

.hs-play .hs-ico-pause {
  display: block;
}
.hs-play .hs-ico-play {
  display: none;
}
.hs-play[aria-pressed="true"] .hs-ico-pause {
  display: none;
}
.hs-play[aria-pressed="true"] .hs-ico-play {
  display: block;
}

/* عدّاد الشرائح */
.hs-count {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--white) 60%, transparent);
  letter-spacing: 0.04em;
}

.hs-count b {
  color: var(--white);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. الاستجابة
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-slider {
    min-height: auto;
  }

  .hs-dot-label {
    display: none;
  }

  .hs-dot {
    padding: 0.55rem 0;
  }

  .hs-count {
    order: -1;
  }
}

@media (max-width: 560px) {
  .hs-arrow {
    display: none;
  }

  .hs-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   5. تقليل الحركة — تعطيل كامل
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hs-slide,
  .hs-anim {
    transition: none;
  }

  .hs-art svg,
  .hs-waves,
  .hs-glow,
  .hs-ring,
  .hs-rule,
  .hs-dot-track i {
    animation: none !important;
  }

  .hs-art svg {
    transform: scale(1.01);
  }

  .hs-rule {
    stroke-dashoffset: 0;
  }

  .hs-slide.is-active .hs-anim {
    transition-delay: 0ms;
  }

  .hs-dot[aria-selected="true"] .hs-dot-track i {
    width: 100%;
  }
}

/* بدون جافاسكربت: تُعرض الشريحة الأولى كاملة */
.no-js .hs-slide:first-child {
  opacity: 1;
  visibility: visible;
}

.no-js .hs-slide:first-child .hs-anim {
  opacity: 1;
  transform: none;
}

.no-js .hs-ui {
  display: none;
}
