/* ==========================================================================
   Extreme Marketing (Divi 5 child) - effect classes

   Divi 5: add a class under Advanced > Attributes (or CSS ID & Classes > CSS Class).

   SCROLL
     em-reveal            fade up when scrolled into view
     em-reveal-left       add with em-reveal: slide in from the left
     em-reveal-right      add with em-reveal: slide in from the right
     em-reveal-zoom       add with em-reveal: scale up
     em-d1 ... em-d5      add with em-reveal: delay by 1 to 5 steps
     em-stagger           on a row or column: its children appear one after another
     em-parallax          drifts gently as the page scrolls
     em-count             the first number inside counts up from zero (keeps $ % + and commas)
     em-type              types and cycles words separated by | for example:
                          We make it <span class="em-type">simple|fast|reliable</span>

   HOVER
     em-lift              card rises with a soft shadow
     em-tilt              card tilts toward the cursor
     em-zoom              image zooms inside its frame
     em-underline         links draw an underline
     em-btn               button rises with a light sweep

   STYLE
     em-gradient-text     headings filled with the brand gradient
     em-gradient-bg       slowly moving brand gradient background
     em-glass             frosted glass panel for dark backgrounds
     em-glass-light       frosted glass panel for light or photo backgrounds

   LAYOUT
     em-marquee           on a row or column: children scroll sideways in a loop
     em-sticky-header     on a Theme Builder header section: sticks and shrinks
     em-inline-btns       on a column: button modules sit side by side

   SITE-WIDE (switched on or off in Appearance > Customize > Extreme Marketing Theme)
     page fade-in, reading progress bar, back-to-top button, fixed header shadow

   Colours, speeds and sizes are set in style.css or the Customizer.
   ========================================================================== */

/* --------------------------------------------------------------- scroll */
:where(.em-js) .em-reveal,
:where(.em-js) .em-stagger > * {
  opacity: 0;
  transform: translate3d(0, var(--em-distance), 0);
  transition: opacity var(--em-speed) var(--em-ease), transform var(--em-speed) var(--em-ease);
  transition-delay: calc(var(--em-i, 0) * var(--em-stagger-gap));
}
:where(.em-js) .em-reveal.em-reveal-left { transform: translate3d(calc(var(--em-distance) * -1.5), 0, 0); }
:where(.em-js) .em-reveal.em-reveal-right { transform: translate3d(calc(var(--em-distance) * 1.5), 0, 0); }
:where(.em-js) .em-reveal.em-reveal-zoom { transform: scale(0.94); }

:where(.em-js) .em-reveal.em-in,
:where(.em-js) .em-stagger.em-in > * {
  opacity: 1;
  transform: none;
}
/* once a group has finished appearing, drop the delay so hover effects respond at once */
.em-stagger.em-done > * { transition-delay: 0s; }

.em-d1 { --em-i: 1; }
.em-d2 { --em-i: 2; }
.em-d3 { --em-i: 3; }
.em-d4 { --em-i: 4; }
.em-d5 { --em-i: 5; }

.em-parallax { transform: translate3d(0, var(--em-shift, 0px), 0); will-change: transform; }

@media (max-width: 767px) {
  :where(.em-js) .em-reveal.em-reveal-left,
  :where(.em-js) .em-reveal.em-reveal-right { transform: translate3d(0, var(--em-distance), 0); }
  .em-parallax { transform: none; }
}

/* ---------------------------------------------------------------- hover */
.em-lift,
.em-stagger.em-done > .em-lift {
  transition: transform 0.35s var(--em-ease), box-shadow 0.35s var(--em-ease);
}
.em-lift:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: 0 22px 44px -18px color-mix(in srgb, var(--em-ink) 35%, transparent);
}

.em-tilt { transition: transform 0.25s var(--em-ease); transform-style: preserve-3d; will-change: transform; }

.em-zoom,
.em-zoom .et_pb_image_wrap { overflow: hidden; border-radius: var(--em-radius); }
.em-zoom img { transition: transform 0.7s var(--em-ease); }
.em-zoom:hover img { transform: scale(1.06); }

.em-underline a {
  text-decoration: none;
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s var(--em-ease);
}
.em-underline a:hover,
.em-underline a:focus-visible { background-size: 100% 2px; }

