/* =========================================================================
   Thread Glow Overlay — نور طلایی روی نخِ عکس هدر
   این افکت روی .ilc-hero-media سوار می‌شه (بدون دست‌زدن به خود عکس).

   نکته‌ی مهم درباره‌ی RTL/LTR:
   .ilc-hero-media برای صفحات فارسی (dir="rtl") با scaleX(-1) آینه می‌شه.
   مسیرهای این فایل از روی نسخه‌ی آینه‌شده (فارسی) ترسیم شدن، پس منطق برعکسه:
   حالت پیش‌فرض (en/hy/ru) رو ما فلیپ می‌کنیم تا با عکسِ آینه‌نشده‌شون بخونه،
   و برای فارسی ترنسفرم رو خنثی می‌کنیم چون از اول مطابق همونه.
   ========================================================================= */

.hero-thread-glow{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: plus-lighter;
  transform: none;
  transform-origin: center;
}
[dir="rtl"] .hero-thread-glow{
  transform: scaleX(-1);
}

.hero-thread-glow svg{
  width: 100%;
  height: 100%;
  display: block;
}

.thread-path{ fill: none; stroke: url(#threadGoldGrad); }

.thread-path.ambient{
  stroke-width: 2.2;
  opacity: .38;
  filter: url(#softBlur);
}

.thread-path.comet{
  stroke-width: 5;
  stroke-linecap: round;
  filter: url(#softBlur);
  stroke-dasharray: 46 900;
  animation: ilcThreadRun 6s ease-in-out infinite;
  opacity: 1;
}
.thread-path.comet.delay{ opacity: .85; }

.thread-path.core{
  stroke: #FFF3D6;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 30 900;
  animation: ilcThreadRun 6s ease-in-out infinite;
}
.thread-path.core.delay{ opacity: .85; }

@keyframes ilcThreadRun{
  0%{ stroke-dashoffset: 0; opacity: 0; }
  6%{ opacity: 1; }
  90%{ opacity: 1; }
  100%{ stroke-dashoffset: -930; opacity: 0; }
}

.needle-spark{
  fill: #FFF3D6;
  filter: url(#softBlur);
  transform-origin: center;
  animation: ilcThreadTwinkle 2.6s ease-in-out infinite;
}
@keyframes ilcThreadTwinkle{
  0%,100%{ opacity:.45; transform:scale(.8); }
  50%{ opacity:1; transform:scale(1.35); }
}

/* روی موبایل، crop و position عکس هدر خیلی فرق می‌کنه (چند بار override شده
   توی ilc-redesign.css) و یه مسیر ثابت دیگه درست روی نخ نمی‌شینه. تا وقتی
   یه مسیر مخصوص موبایل نکشیم، ترجیح دادیم به‌جای نور بی‌ربط، مخفی بمونه. */
@media (max-width: 760px){
  .hero-thread-glow{
    display: block;
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce){
  .thread-path.comet, .thread-path.core, .needle-spark{
    animation: none !important;
    opacity: .5 !important;
  }
}
