.gallery-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap:18px;
  margin-top:30px;
}

.gallery-grid img{
  width:100%;
  height:280px;
  object-fit:cover;
  display:block;
  border-radius:14px;
  box-shadow: 0 6px 16px rgba(15,23,42,.08);
  transition: transform .2s ease;
}

.gallery-grid img:hover{
  transform: scale(1.02);
}
.gallery-grid figure{
  margin:0;
}

.gallery-grid figcaption{
  text-align:center;
  font-size:0.9rem;
  color:#64748b;
  margin-top:6px;
}
/* ===== Lightbox (complete, final) ===== */
.lightbox{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.75);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  z-index:9999;

  opacity:0;
  visibility:hidden;
  pointer-events:none;

    transition: opacity 1s ease;
}

.lightbox.open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;

  transition: opacity 1s ease;
}

.lightbox img{
  max-width:min(1100px, 96vw);
  max-height:86vh;
  width:auto;
  height:auto;
  border-radius:16px;
  box-shadow:0 18px 50px rgba(0,0,0,.35);
  cursor:zoom-out;

  transform:scale(.96);
  transition:transform .25s ease;
}

.lightbox.open img{
  transform:scale(1);
}

.lightbox .close{
  position:absolute;
  top:18px;
  right:18px;
  padding:8px 14px;
  border-radius:8px;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(0,0,0,.15);
  color:#111;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 6px 14px rgba(0,0,0,.15);
}

.lightbox .close:hover{
  background:#fff;
}