.et_pb_button.em-btn,
.em-btn .et_pb_button {
  background-image: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%) !important;
  background-size: 250% 100% !important;
  background-position: 130% 0 !important;
  background-repeat: no-repeat !important;
  transition: transform 0.25s var(--em-ease), box-shadow 0.25s var(--em-ease), background-position 0.7s var(--em-ease), background-color 0.25s ease !important;
}
.et_pb_button.em-btn:hover,
.em-btn .et_pb_button:hover {
  transform: translate3d(0, -2px, 0);
  background-position: -30% 0 !important;
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--em-ink) 50%, transparent);
}

/* ---------------------------------------------------------------- style */
.em-gradient-text h1,
.em-gradient-text h2,
.em-gradient-text h3,
.em-gradient-text h4,
.em-gradient-text .et_pb_module_header,
span.em-gradient-text {
  background: linear-gradient(100deg, var(--em-brand), var(--em-brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent !important;
}

.em-gradient-bg {
  background: linear-gradient(120deg, var(--em-ink), var(--em-brand), var(--em-brand-2), var(--em-ink)) !important;
  background-size: 300% 300% !important;
  animation: em-gradient 16s ease infinite;
}
@keyframes em-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.em-glass,
.em-glass-light {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-radius: var(--em-radius);
}
.em-glass {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.em-glass-light {
  background-color: rgba(255, 255, 255, 0.62) !important;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------- layout */
.em-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.em-marquee-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  gap: var(--em-marquee-gap, 64px);
  animation: em-marquee var(--em-marquee-speed, 30s) linear infinite;
}
.em-marquee-track > * {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
  float: none !important;
}
.em-marquee-track img { max-height: var(--em-marquee-height, 48px); width: auto; }
.em-marquee:hover .em-marquee-track { animation-play-state: paused; }
@keyframes em-marquee {
  to { transform: translate3d(calc(-50% - var(--em-marquee-gap, 64px) / 2), 0, 0); }
}

.et-l--header:has(.em-sticky-header) { position: sticky; top: 0; z-index: 9999; }
.admin-bar .et-l--header:has(.em-sticky-header) { top: 32px; }
.em-sticky-header { transition: padding 0.3s var(--em-ease), box-shadow 0.3s var(--em-ease), background-color 0.3s ease; }
.em-scrolled .em-sticky-header {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--em-ink) 55%, transparent);
}

.em-inline-btns .et_pb_button_module_wrapper { display: inline-block; margin: 0 12px 12px 0; }

/* ------------------------------------------------------- typed headline */
.em-type-text::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 3px;
  vertical-align: -0.1em;
  background: currentColor;
  animation: em-caret 1s steps(1) infinite;
}
.em-type-text.em-type-static::after { display: none; }
@keyframes em-caret { 50% { opacity: 0; } }
.em-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------ site-wide */
body.em-page-fade { animation: em-page-in 0.5s ease both; }
@keyframes em-page-in { from { opacity: 0; } }

.em-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100000;
  pointer-events: none;
}
.em-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--em-brand), var(--em-brand-2));
  transform: scaleX(var(--em-progress, 0));
  transform-origin: 0 50%;
}

.em-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--em-brand);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 10px, 0);
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--em-ink) 60%, transparent);
  transition: opacity 0.3s ease, transform 0.3s var(--em-ease), visibility 0.3s;
}
.em-top.em-top-show { opacity: 1; visibility: visible; transform: none; }
.em-top:hover { transform: translate3d(0, -3px, 0); }
.em-top:focus-visible { outline: 3px solid color-mix(in srgb, var(--em-brand) 45%, #fff); outline-offset: 3px; }

/* Divi default header: soften the fixed state. Set a slightly transparent header
   background in Divi's Customizer to see the blur. */
.em-modern-header #main-header { transition: box-shadow 0.3s var(--em-ease), background-color 0.3s ease; }
.em-modern-header #main-header.et-fixed-header {
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 10px 30px -20px color-mix(in srgb, var(--em-ink) 60%, transparent) !important;
}

/* ------------------------------------------------- builder and a11y guards */
.et-fb .em-reveal,
.et-fb .em-stagger > *,
.et-db .et-fb-root-ancestor .em-reveal,
body.et-vb .em-reveal,
body.et-vb .em-stagger > * {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .em-reveal,
  .em-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .em-gradient-bg,
  .em-marquee-track,
  body.em-page-fade,
  .em-type-text::after { animation: none; }
  .em-top { transition: none; }
  .em-marquee-track { flex-wrap: wrap; width: auto; justify-content: center; }
  .em-parallax,
  .em-tilt,
  .em-lift:hover,
  .et_pb_button.em-btn:hover,
  .em-btn .et_pb_button:hover,
  .em-zoom:hover img { transform: none !important; }
}
