.gallery-container {
  max-width: 600px;   /* reduced to 50% of 1200px */
  margin: 20px auto;
  padding: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* desktop default */
  gap: 8px;
}

/* Responsive breakpoints */
@media (max-width: 1024px) { /* tablets */
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) { /* large mobiles */
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) { /* small mobiles */
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Thumbnail wrapper */
.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;   /* uniform square */
  overflow: hidden;
  border-radius: 6px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* no distortion */
  display: block;
  border: 2px solid transparent;
  transition: transform 0.3s, border 0.3s;
  cursor: pointer;
}

.thumb img:hover {
  transform: scale(1.2);
  border: 2px solid #3498db;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.pagination button {
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background: #3498db;
  color: white;
  font-size: 14px;
}

.pagination button:disabled {
  background: #aaa;
  cursor: not-allowed;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  padding: 20px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  text-align: center;
}

.lightbox.open {
  display: block;
}

.lightbox img {
  max-width: 80%;
  max-height: 80%;
  margin-top: 50px;
  border-radius: 8px;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  color: white;
  cursor: pointer;
  user-select: none;
}

.lb-close {
  top: 20px;
  right: 30px;
  transform: none;
}

.lb-prev {
  left: 30px;
}

.lb-next {
  right: 30px;
}

.lb-counter {
  color: #fff;
  margin-top: 10px;
  font-size: 14px;
  
}
