/* 1.40.1 (t176u, as the reference image): a white rounded card with the image panel inset; on hover the panel pops
   clearly out above the card's top edge with a soft shadow, and the picture tilts in 3D with the mouse (desktop) or the
   device (phones). Transforms only: no layout shift. The home slider gets head-room so the pop is not clipped.
   With prefers-reduced-motion the pop still shows (no animation, no tilt). Titles: bold, one line. */
.meh-item:has(>.meh-item-visual),.msa-public-course-card,.product_cat-educational-courses.mn-product-loop-card{--mt-lift:0px;--mt-scale:1;--mt-rx:0deg;--mt-ry:0deg}

/* the card */
.meh-item:has(>.meh-item-visual){background:#fff!important;border-radius:26px!important;padding:12px 12px 16px!important;overflow:visible!important;
  box-shadow:0 10px 30px rgba(15,23,42,.08);transition:box-shadow .45s cubic-bezier(.2,.8,.2,1)}
.msa-public-course-card,.product_cat-educational-courses.mn-product-loop-card{overflow:visible!important;transition:box-shadow .45s cubic-bezier(.2,.8,.2,1)}

/* the image panel (inset, rounded) */
.meh-item-visual,.msa-public-course-card>picture,.msa-public-course-card>img.msa-public-course-cover,.product_cat-educational-courses.mn-product-loop-card>.mn-card-media{
  display:block;position:relative;z-index:2;overflow:hidden;border-radius:20px!important;perspective:900px;isolation:isolate;
  transform:translate3d(0,var(--mt-lift),0) scale(var(--mt-scale));transform-origin:50% 100%;
  transition:transform .5s cubic-bezier(.2,.8,.2,1),box-shadow .5s cubic-bezier(.2,.8,.2,1);will-change:transform}
.meh-item-visual img,.msa-public-course-card>picture img,.product_cat-educational-courses.mn-product-loop-card>.mn-card-media img{display:block;inline-size:100%;block-size:100%;object-fit:cover;
  transform:rotateX(var(--mt-rx)) rotateY(var(--mt-ry)) scale(1.07);transition:transform .35s cubic-bezier(.2,.8,.2,1);will-change:transform;backface-visibility:hidden}
.msa-public-course-card>img.msa-public-course-cover{transform:translate3d(0,var(--mt-lift),0) scale(var(--mt-scale)) rotateX(var(--mt-rx)) rotateY(var(--mt-ry))}
/* home-3d.css tilts .meh-item-visual itself (and sets transform:none!important under reduced motion); this card owns it now */
.meh-item:has(>.meh-item-visual)>.meh-item-visual{transform:translate3d(0,var(--mt-lift),0) scale(var(--mt-scale))!important}
.meh-item:has(>.meh-item-visual)>.meh-item-visual img{transform:rotateX(var(--mt-rx)) rotateY(var(--mt-ry)) scale(1.07)!important}

/* titles: bold, one line, centred under the panel */
.meh-item:has(>.meh-item-visual) h3,.msa-public-course-card h2,.product_cat-educational-courses.mn-product-loop-card h2{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meh-item:has(>.meh-item-visual) h3{text-align:center;margin-block-start:10px}
.meh-item:has(>.meh-item-visual) .meh-item-type{display:table;margin:12px auto 0;transition:opacity .3s ease}
.meh-item:has(>.meh-item-visual) h3{transition:transform .4s cubic-bezier(.2,.8,.2,1)}
.meh-item:has(>.meh-item-visual) h3 a,.product_cat-educational-courses.mn-product-loop-card h2 a{white-space:nowrap}

/* 1.40.2: room inside the home sliders (they clip vertically): above for the popped panel, so it never touches the text
   above the row, and below so the hover shadow fades out softly instead of ending on a hard edge */
.meh-carousel:has(>.meh-item>.meh-item-visual){padding-block:64px 64px!important;margin-block-end:-40px}

/* hover / keyboard focus: the panel pops out above the card */
@media (hover:hover) and (pointer:fine){
  .meh-item:has(>.meh-item-visual):hover,.msa-public-course-card:hover,.product_cat-educational-courses.mn-product-loop-card:hover{box-shadow:0 22px 48px -12px rgba(15,23,42,.16)}
  /* the «در حال به‌روزرسانی» label fades and the title rises to the middle of the text area */
  .meh-item:has(>.meh-item-visual):hover .meh-item-type{opacity:0}
  .meh-item:has(>.meh-item-visual):hover h3{transform:translateY(-17px)}
  .meh-item:hover>.meh-item-visual,.msa-public-course-card:hover>picture,.msa-public-course-card:hover>img.msa-public-course-cover,.product_cat-educational-courses.mn-product-loop-card:hover>.mn-card-media{
    --mt-lift:-40px;--mt-scale:1.05;box-shadow:0 30px 50px rgba(249,115,22,.30),0 14px 26px rgba(15,23,42,.18)}
}
.meh-item:has(>.meh-item-visual):focus-within .meh-item-type{opacity:0}
.meh-item:has(>.meh-item-visual):focus-within h3{transform:translateY(-17px)}
.meh-item:has(>.meh-item-visual):focus-within>.meh-item-visual{--mt-lift:-40px;--mt-scale:1.05;box-shadow:0 30px 50px rgba(249,115,22,.30),0 14px 26px rgba(15,23,42,.18)}

/* reduced motion: keep the pop, drop the animation and the tilt */
@media (prefers-reduced-motion:reduce){
  .meh-item-visual,.msa-public-course-card>picture,.msa-public-course-card>img.msa-public-course-cover,.product_cat-educational-courses.mn-product-loop-card>.mn-card-media,
  .meh-item-visual img,.msa-public-course-card>picture img,.product_cat-educational-courses.mn-product-loop-card>.mn-card-media img,.meh-item:has(>.meh-item-visual),.meh-item:has(>.meh-item-visual) h3,.meh-item:has(>.meh-item-visual) .meh-item-type{transition:none!important}
  .meh-item-visual img,.msa-public-course-card>picture img,.product_cat-educational-courses.mn-product-loop-card>.mn-card-media img,.meh-item:has(>.meh-item-visual)>.meh-item-visual img{transform:scale(1.07)!important}
}
