/* --- Gallery --- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 8px;
}

/* Each thumbnail stacks image + caption vertically */
.thumb {
  display: flex;
  flex-direction: column;   /* ensures caption is below */
}

/* Make image fill the grid cell */
.thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  border-radius: 4px;
}

.thumb img:hover {
  border: 2px solid #dd4814;
}

/* Caption always below image */
.caption {
  margin-top: 4px;
  font-size: 1rem;
  color: #333;
  text-align: center;
}

/* --- Lightbox --- */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;     /* image above caption */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 16px;
  box-sizing: border-box;
}

.lightbox img {
  max-width: 95%;
  max-height: 85%;
  margin-bottom: 8px;
}

.lightbox .caption {
  font-size: 1rem;
  color: #ccc;
}
