/*! SmartMag Gallery CSS 3.7.1 (scoped) */
.smartmag-gallery{
  margin:16px 0; width:100%; visibility:visible; opacity:1; position:relative;
  background:#f7f8fa; padding:8px; border-radius:12px; box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.smartmag-gallery figure{position:relative; margin:0}

/* Only style images inside gallery items */
.smartmag-gallery .smg-item img{width:100%; height:auto; display:block; object-fit:cover; border-radius:10px}

/* Default aspect ratio (non-mosaic) */
.smartmag-gallery:not(.type-mosaic) .smg-item img{ aspect-ratio: var(--sm-aspect, 1.7777777778); } /* 16/9 */
.smartmag-gallery[data-aspect="auto"] .smg-item img{ aspect-ratio:auto; object-fit:contain }

/* Rounded alias */
.smartmag-gallery.is-rounded{ border-radius:16px }
.smartmag-gallery.is-rounded .smg-item img{ border-radius:14px }

/* GRID */
.smartmag-gallery.type-grid{ display:grid !important; grid-template-columns:repeat(var(--sm-cols,3),1fr); gap:8px }
.smartmag-gallery.type-grid .smg-item{ width:100% }

/* MOSAIC (columns) */
.smartmag-gallery.type-mosaic{ column-count: var(--sm-cols, 3) !important; column-gap: 8px }
.smartmag-gallery.type-mosaic .smg-item{ break-inside:avoid; display:inline-block; width:100%; margin:0 0 8px 0 }

/* JUSTIFIED */
.smartmag-gallery.type-justified{ display:block }
.smartmag-gallery.type-justified .smg-item{ overflow:hidden; border-radius:10px; background:#fff }

/* SLIDESHOW */
.smartmag-gallery.type-slideshow .smg-item{ display:block }
.smartmag-gallery.type-slideshow .smg-item:not(.is-active){ display:none }
.smartmag-gallery .smg-nav{ position:absolute; top:50%; transform:translateY(-50%);
  border:0; background:rgba(0,0,0,.45); color:#fff; padding:.5rem .75rem; cursor:pointer; z-index:3; border-radius:.5rem; line-height:1 }
.smartmag-gallery .smg-prev{ left:.5rem } .smartmag-gallery .smg-next{ right:.5rem }
.smartmag-gallery:not(.type-slideshow) .smg-nav{ display:none !important }

/* Responsive */
@media (max-width:1024px){
  .smartmag-gallery.type-grid{ grid-template-columns:repeat(var(--sm-cols,2),1fr) }
  .smartmag-gallery.type-mosaic{ column-count: var(--sm-cols, 2) }
}
@media (max-width:640px){
  .smartmag-gallery.type-grid{ grid-template-columns:repeat(1,1fr) }
  .smartmag-gallery.type-mosaic{ column-count:1 }
}

/* Lightbox body lock (if used) */
body.smartmag-lightbox-open{ overflow:hidden; touch-action:none }