/* CSS-only image gallery (replaces Qi / Swiper slider that needs JS) */
.aih-gallery {
  --aih-gallery-count: 4;
  --aih-gallery-duration: 5s;
  position: relative;
  width: 100%;
  aspect-ratio: 1706 / 733;
  overflow: hidden;
  background: #f4f1ea;
}
.aih-gallery__slides {
  position: absolute;
  inset: 0;
}
.aih-gallery__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation-name: aih-gallery-fade;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: calc(var(--aih-gallery-count) * var(--aih-gallery-duration));
}
.aih-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.aih-gallery__slide:nth-child(1) {
  animation-delay: 0s;
}
.aih-gallery__slide:nth-child(2) {
  animation-delay: calc(1 * var(--aih-gallery-duration));
}
.aih-gallery__slide:nth-child(3) {
  animation-delay: calc(2 * var(--aih-gallery-duration));
}
.aih-gallery__slide:nth-child(4) {
  animation-delay: calc(3 * var(--aih-gallery-duration));
}

/*
  4 slides × 5s = 20s loop.
  Each slide is visible ~22% of the loop (~4.4s), with short crossfade.
*/
@keyframes aih-gallery-fade {
  0% {
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  22% {
    opacity: 1;
  }
  26% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aih-gallery__slide {
    animation: none;
    opacity: 0;
  }
  .aih-gallery__slide:first-child {
    opacity: 1;
  }
}
