/* Homepage-only CLS stabilizers for CE/RevSlider blocks on mobile-first contexts. */
#index rs-module-wrap[id*="rev_slider"] {
  display: block;
  min-height: clamp(260px, 55vw, 420px);
}

#index rs-module-wrap[id*="rev_slider"] rs-module {
  display: block;
  min-height: inherit;
}

/* Reserve predictable space for CE gallery/media cards before JS enhancement. */
#index .ce-image-gallery .ce-gallery-item {
  display: block;
}

#index .ce-image-gallery .ce-gallery-icon {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

#index .ce-image-gallery .ce-gallery-icon > a {
  display: block;
  height: 100%;
}

#index .ce-image-gallery .ce-gallery-icon img.elementor-bg,
#index .ce-image-gallery img.swiper-slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Prevent transform-based entrance effects from shifting captions on load. */
#index .ce-gallery-caption.elementor-animated-item--fade-from-top {
  transform: none !important;
  opacity: 1 !important;
}

/* Keep footer logo dimensions stable when CE image widget styles load later. */
#index .elementor-element-f576046 .elementor-image {
  display: block;
  max-width: 500px;
}

#index .elementor-element-f576046 .elementor-image > a {
  display: block;
}

#index .elementor-element-f576046 .elementor-image > a > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 500 / 160;
}

/* Reduce decorative motion overhead on homepage mobile. */
@media (max-width: 767px) {
  /* Match RevSlider mobile gridheight (650px) to avoid late container growth CLS. */
  #index #rev_slider_2_1_wrapper,
  #index #rev_slider_2_1_wrapper rs-module {
    min-height: 650px;
  }

  /* Keep tabbed CE category block from expanding late and pushing content down. */
  #index section.elementor-element-32031a2 > .elementor-container {
    min-height: clamp(680px, 176vw, 760px);
  }

  #index .e-transform,
  #index .elementor-motion-effects-element,
  #index .elementor-motion-effects-layer,
  #index [class*="e-transform-hover"] {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
