/* Simple Masonry Gallery (CSS columns masonry) */
.smg-gallery{
  column-count: var(--smg-columns, 4);
  column-gap: var(--smg-gap, 14px);
}

.smg-item{
  break-inside: avoid;
  margin: 0 0 var(--smg-gap, 14px);
}

.smg-item img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--smg-radius, 8px);
}

.smg-lightbox{ display:block; text-decoration:none; }
.smg-lightbox img{ transition: transform 160ms ease, filter 160ms ease; }
.smg-lightbox:hover img{ transform: scale(1.01); filter: brightness(1.03); }

/* Responsive columns */
@media (max-width: 1100px){ .smg-gallery{ column-count: 3; } }
@media (max-width: 800px){ .smg-gallery{ column-count: 2; } }
@media (max-width: 520px){ .smg-gallery{ column-count: 1; } }

/* --- Lightbox --- */
.smg-lb{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
}

.smg-lb[aria-hidden="false"]{ display:block; }

.smg-lb__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.86);
}

.smg-lb__dialog{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
}

.smg-lb__frame{
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: min(85vh, 900px);
  width: auto;
}

.smg-lb__img{
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  display:block;
  border-radius: 10px;
}

.smg-lb__caption{
  margin-top: 10px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
}

.smg-lb__btn{
  position:absolute;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.smg-lb__btn:hover{ background: rgba(0,0,0,0.55); }

.smg-lb__close{ right: 10px; }
.smg-lb__prev, .smg-lb__next{
  top: 50%;
  transform: translateY(-50%);
}
.smg-lb__prev{ left: -54px; }
.smg-lb__next{ right: -54px; }

@media (max-width: 700px){
  .smg-lb__prev{ left: 10px; }
  .smg-lb__next{ right: 10px; }
}
