/* ========== GALLERY ========== */
.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--light-bg);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-gallery-hover);
}

/* Cards are keyboard-focusable role="button" divs (js/gallery.js), so they need a
   focus ring the same way a real button does. offset keeps it outside the card's
   own overflow:hidden clipping. */
.gallery-item:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 3px;
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background-color: var(--light-bg);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

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

.gallery-caption {
  padding: 0.9rem var(--space-lg);
  background-color: var(--white);
}

.gallery-caption .gallery-item-title {
  font-size: var(--font-size-sm-alt);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--space-3xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

.gallery-caption .gallery-item-count {
  font-size: var(--font-size-2xs);
  color: var(--muted-color);
}
