.ej-gallery.splide {
  visibility: visible;
}
/* Base fallback for non-initialized state */
.ej-gallery:not(.is-initialized) .splide__track {
  overflow: visible;
}
.ej-gallery:not(.is-initialized) .splide__slide {
  width: auto;
  margin: 0;
}
.ej-gallery__figure {
  margin: 0;
}
/* Media styling — applies in both modes */
.ej-gallery .splide__slide img,
.ej-gallery .splide__slide video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 1rem;
}
/* Desktop fallback: 2-column grid before init */
@media (min-width: 768px) {
  .ej-gallery:not(.is-initialized) .splide__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
/* Mobile fallback & layout preservation */
@media (max-width: 767px) {
  /* Reserve space for dots immediately to prevent CLS */
  .ej-gallery {
    padding-bottom: 28px;
  }
  /* Mimic Splide's flex layout to prevent FOUC before init */
  .ej-gallery:not(.is-initialized) .splide__track {
    overflow: hidden;
  }
  .ej-gallery:not(.is-initialized) .splide__list {
    display: flex;
    gap: 0;
  }
  .ej-gallery:not(.is-initialized) .splide__slide {
    width: 100%;
    flex-shrink: 0;
  }
}
/* Splide dots position */
.ej-gallery .splide__pagination {
  bottom: 0;
}
