.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: var(--rgsg-object-fit, cover); /* configurable from backend */
}


/* 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:var(--rgsg-object-fit, cover);
  display:block;
}

/* =========================================================
 * RGSG fix v1.1.7 - navegación limpia y lightbox con cierre visible
 * - Evita doble flecha/botón cuando Swiper o el tema agregan iconos por ::after.
 * - Mantiene una sola flecha por CSS con ::before.
 * - Ubica los botones dentro del área visual del slider.
 * - Asegura que la X del lightbox quede visible arriba a la derecha.
 * ========================================================= */
.rgsg-stable .rgsg-swiper .swiper-button-prev,
.rgsg-stable .rgsg-swiper .swiper-button-next{
  width:44px !important;
  height:44px !important;
  margin-top:0 !important;
  transform:translateY(-50%) !important;
  border:0 !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.96) !important;
  color:#111 !important;
  box-shadow:0 8px 22px rgba(0,0,0,.18) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  z-index:25 !important;
  overflow:hidden !important;
}

.rgsg-stable .rgsg-swiper .swiper-button-prev{
  left:18px !important;
}

.rgsg-stable .rgsg-swiper .swiper-button-next{
  right:18px !important;
}

/* Quita la flecha nativa de Swiper para que no se duplique con estilos del plugin/tema */
.rgsg-stable .rgsg-swiper .swiper-button-prev::after,
.rgsg-stable .rgsg-swiper .swiper-button-next::after{
  content:"" !important;
  display:none !important;
  opacity:0 !important;
  visibility:hidden !important;
  font-size:0 !important;
}

/* Flecha única, controlada por este plugin */
.rgsg-stable .rgsg-swiper .swiper-button-prev::before,
.rgsg-stable .rgsg-swiper .swiper-button-next::before{
  display:block !important;
  font-size:28px !important;
  line-height:1 !important;
  font-weight:500 !important;
  color:#111 !important;
  font-family:Arial, Helvetica, sans-serif !important;
}

.rgsg-stable .rgsg-swiper .swiper-button-prev::before{
  content:"‹" !important;
}

.rgsg-stable .rgsg-swiper .swiper-button-next::before{
  content:"›" !important;
}

.rgsg-stable .rgsg-swiper .swiper-button-disabled{
  opacity:.35 !important;
  pointer-events:none !important;
}

/* Mantiene la paginación debajo/limpia cuando el slider usa altura automática */
.rgsg-stable .swiper-pagination{
  z-index:20 !important;
}

/* Lightbox: X visible y clickeable por encima de la imagen */
.rgsg-lightbox .rgsg-lb-close{
  position:absolute !important;
  top:14px !important;
  right:14px !important;
  z-index:60 !important;
  width:44px !important;
  height:44px !important;
  border:0 !important;
  border-radius:999px !important;
  background:rgba(0,0,0,.62) !important;
  color:#fff !important;
  font-size:30px !important;
  line-height:44px !important;
  font-weight:400 !important;
  text-align:center !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  cursor:pointer !important;
  box-shadow:0 8px 22px rgba(0,0,0,.25) !important;
  -webkit-appearance:none !important;
  appearance:none !important;
}

.rgsg-lightbox .rgsg-lb-close:hover,
.rgsg-lightbox .rgsg-lb-close:focus{
  background:rgba(0,0,0,.82) !important;
  outline:2px solid rgba(255,255,255,.55) !important;
  outline-offset:2px !important;
}

.rgsg-lightbox .rgsg-lb-prev,
.rgsg-lightbox .rgsg-lb-next{
  z-index:55 !important;
}

.rgsg-lightbox .rgsg-lb-swiper{
  z-index:1 !important;
}

@media (max-width:767px){
  .rgsg-stable .rgsg-swiper .swiper-button-prev,
  .rgsg-stable .rgsg-swiper .swiper-button-next{
    width:38px !important;
    height:38px !important;
  }
  .rgsg-stable .rgsg-swiper .swiper-button-prev{ left:10px !important; }
  .rgsg-stable .rgsg-swiper .swiper-button-next{ right:10px !important; }
  .rgsg-lightbox .rgsg-lb-close{
    top:10px !important;
    right:10px !important;
    width:40px !important;
    height:40px !important;
    line-height:40px !important;
    font-size:28px !important;
  }
}

/* =========================================================
 * RGSG fix v1.1.8 - título/texto editorial dentro del slider
 * - Solo aparece si la imagen tiene título real o texto/caption/description.
 * - No afecta imágenes sin información: quedan como antes.
 * - No cambia shortcode, clases principales ni funcionamiento del lightbox.
 * ========================================================= */
.rgsg-stable .rgsg-swiper .rgsg-item{
  position:relative;
  overflow:hidden;
}

.rgsg-stable .rgsg-swiper .rgsg-slide-caption{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:18;
  display:block;
  box-sizing:border-box;
  padding:24px 26px 26px;
  color:#fff;
  text-align:left;
  background:linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.36) 58%, rgba(0,0,0,0));
  pointer-events:none;
}

.rgsg-stable .rgsg-swiper .rgsg-slide-title,
.rgsg-stable .rgsg-swiper .rgsg-slide-text{
  display:block;
  max-width:820px;
  margin:0;
  color:#fff;
  text-shadow:0 2px 8px rgba(0,0,0,.35);
}

.rgsg-stable .rgsg-swiper .rgsg-slide-title{
  font-size:clamp(18px, 2.2vw, 28px);
  line-height:1.12;
  font-weight:800;
}

.rgsg-stable .rgsg-swiper .rgsg-slide-text{
  margin-top:7px;
  font-size:clamp(13px, 1.35vw, 16px);
  line-height:1.35;
  font-weight:500;
  opacity:.96;
}

@media (max-width:767px){
  .rgsg-stable .rgsg-swiper .rgsg-slide-caption{
    padding:18px 16px 20px;
  }
  .rgsg-stable .rgsg-swiper .rgsg-slide-title{
    font-size:18px;
  }
  .rgsg-stable .rgsg-swiper .rgsg-slide-text{
    font-size:13px;
  }
}


/* RGSG v1.1.12 - backend width/height controls applied reliably */
.rgsg-stable.rgsg-has-width-controls{
  display:block;
  box-sizing:border-box;
}
.rgsg-stable.rgsg-has-width-controls .rgsg-swiper{
  box-sizing:border-box;
}
.rgsg-stable.rgsg-has-height-controls .rgsg-swiper{
  overflow:hidden;
}
.rgsg-stable.rgsg-has-height-controls .rgsg-swiper,
.rgsg-stable.rgsg-has-height-controls .rgsg-swiper .swiper-wrapper,
.rgsg-stable.rgsg-has-height-controls .rgsg-swiper .swiper-slide,
.rgsg-stable.rgsg-has-height-controls .rgsg-swiper .rgsg-item{
  box-sizing:border-box;
}
.rgsg-stable.rgsg-has-height-controls .rgsg-swiper .rgsg-item img{
  width:100%;
  object-fit:var(--rgsg-object-fit, cover);
}
