.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.image-lightbox--open {
  pointer-events: auto;
  animation: image-lightbox-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-lightbox--closing {
  pointer-events: none;
  animation: image-lightbox-exit 220ms cubic-bezier(0.4, 0, 1, 1) both;
}

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

.image-lightbox__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  opacity: 0;
  transform: scale(0.96);
}

.image-lightbox--open .image-lightbox__stage {
  animation: image-lightbox-stage-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-lightbox--closing .image-lightbox__stage {
  animation: image-lightbox-stage-exit 220ms cubic-bezier(0.4, 0, 1, 1) both;
}

.image-lightbox__header,
.image-lightbox__footer {
  opacity: 0;
}

.image-lightbox--open .image-lightbox__header,
.image-lightbox--open .image-lightbox__footer {
  animation: image-lightbox-chrome-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-lightbox--closing .image-lightbox__header,
.image-lightbox--closing .image-lightbox__footer {
  animation: image-lightbox-chrome-exit 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes image-lightbox-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes image-lightbox-exit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes image-lightbox-stage-enter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes image-lightbox-stage-exit {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes image-lightbox-chrome-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes image-lightbox-chrome-exit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-lightbox--open,
  .image-lightbox--closing,
  .image-lightbox--open .image-lightbox__stage,
  .image-lightbox--closing .image-lightbox__stage,
  .image-lightbox--open .image-lightbox__header,
  .image-lightbox--open .image-lightbox__footer,
  .image-lightbox--closing .image-lightbox__header,
  .image-lightbox--closing .image-lightbox__footer {
    animation-duration: 1ms;
  }

  .image-lightbox__stage {
    transform: none;
  }
}

.image-lightbox__stage--transformed {
  cursor: grab;
}

.image-lightbox__stage--panning {
  cursor: grabbing;
}

.image-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  transform-origin: center center;
}

.image-lightbox__header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.image-lightbox__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.image-lightbox__close {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  pointer-events: auto;
}

.image-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.image-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.image-lightbox__nav:hover {
  background: rgba(0, 0, 0, 0.48);
}

.image-lightbox__nav--prev {
  left: 12px;
}

.image-lightbox__nav--next {
  right: 12px;
}

.image-lightbox__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.image-lightbox__thumbs {
  overflow-x: auto;
  padding: 10px 16px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.image-lightbox__thumbs-inner {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
}

.image-lightbox__thumbs::-webkit-scrollbar {
  height: 4px;
}

.image-lightbox__thumbs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.image-lightbox__thumb {
  flex-shrink: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.72;
  pointer-events: auto;
}

.image-lightbox__thumb:hover {
  opacity: 0.95;
}

.image-lightbox__thumb--active {
  border-color: rgba(255, 255, 255, 0.95);
  opacity: 1;
}

.image-lightbox__thumb img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
}

.image-lightbox__hint {
  padding: 6px 16px 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.image-lightbox__zoomable-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.image-lightbox__zoomable-wrap img[data-zoomable="true"] {
  cursor: zoom-in;
}

[data-image-lightbox-gallery-scope] img[data-image-lightbox-src] {
  cursor: zoom-in;
}

.image-lightbox__zoomable-hint {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-lightbox__zoomable-wrap:hover .image-lightbox__zoomable-hint {
  opacity: 1;
}

.image-lightbox__zoomable-hint span {
  border-radius: 6px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}
