.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gallery a { display: block; }
.gallery img {
  width: 100%; height: 180px; object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}
.lb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
}
.lb-overlay.active { display: flex; }
.lb-frame { position: relative; max-width: 92vw; max-height: 92vh; }
.lb-img { max-width: 92vw; max-height: 92vh; display: block; border-radius: 8px; }
.lb-caption {
  position: absolute; left: 0; right: 0; bottom: -38px; color: #ddd; text-align: center; font-size: .95rem;
}
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 28px; padding: 8px 12px; cursor: pointer; border-radius: 6px;
}
.lb-prev { left: -56px; }
.lb-next { right: -56px; }
.lb-close {
  position: absolute; top: -44px; right: 0;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 24px; padding: 6px 10px; cursor: pointer; border-radius: 6px;
}
@media (max-width: 640px) {
  .gallery img { height: 140px; }
  .lb-prev { left: -44px; } .lb-next { right: -44px; }
}

