/* ═══════ انیمیشن‌های صفحه اصلی ═══════
   کلاس hmu-motion را hmu-motion.js روی <html> می‌گذارد؛ بدون JS همه چیز عادی نمایش داده می‌شود.
   ظاهر شدن با اسکرول روی ستون‌ها اعمال می‌شود (نه خود کارت‌ها) تا با transform حالت hover کارت‌ها تداخل نکند. */

/* ── ظاهر شدن با اسکرول ── */
html.hmu-motion .hm-reveal{opacity:0;transform:translateY(28px);transition:opacity .7s cubic-bezier(.2,.65,.3,1),transform .7s cubic-bezier(.2,.65,.3,1);transition-delay:var(--hm-delay,0s);will-change:opacity,transform}
html.hmu-motion .hm-reveal.hm-zoom{transform:scale(.94)}
html.hmu-motion .hm-reveal.hm-side{transform:translateX(30px)}
html.hmu-motion .hm-reveal.hm-in{opacity:1;transform:none}

/* ── عنوان بخش‌ها: خط طلایی از راست کشیده می‌شود ── */
html.hmu-motion .selected{border-bottom-color:transparent!important;background:linear-gradient(#c8a951,#c8a951) right bottom/0 3px no-repeat;transition:background-size .9s cubic-bezier(.2,.65,.3,1) .15s}
html.hmu-motion .selected.hm-in{background-size:100% 3px}

/* ── اسلایدر: زوم آرام (Ken Burns) و ورود نرم ── */
.hmu-slider .carousel-item.active .hmu-slide-img{animation:hmKen 9s ease-out both}
.hmu-slider{animation:hmFadeIn .9s ease both}
@keyframes hmKen{from{transform:scale(1.08)}to{transform:scale(1)}}

/* ── نوار سامانه‌ها: ورود پلکانی و حرکت آیکن‌ها ── */
html.hmu-motion .carousel8 .carousel-cell img,
html.hmu-motion .carousel8 .carousel-cell h6{animation:hmRise .6s cubic-bezier(.2,.65,.3,1) both;animation-delay:var(--hm-delay,0s)}
.carousel8 .carousel-cell img{transition:transform .35s cubic-bezier(.3,1.6,.5,1)}
.carousel8 .carousel-cell:hover img{transform:translateY(-4px) scale(1.12)}
.carousel8 .carousel-cell h6{transition:color .25s}
.carousel8 .carousel-cell:hover h6{color:#f3d98a!important}

/* ── کارت خبر: درخشش عبوری روی تصویر ── */
.hmu-news-img-wrap{position:relative}
.hmu-news-img-wrap:after{content:"";position:absolute;top:0;bottom:0;left:-60%;width:40%;background:linear-gradient(100deg,rgba(255,255,255,0),rgba(255,255,255,.35),rgba(255,255,255,0));transform:skewX(-18deg);pointer-events:none;opacity:0}
.hmu-news-card:hover .hmu-news-img-wrap:after{animation:hmShine .8s ease}
@keyframes hmShine{0%{left:-60%;opacity:1}100%{left:130%;opacity:1}}

/* ── اطلاعیه: نوار طلایی کنار آیتم ── */
.hmu-notice-item{overflow:hidden}
.hmu-notice-item:before{content:"";position:absolute;top:0;bottom:0;right:0;width:3px;background:#c8a951;transform:scaleY(0);transform-origin:top;transition:transform .3s ease}
.hmu-notice-item:hover:before{transform:scaleY(1)}
.hmu-notice-item:hover{transform:translateX(-3px)}
.hmu-notice-item{transition:border-color .2s,box-shadow .2s,background .2s,transform .25s}

/* ── پیوند مفید: بالا آمدن لوگو ── */
.hmu-link-card img{transition:transform .35s cubic-bezier(.3,1.6,.5,1)}
.hmu-link-card:hover img{transform:scale(1.1) rotate(-2deg)}

/* ── نوار پیشرفت اسکرول ── */
.hm-progress{position:fixed;top:0;right:0;left:0;height:3px;z-index:99999;pointer-events:none;background:linear-gradient(to left,#c8a951,#f3d98a,#0b6a94);transform:scaleX(0);transform-origin:right}

/* ── دکمه بازگشت به بالا ── */
.hm-top{position:fixed;left:22px;bottom:118px;z-index:9998;width:46px;height:46px;border:none;border-radius:50%;padding:0;cursor:pointer;background:#084562;color:#fff;box-shadow:0 8px 22px rgba(8,69,98,.35);display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transform:translateY(16px) scale(.85);transition:opacity .3s,transform .3s,visibility .3s,background .2s}
.hm-top.show{opacity:1;visibility:visible;transform:none}
.hm-top:hover{background:#0b6a94;transform:translateY(-3px)}
.hm-top svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.hm-top svg circle{fill:none;stroke:#c8a951;stroke-width:3;stroke-linecap:round}
.hm-top span{position:relative;font-size:18px;line-height:1}
/* در حالت شب (معکوس شدن کل صفحه) رنگ‌های سازمانی این دو حفظ می‌شود */
html[data-theme="dark"] .hm-top,html[data-theme="dark"] .hm-progress{filter:invert(1) hue-rotate(180deg)}

@keyframes hmFadeIn{from{opacity:0}to{opacity:1}}
@keyframes hmRise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* کاربرانی که حرکت کم را انتخاب کرده‌اند */
@media (prefers-reduced-motion:reduce){
    html.hmu-motion .hm-reveal{opacity:1!important;transform:none!important;transition:none!important}
    html.hmu-motion .selected{background-size:100% 3px;transition:none}
    .hmu-slider,.hmu-slider .carousel-item.active .hmu-slide-img,
    html.hmu-motion .carousel8 .carousel-cell img,html.hmu-motion .carousel8 .carousel-cell h6{animation:none!important}
}
