/* Collection galleries (shortcode, block, page gallery, collection archives) */

.hs-gallery {
  --hs-columns: 2;
  column-count: var(--hs-columns);
  column-gap: 1.25rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.site-main .hs-gallery,
.entry-content .hs-gallery {
  padding: 0;
}

@media (max-width: 900px) {
  .hs-gallery[style*="--hs-columns:3"],
  .hs-gallery[style*="--hs-columns:4"] {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .hs-gallery {
    column-count: 1 !important;
  }
}

.hs-gallery figure {
  position: relative;
  break-inside: avoid;
  margin: 0 0 1.25rem;
  text-align: center;
}

.hs-gallery figure.white-border {
  background: #ffffff;
  padding: 15px;
}

.hs-gallery figure.white-border img {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.hs-gallery img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  border-radius: 0;
  transition: transform 0.2s;
}

.hs-gallery img:hover {
  transform: scale(1.03);
}

.hs-gallery figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

.hs-gallery .hs-gallery-details {
  display: block;
  font-size: 0.8rem;
  color: #888;
}

.hs-show-sold .hs-gallery figure.sold::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0392b;
}

.hs-gallery-empty {
  text-align: center;
  color: #777;
}

/* Collection index cards */

.hs-collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0;
  list-style: none;
}

.hs-collection-card a {
  display: block;
  text-decoration: none;
  color: #333;
}

.hs-collection-card-image {
  aspect-ratio: 4 / 3;
  background: #e5e2dc;
  overflow: hidden;
}

.hs-collection-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.hs-collection-card a:hover img {
  transform: scale(1.03);
}

.hs-collection-card-title {
  display: block;
  margin-top: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  text-align: center;
}

/* Core gallery block: keep the theme's zoom behaviour */

.wp-block-gallery img {
  cursor: zoom-in;
}

/* Lightbox */

.hs-lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.hs-lightbox.is-open {
  display: flex;
}

.hs-lightbox-image {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 4px;
}

.hs-lightbox-caption {
  margin-top: 0.75rem;
  max-width: 90vw;
  color: #eee;
  font-size: 0.95rem;
  text-align: center;
}

.hs-lightbox-caption small {
  display: block;
  color: #aaa;
  font-size: 0.8rem;
}

.hs-lightbox button {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  padding: 0.5rem 1rem;
  cursor: pointer;
  opacity: 0.75;
}

.hs-lightbox button:hover,
.hs-lightbox button:focus-visible {
  opacity: 1;
}

.hs-lightbox-close {
  top: 0.5rem;
  right: 0.5rem;
}

.hs-lightbox-prev {
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.hs-lightbox-next {
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.hs-lightbox.is-single .hs-lightbox-prev,
.hs-lightbox.is-single .hs-lightbox-next {
  display: none;
}

/* Editor preview */

.hs-gallery-block-preview {
  pointer-events: none;
}
