/* === GWS Image Loading Shimmer ===
   Applied to slider/hero image containers while images are loading.
   JS (js/image-loading.js) adds .gws-img-loading and removes it on load.
*/

@keyframes gws-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Container with shimmer while image loads */
.gws-img-loading {
  position: relative;
  background: #e4e4e4;
  overflow: hidden;
}

.gws-img-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    90deg,
    #e4e4e4 25%,
    #efefef 50%,
    #e4e4e4 75%
  );
  background-size: 200% 100%;
  animation: gws-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}

/* Spinner overlay on loading state */
.gws-img-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid rgba(31, 171, 97, 0.25);
  border-top-color: #1fab61;
  border-radius: 50%;
  animation: gws-spin 0.7s linear infinite;
  pointer-events: none;
}

@keyframes gws-spin {
  to { transform: rotate(360deg); }
}

/* Image is invisible during loading */
.gws-img-loading > img,
.gws-img-loading img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Once loaded: shimmer gone, image fades in */
.gws-img-loaded > img,
.gws-img-loaded img {
  opacity: 1;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .gws-img-loading::before,
  .gws-img-loading::after {
    animation: none;
  }
}
