/* Image glow cards (motion kit). Adapted from Kriss Steindals' "Dynamic Image Drop Shadow Cards":
   the card's own photo is copied behind it, shifted down and blurred, so the shadow takes the photo's colours.
   Usage in Elementor (Advanced > CSS Classes):
     m-glow on a container with a background image  -> pure CSS (the shadow copies the container's background)
     m-glow on an Image widget                      -> glow.js feeds the image URL into --m-glow-img
   Swapping the photo in Elementor changes the glow too. */

.m-glow {
  --glow-y: 16px;        /* how far the glow sits below the card */
  --glow-scale: .92;     /* glow slightly narrower than the card, so it reads as a shadow */
  --glow-blur: 26px;
  --glow-o: .75;
  --glow-sat: 1.35;
  --glow-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  top: 0;
  /* lift with top, not transform: a transform would pull the glow (z-index -1) in front of the card */
  transition: top .6s var(--glow-ease);
}
/* the glow sits behind the card, so the card's parent must be its own stacking context */
:has(> .m-glow) { isolation: isolate; }

/* container version: inherit the container's own background */
.e-con.m-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: inherit;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  transform: translateY(var(--glow-y)) scale(var(--glow-scale));
  filter: blur(var(--glow-blur)) saturate(var(--glow-sat));
  opacity: var(--glow-o);
  transition: transform .6s var(--glow-ease), opacity .6s var(--glow-ease), filter .6s var(--glow-ease);
}

/* image widget version: glow.js sets --m-glow-img on the widget container */
.elementor-widget-image.m-glow .elementor-widget-container { position: relative; }
.elementor-widget-image.m-glow .elementor-widget-container::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--glow-radius, 24px);
  background: var(--m-glow-img) center / cover no-repeat;
  pointer-events: none;
  transform: translateY(var(--glow-y)) scale(var(--glow-scale));
  filter: blur(var(--glow-blur)) saturate(var(--glow-sat));
  opacity: var(--glow-o);
  transition: transform .6s var(--glow-ease), opacity .6s var(--glow-ease), filter .6s var(--glow-ease);
}
.elementor-widget-image.m-glow img { border-radius: var(--glow-radius, 24px); display: block; }

/* hover: the card lifts a little and the glow spreads. Touch screens: glow.js adds m-glow-on while the card
   is in the middle of the screen. */
.m-glow.m-glow-on { top: -6px; --glow-y: 24px; --glow-scale: .96; --glow-o: .9; --glow-blur: 30px; }
@media (hover: hover) {
  .m-glow:hover { top: -6px; --glow-y: 24px; --glow-scale: .96; --glow-o: .9; --glow-blur: 30px; }
}

/* phones and tablets: no glow. A blurred full-size copy of every photo made scrolling stutter on an iPhone 12 Pro
   (2026-10-12). */
@media (hover: none), (max-width: 1024px) {
  .e-con.m-glow::after, .elementor-widget-image.m-glow .elementor-widget-container::after { content: none; }
  .m-glow, .m-glow:hover, .m-glow.m-glow-on { top: 0; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .m-glow, .m-glow::after, .m-glow .elementor-widget-container::after { transition: none; }
  .m-glow:hover, .m-glow.m-glow-on { top: 0; }
}
