.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  padding: 20px;
  max-width: 1200px;
  margin: auto;
}

.gallery-item {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: pointer;
  border-radius: 12px;
  transition: transform .2s ease, box-shadow .2s ease;
}

/*  added to avoid cropped thumbnail--start */

/* .gallery-item {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #111;
} */

/* .gallery-item {
  width: 100%;
  height: auto;
  object-fit: contain;
} */

.gallery-item {
  /* winner***** */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
}


/*  added to avoid cropped thumbnail-- end */

.gallery-item:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 90%;
  max-height: 85%;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.lightbox button {
  position: absolute;
  background: rgba(0,0,0,.5);
  border: none;
  color: white;
  font-size: 32px;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s ease;
}

.lightbox button:hover {
  background: rgba(0,0,0,.8);
}

.close {
  top: 20px;
  right: 30px;
  font-size: 40px;
}

.prev {
  left: 40px;
}

.next {
  right: 40px;
}

@media (max-width: 768px) {
  .prev { left: 15px; }
  .next { right: 15px; }
}
