.prozinco-gallery {
  width: 100%;
  margin: 0 0 8px;
}

.prozinco-gallery__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #e8e8ee;
  box-shadow: 0 8px 24px rgba(16, 3, 170, 0.08);
}

.prozinco-gallery__open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.prozinco-gallery__slide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.prozinco-gallery__slide.is-active {
  z-index: 1;
  opacity: 1;
}

.prozinco-gallery__control,
.prozinco-gallery-modal__nav,
.prozinco-gallery-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 16, 32, 0.48);
  color: #fff;
  cursor: pointer;
}

.prozinco-gallery__control {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
}

.prozinco-gallery__control--prev {
  left: 12px;
}

.prozinco-gallery__control--next {
  right: 12px;
}

.prozinco-gallery__control--toggle {
  top: auto;
  right: 12px;
  bottom: 12px;
  transform: none;
}

.prozinco-gallery__control:hover,
.prozinco-gallery-modal__nav:hover,
.prozinco-gallery-modal__close:hover {
  background: #1003aa;
}

.prozinco-gallery__control--toggle[aria-pressed="false"] .prozinco-gallery__icon--play,
.prozinco-gallery__control--toggle[aria-pressed="true"] .prozinco-gallery__icon--pause {
  display: none;
}

.prozinco-gallery__thumbs {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.prozinco-gallery__thumb,
.prozinco-gallery-modal__thumb {
  display: block;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #ececf2;
  cursor: pointer;
}

.prozinco-gallery__thumb {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;
}

.prozinco-gallery__thumb img,
.prozinco-gallery-modal__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.prozinco-gallery__thumb[aria-current="true"],
.prozinco-gallery-modal__thumb[aria-current="true"] {
  border-color: #1003aa;
  box-shadow: 0 0 0 1px #1003aa;
}

.prozinco-gallery button:focus-visible,
.prozinco-gallery-modal button:focus-visible {
  outline: 2px solid #1003aa;
  outline-offset: 2px;
}

.prozinco-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.prozinco-gallery-modal[hidden] {
  display: none !important;
}

.prozinco-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 12, 28, 0.72);
  cursor: pointer;
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .prozinco-gallery-modal__backdrop {
    background: rgba(10, 12, 28, 0.55);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
}

.prozinco-gallery-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(1180px, 100%);
  max-height: 100%;
}

.prozinco-gallery-modal__figure {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.prozinco-gallery-modal__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 48px);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  object-fit: contain;
  transition: opacity 0.35s ease;
}

.prozinco-gallery-modal__image.is-changing {
  opacity: 0;
}

.prozinco-gallery-modal__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
}

.prozinco-gallery-modal__prev {
  left: 12px;
}

.prozinco-gallery-modal__next {
  right: 12px;
}

.prozinco-gallery-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a37;
}

.prozinco-gallery-modal__close:hover {
  background: #fff;
  color: #1003aa;
}

.prozinco-gallery-modal__thumbs {
  display: flex;
  flex: 0 0 96px;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.prozinco-gallery-modal__thumb {
  flex: 0 0 auto;
  width: 120px;
  height: auto;
  aspect-ratio: 16 / 9;
}

@media (max-width: 767px) {
  .prozinco-gallery__thumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .prozinco-gallery__thumb {
    flex: 0 0 46%;
    width: 46%;
    max-width: none;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .prozinco-gallery-modal {
    align-items: center;
    padding: 56px 12px 12px;
  }

  .prozinco-gallery-modal__dialog {
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-height: 100%;
  }

  .prozinco-gallery-modal__figure {
    width: 100%;
  }

  .prozinco-gallery-modal__image {
    max-width: 100%;
    max-height: calc(100vh - 180px);
  }

  .prozinco-gallery-modal__thumbs {
    flex-direction: row;
    flex-basis: auto;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .prozinco-gallery-modal__thumb {
    flex: 0 0 120px;
    width: 120px;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prozinco-gallery__slide,
  .prozinco-gallery-modal__image {
    transition: none;
  }
}
