.rgsg-stable { --rgsg-gap: 12px; --rgsg-cols: 3; }

/* Masonry (CSS columns): flows naturally and is very stable */
.rgsg-stable .rgsg-masonry{
  column-count: var(--rgsg-cols);
  column-gap: var(--rgsg-gap);
}
@media (max-width:1023px){
  .rgsg-stable .rgsg-masonry{ column-count: 2; }
}
@media (max-width:767px){
  .rgsg-stable .rgsg-masonry{ column-count: 1; }
}

.rgsg-stable .rgsg-item{
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--rgsg-gap) 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.rgsg-stable img{ display:block; width:100%; height:auto; object-fit:cover; }


/* Swiper buttons/pagination basic */
.rgsg-stable .swiper-button-prev,
.rgsg-stable .swiper-button-next{
  color: inherit;
}
.rgsg-stable .swiper-pagination-bullet{ opacity:.5; }
.rgsg-stable .swiper-pagination-bullet-active{ opacity:1; }

/* Lightbox */
.rgsg-lightbox{
  position:fixed; inset:0; z-index:999999;
}
.rgsg-lb-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.75);
}
.rgsg-lb-dialog{
  position:relative;
  width:min(1100px, calc(100% - 32px));
  height:min(92vh, 820px);
  margin: 16px auto;
  background:#111;
  border-radius:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.rgsg-lb-close{
  position:absolute; top:10px; right:12px;
  width:40px; height:40px;
  border:0; border-radius:999px;
  background: rgba(255,255,255,.12);
  color:#fff; font-size:28px; line-height:40px;
  cursor:pointer;
}
.rgsg-lb-prev, .rgsg-lb-next{
  position:absolute; top:50%;
  transform:translateY(-50%);
  width:44px; height:60px;
  border:0; border-radius:12px;
  background: rgba(255,255,255,.12);
  color:#fff; font-size:40px; line-height:60px;
  cursor:pointer;
}
.rgsg-lb-prev{ left:10px; }
.rgsg-lb-next{ right:10px; }
.rgsg-lb-swiper{ width:100%; flex:1; }
.rgsg-lb-swiper img{ width:100%; height:100%; object-fit: cover; background:#000; }
.rgsg-lb-cap{
  color:#ddd;
  padding:10px 14px;
  font-size:14px;
  background:#0b0b0b;
}
body.rgsg-lb-open{ overflow:hidden; }


/* Slider image fit: adapt to box height without distortion */
.rgsg-stable .rgsg-swiper .swiper-slide{
  display:flex;
  align-items:center;
  justify-content:center;
}

.rgsg-stable .rgsg-swiper .rgsg-item{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.rgsg-stable .rgsg-swiper .rgsg-item img{
  width:100%;
  height:100%;
  object-fit: cover; /* keeps proportions */
}


/* Slider image cover mode */
.rgsg-stable .rgsg-swiper,
.rgsg-stable .rgsg-swiper .swiper-slide{
  width:100%;
  height:100%;
}

.rgsg-stable .rgsg-swiper .rgsg-item{
  width:100%;
  height:100%;
  display:block;
}

.rgsg-stable .rgsg-swiper .rgsg-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
