.wmg-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.wmg-item {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.wmg-open {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: #111;
  cursor: pointer;
  overflow: hidden;
}

.wmg-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.wmg-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  padding-left: 4px;
}

.wmg-caption {
  position: relative;
  z-index: 10;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  margin-top: 6px;
}

.wmg-empty {
  padding: 20px;
  text-align: center;
}

.wmg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.92);
  overflow: hidden;
  touch-action: pan-y;
}

.wmg-lightbox.is-open {
  display: flex;
}

.wmg-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wmg-slide {
  position: relative;
  max-width: 94vw;
  max-height: 84vh;
  will-change: transform, opacity;
  transition: transform .28s ease, opacity .28s ease;
}

.wmg-slide.is-dragging {
  transition: none;
}

.wmg-slide img,
.wmg-slide video {
  max-width: 94vw;
  max-height: 84vh;
  display: block;
  object-fit: contain;
}

.wmg-close,
.wmg-prev,
.wmg-next {
  position: fixed;
  z-index: 1000001;
  border: 0;
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.wmg-close {
  top: 16px;
  right: 18px;
  font-size: 42px;
  width: 52px;
  height: 52px;
}

.wmg-prev,
.wmg-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
  width: 58px;
  height: 78px;
}

.wmg-prev { left: 14px; }
.wmg-next { right: 14px; }

.wmg-lightbox-caption {
  position: fixed;
  z-index: 1000000;
  left: 0;
  right: 0;
  bottom: 18px;
  padding: 0 22px;
  color: #fff;
  text-align: center;
  font-size: 16px;
}

@media (max-width: 767px) {
  .wmg-gallery {
    gap: 4px;
  }
  .wmg-caption {
    font-size: 12px;
  }
  .wmg-prev,
  .wmg-next {
    display: none;
  }
}
