
.gallery {
  width: 100%;
  max-width: 1200px; /* or whatever fits your layout */
  margin: 0 auto;
}

.gallery-sizer {
  /*width: 200px;/* base column width */
  display: inline-block;
  width: 200px; /* base column width for desktop */
  /*width: 48%; /* responsive: 2 per row on small screens */
}

.gallery-item {
  width: 200px;
  margin-bottom: 15px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease;
  box-sizing: border-box; /* include padding/margin in width */
}

.gallery-item img {
  width: 100%;  /* maintain original aspect ratio */
  height: auto;
  border-radius: 6px;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item p {
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgb(80, 80, 80);
  line-height: 1.3;
}

.gallery-item.loaded {
  opacity: 1;
}

/* Desktop: more columns */
@media(min-width: 900px) {
  .gallery-sizer,
  .gallery-item {
    width: 200px; /* ~5-6 columns on desktop */
  }
}

/* Tablet: fewer columns */
@media(max-width: 899px) and (min-width: 501px) {
  .gallery-sizer,
  .gallery-item {
    width: 150px; /* ~3-4 columns */
  }
}

/* Mobile: at least 2 columns */
@media(max-width: 500px) {
  .gallery-sizer,
  .gallery-item {
    width: 48%; /* 2 per row */
  }
}