.jp-mla-gallery {
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Height is controlled via Elementor Style control */
.jp-mla-gallery .swiper,
.jp-mla-gallery__slide {
  width: 100%;
  height: 100%;
}

/* ---------- Swiper core (failsafe) ---------- */
.jp-mla-gallery .swiper { position: relative; overflow: hidden; }
.jp-mla-gallery .swiper-wrapper { display: flex; width: 100%; height: 100%; }
.jp-mla-gallery .swiper-slide { flex-shrink: 0; width: 100%; height: 100%; }

.jp-mla-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Slider controls ---------- */
.jp-mla-gallery .swiper-button-prev,
.jp-mla-gallery .swiper-button-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  pointer-events: auto;
  cursor: pointer;
  color: inherit;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.jp-mla-gallery .swiper-button-prev { left: 12px; }
.jp-mla-gallery .swiper-button-next { right: 12px; }

/* Font-free chevrons */
.jp-mla-gallery .swiper-button-prev::after,
.jp-mla-gallery .swiper-button-next::after { content: "" !important; }
.jp-mla-gallery .swiper-button-prev::before,
.jp-mla-gallery .swiper-button-next::before {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  display: block;
}
.jp-mla-gallery .swiper-button-prev::before { transform: rotate(135deg); }
.jp-mla-gallery .swiper-button-next::before { transform: rotate(-45deg); }

.jp-mla-gallery .swiper-pagination {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 20;
  display: flex !important;
  justify-content: center;
  gap: 8px;
  opacity: 1 !important;
}
.jp-mla-gallery .swiper-pagination-bullet {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  opacity: 1;
}
.jp-mla-gallery .swiper-pagination-bullet-active {
  background: rgba(255,255,255,.95);
}

/* ---------- Grid ---------- */
.jp-mla-gallery__grid {
  display: grid;
  grid-template-columns: repeat(var(--jp-cols, 4), 1fr);
  gap: var(--jp-gap, 12px);
}

.jp-mla-gallery__cell {
  width: 100%;
  overflow: hidden;
}

/* Equal height grid via aspect-ratio */
.jp-mla-gallery.jp-mla-grid--equal .jp-mla-gallery__cell {
  aspect-ratio: var(--jp-ar, 4/3);
}
.jp-mla-gallery.jp-mla-grid--equal .jp-mla-gallery__cell img {
  width: 100%;
  height: 100%;
}

/* Masonry (CSS columns) */
.jp-mla-gallery.jp-mla-grid--masonry .jp-mla-gallery__grid {
  display: block;
  column-count: var(--jp-cols, 4);
  column-gap: var(--jp-gap, 12px);
}
.jp-mla-gallery.jp-mla-grid--masonry .jp-mla-gallery__cell {
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--jp-gap, 12px);
  break-inside: avoid;
}
.jp-mla-gallery.jp-mla-grid--masonry .jp-mla-gallery__cell img {
  width: 100%;
  height: auto;
}

/* ---------- Filter bar ---------- */
.jp-mla-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.jp-mla-filter__btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.75);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: transform .12s ease, background .12s ease;
}

.jp-mla-filter__btn:hover {
  transform: translateY(-1px);
}

.jp-mla-filter__btn.is-active {
  background: rgba(255,255,255,.95);
  border-color: rgba(0,0,0,.25);
}

.jp-mla-filter__status {
  margin-left: auto;
  font-size: 13px;
  opacity: .75;
}

/* ---------- Editor notice ---------- */
.jp-mla-gallery__notice {
  padding: 12px 14px;
  border: 1px dashed #ccc;
  border-radius: 10px;
  font-size: 13px;
}
