/* ==========================================================================
   YourMove effects — drop-in for Elementor
   1. Scroll fade-in ............ add class "ym-reveal" (needs ym-effects.js)
   2. Ken Burns hover (image) ... add class "ym-kenburns" to an Image widget
   3. Ken Burns hover (bg) ...... add class "ym-kenburns-bg" to a Section/
                                  Container whose image is a CSS background
   Paste into Elementor: Site Settings -> Custom CSS
   ========================================================================== */

/* --- 1. Scroll fade-in ---------------------------------------------------- */
.ym-reveal{
  opacity:0;
  transform:translateY(20px);
  transition:opacity .8s ease, transform .8s ease;
  will-change:opacity, transform;
}
.ym-reveal.is-visible{
  opacity:1;
  transform:none;
}

/* --- 2. Ken Burns hover grow — <img> widget ------------------------------- */
/* Apply "ym-kenburns" to an Image widget.
   Also set the widget's Advanced -> Overflow: Hidden (or keep the rule below). */
.ym-kenburns{
  overflow:hidden;
}
.ym-kenburns img{
  transition:transform 6s ease-out;
  transform:scale(1);
  will-change:transform;
}
.ym-kenburns:hover img{
  transform:scale(1.12);
}

/* --- 3. Ken Burns hover grow — CSS background image ----------------------- */
/* Apply "ym-kenburns-bg" to the Section/Container that holds the background
   image (e.g. a Loop Grid card). A ::before layer holds an identical copy of
   the background and is the only thing that scales — `transform` animates
   smoothly (unlike background-size, which HOPS from the `cover` keyword). The
   element's border, text and size never move; you still hover the real card. */
.ym-kenburns-bg{
  position:relative;
  overflow:hidden !important;  /* MUST clip the ::before so it can't cover the border */
  isolation:isolate;
}
.ym-kenburns-bg::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:inherit;    /* same image as the element (per-item in loops) */
  background-size:cover;
  background-position:center;
  border-radius:inherit;       /* match rounded corners so the border stays clean */
  z-index:0;
  transform:scale(1);
  transition:transform 6s ease-out;
  will-change:transform;
  pointer-events:none;         /* never intercepts hover / clicks */
}
.ym-kenburns-bg:hover::before{
  transform:scale(1.12);       /* zoom amount — tweak to taste */
}
.ym-kenburns-bg > *{           /* keep card content above the image layer */
  position:relative;
  z-index:1;
}

/* --- 4. Ken Burns hover grow — real <img> sibling layer ------------------- */
/* Structure inside your Container:
     Container  -> class "ym-kb-stage"   (the hover target + clip)
       Image widget (placed first) -> class "ym-kb-media"  (the zoom layer)
       Heading / Title / Excerpt / Button  (your content)
   The image fills the container behind the content and is the only thing that
   scales — transform is smooth, and the container clips it so the border and
   text never move. */
.ym-kb-stage{
  position:relative;
  overflow:hidden;             /* clips the scaling image inside the card */
}
/* The image widget becomes a full-size background layer that fills the card */
.ym-kb-stage .ym-kb-media{
  position:absolute !important;
  inset:0 !important;
  margin:0 !important;
  width:100% !important;
  height:100% !important;
  z-index:0 !important;
  pointer-events:none;         /* clicks pass through to the content/button */
}
.ym-kb-stage .ym-kb-media img{
  width:100% !important;
  height:100% !important;
  display:block;
  object-fit:cover;            /* cover framing, no distortion */
  transform:scale(1);
  transition:transform 6s ease-out;
  will-change:transform;
}
.ym-kb-stage:hover .ym-kb-media img{
  transform:scale(1.12);       /* zoom amount — tweak to taste */
}
/* Lift the inner content container(s) above the image layer */
.ym-kb-stage .e-con-inner > *:not(.ym-kb-media){
  position:relative;
  z-index:1;
}

/* --- Accessibility: respect reduced-motion users -------------------------- */
@media (prefers-reduced-motion: reduce){
  .ym-reveal{opacity:1; transform:none; transition:none;}
  .ym-kenburns img,
  .ym-kenburns-bg::before,
  .ym-kb-stage .ym-kb-media img{transition:none;}
  .ym-kenburns:hover img,
  .ym-kenburns-bg:hover::before,
  .ym-kb-stage:hover .ym-kb-media img{transform:none;}
}
