.grid {
  display: grid;
  gap: 12px;
  /* Default: 4 columns on wide screens, 3 on medium, 1 on small */
  grid-template-columns: repeat(3, 1fr);
}

/* 3 columns for medium widths */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* 1 column for narrow/mobile */
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
}

.grid img {
  width: 100%;
  height: 160px; /* uniform thumbnail height */
  object-fit: cover; /* crop to fill thumbnail area */
  border: 2px solid white;
  box-sizing: border-box;
  display: block;
}
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border: 4px solid white;
  background: black;
  box-shadow: 0 0 20px black;
  box-sizing: border-box;
  image-rendering: auto;
}