.superis-gallery,
.superis-gallery * {
  box-sizing: border-box;
}

.superis-gallery {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.superis-gallery__grid {
  display: grid;
  grid-template-columns: repeat(var(--superis-gallery-columns, 3), minmax(0, 1fr));
  gap: var(--superis-gallery-gap, 18px);
}

.superis-gallery__item {
  appearance: none;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: #eeeeee;
  box-shadow: none;
  cursor: zoom-in;
}

.superis-gallery__item:focus-visible {
  box-shadow: 0 0 0 4px rgba(227, 38, 28, 0.28);
}

.superis-gallery__image {
  display: block;
  width: 100%;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.superis-gallery__item:hover .superis-gallery__image,
.superis-gallery__item:focus-visible .superis-gallery__image {
  transform: scale(1.035);
}

.superis-gallery-lightbox[hidden] {
  display: none !important;
}

.superis-gallery-lightbox__arrow[hidden] {
  display: none !important;
}

.superis-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  grid-template-columns: minmax(64px, 9vw) minmax(0, 1fr) minmax(64px, 9vw);
  align-items: center;
  justify-items: center;
  padding: 28px 12px;
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(6px);
}

.superis-gallery-lightbox__stage {
  display: grid;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 56px);
  place-items: center;
}

.superis-gallery-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 56px);
  margin: 0 !important;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

.superis-gallery-lightbox__close,
.superis-gallery-lightbox__arrow {
  appearance: none;
  display: grid;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  outline: 0;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  color: #ffffff;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.superis-gallery-lightbox__close:hover,
.superis-gallery-lightbox__close:focus-visible,
.superis-gallery-lightbox__arrow:hover,
.superis-gallery-lightbox__arrow:focus-visible {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.superis-gallery-lightbox__close:focus-visible,
.superis-gallery-lightbox__arrow:focus-visible {
  box-shadow: 0 0 0 4px rgba(227, 38, 28, 0.45);
}

.superis-gallery-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 48px;
  height: 48px;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

.superis-gallery-lightbox__arrow {
  width: 54px;
  height: 54px;
  font-size: 48px;
  font-weight: 300;
  line-height: 0.8;
}

.superis-gallery-lightbox__arrow--prev:hover {
  transform: translateX(-3px);
}

.superis-gallery-lightbox__arrow--next:hover {
  transform: translateX(3px);
}

html.superis-gallery-lock {
  overflow: hidden !important;
}

@media (max-width: 900px) {
  .superis-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .superis-gallery {
    padding: 0 16px;
  }

  .superis-gallery__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .superis-gallery-lightbox {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    padding: 76px 4px 20px;
  }

  .superis-gallery-lightbox__stage,
  .superis-gallery-lightbox__image {
    max-height: calc(100vh - 96px);
  }

  .superis-gallery-lightbox__close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .superis-gallery-lightbox__arrow {
    width: 44px;
    height: 44px;
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .superis-gallery__image,
  .superis-gallery-lightbox__close,
  .superis-gallery-lightbox__arrow {
    transition: none !important;
  }
}
