/* Responsive image gallery used on every category page */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.75rem;
  margin: 1.5rem 0;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
}

/* Quarto wraps each gallery image in a <figure>; drop its default spacing so
   the cards stay compact */
.gallery-item .quarto-figure,
.gallery-item figure {
  margin: 0;
  width: 100%;
}

.gallery-item figure > p {
  margin-bottom: 0;
}

.gallery-item figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  text-align: center;
  color: inherit;
}

/* Thumbnails open a larger view in the lightbox */
.gallery-item a.lightbox img {
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}

.gallery-item a.lightbox:hover img {
  border-color: rgba(0, 0, 0, 0.4);
}

.gallery-download {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.gallery-count {
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
}

/* Homepage category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
  margin: 1.5rem 0 2.5rem 0;
}

.category-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.category-card:hover {
  transform: translateY(-3px);
}

.category-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.5rem;
}

.category-card-label {
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  text-align: center;
}
