.gallery-lightbox__grid {
  display: grid;
  gap: var(--spacing-sm);
}

.gallery-lightbox--cols-1 .gallery-lightbox__grid {
  grid-template-columns: 1fr;
}

.gallery-lightbox--cols-2 .gallery-lightbox__grid {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-lightbox--cols-3 .gallery-lightbox__grid {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-lightbox--cols-4 .gallery-lightbox__grid {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-lightbox__item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-background);
  border-radius: var(--radius-md);
  overflow: hidden;
  line-height: 0;
}

.gallery-lightbox--cols-2 .gallery-lightbox__item {
  aspect-ratio: 2 / 1;
}

.gallery-lightbox--cols-3 .gallery-lightbox__item,
.gallery-lightbox--cols-4 .gallery-lightbox__item {
  aspect-ratio: 1 / 1;
}

.gallery-lightbox__item--hidden {
  display: none;
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  height: auto;
}

.gallery-lightbox--cols-2 .gallery-lightbox__image,
.gallery-lightbox--cols-3 .gallery-lightbox__image,
.gallery-lightbox--cols-4 .gallery-lightbox__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-lightbox__zoom {
  --icon-wrapper-width: 24px;
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  color: var(--color-white);
  filter:
    drop-shadow(1px 0 0 var(--color-black))
    drop-shadow(-1px 0 0 var(--color-black))
    drop-shadow(0 1px 0 var(--color-black))
    drop-shadow(0 -1px 0 var(--color-black));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-lightbox__item:hover .gallery-lightbox__zoom {
  opacity: 1;
}

.gallery-lightbox__overflow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-white);
  font: var(--typography-body-small);
  font-weight: 600;
}

/* Hero layout: Swiper slider + thumbnail strip */
.gallery-lightbox--layout-hero {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.gallery-lightbox__main-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-background);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.gallery-lightbox__swiper-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-lightbox__swiper-main .swiper-wrapper {
  height: 100%;
}

.gallery-lightbox__swiper-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.gallery-lightbox__hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  --icon-wrapper-width: 20px;
}

.gallery-lightbox__nav--prev {
  left: var(--spacing-sm);
}

.gallery-lightbox__nav--next {
  right: var(--spacing-sm);
}

.gallery-lightbox__nav.swiper-button-disabled {
  opacity: 0 !important;
  pointer-events: none;
}

.gallery-lightbox__main-wrap:hover .gallery-lightbox__nav:not(.swiper-button-disabled) {
  opacity: 1;
}

.gallery-lightbox__hero-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--spacing-sm);
}

.gallery-lightbox__hero-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--color-background);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  border: none;
  cursor: pointer;
  line-height: 0;
}

.gallery-lightbox__hero-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-lightbox__caption {
  --typography-body-large: var(--typography-body-small);
  margin-top: var(--spacing-xs);
  text-align: center;
  color: var(--color-text-dimmed);
}

.gallery-lightbox__caption p {
  margin-block: 0;
}

/* PhotoSwipe thumbnail bar */
.pswp__gallery-thumbs {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: center;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

.pswp__gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.pswp__gallery-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  background: none;
  pointer-events: auto;
}

.pswp__gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pswp__gallery-thumb--active,
.pswp__gallery-thumb:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.85);
}
