.spabox-auto-gallery {
  display: grid;
  grid-template-columns: repeat(var(--spabox-gallery-desktop, 2), minmax(0, 1fr));
  gap: var(--spabox-gallery-gap, 12px);
  width: 100%;
  margin: 1.25rem 0;
}

.spabox-auto-gallery-item {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(127, 127, 127, .08);
}

.spabox-auto-gallery-item > a,
.spabox-auto-gallery-item > picture,
.spabox-auto-gallery-item > img,
.spabox-auto-gallery-item p > a {
  display: block;
  width: 100%;
  height: 100%;
}

.spabox-auto-gallery-item img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover;
  cursor: zoom-in;
}

.spabox-auto-gallery-item[data-ratio="natural"] img { height: auto !important; object-fit: contain; }
.spabox-auto-gallery-item[data-ratio="1x1"] { aspect-ratio: 1 / 1; }
.spabox-auto-gallery-item[data-ratio="3x4"] { aspect-ratio: 3 / 4; }
.spabox-auto-gallery-item[data-ratio="4x3"] { aspect-ratio: 4 / 3; }
.spabox-auto-gallery-item figcaption { padding: 8px 10px; color: inherit; font-size: .82rem; line-height: 1.45; }

.spabox-gallery-lightbox {
  position: fixed;
  z-index: 1000000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .94);
  color: #fff;
  touch-action: none;
}
.spabox-gallery-lightbox.is-open { display: flex; }
.spabox-gallery-lightbox-stage { position: relative; display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.spabox-gallery-lightbox-image { display: block; max-width: min(92vw, 1600px); max-height: 88vh; width: auto; height: auto; object-fit: contain; user-select: none; }
.spabox-gallery-lightbox button { position: absolute; z-index: 2; display: grid; width: 46px; height: 46px; padding: 0; border: 1px solid rgba(255,255,255,.32); border-radius: 50%; place-items: center; background: rgba(20,20,20,.72); color: #fff; font-size: 25px; cursor: pointer; }
.spabox-gallery-lightbox-close { top: 10px; right: 10px; }
.spabox-gallery-lightbox-prev { top: 50%; left: 10px; transform: translateY(-50%); }
.spabox-gallery-lightbox-next { top: 50%; right: 10px; transform: translateY(-50%); }
.spabox-gallery-lightbox-meta { position: absolute; right: 70px; bottom: 12px; left: 70px; display: flex; gap: 16px; justify-content: center; color: rgba(255,255,255,.8); font-size: 13px; text-align: center; }
body.spabox-gallery-modal-open { overflow: hidden !important; }

@media (max-width: 991.98px) {
  .spabox-auto-gallery { grid-template-columns: repeat(var(--spabox-gallery-tablet, 2), minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .spabox-auto-gallery { grid-template-columns: repeat(var(--spabox-gallery-mobile, 2), minmax(0, 1fr)); }
  .spabox-gallery-lightbox { padding: 8px; }
  .spabox-gallery-lightbox button { width: 40px; height: 40px; }
  .spabox-gallery-lightbox-meta { right: 52px; left: 52px; }
}

