/* ===== Photo Viewer Lightbox ===== */

.photo-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
}

.photo-viewer[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-viewer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

.photo-viewer__container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  z-index: 1;
}

/* Image area */
.photo-viewer__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 120px);
  max-height: calc(100% - 40px);
}

.photo-viewer__image {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 2px;
  user-select: none;
}

/* Close button – top-right corner of the image wrap */
.photo-viewer__close {
  position: absolute;
  top: -36px;
  right: -4px;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  transition: color 0.2s;
}

.photo-viewer__close:hover {
  color: #fff;
}

/* Navigation arrows – sit beside the image */
.photo-viewer__nav {
  flex-shrink: 0;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  cursor: pointer;
  padding: 12px;
  line-height: 1;
  transition: color 0.2s;
}

.photo-viewer__nav:hover {
  color: #fff;
}

/* Counter */
.photo-viewer__counter {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  white-space: nowrap;
  font-family: system-ui, sans-serif;
}

/* ===== Mobile adjustments ===== */
@media (max-width: 640px) {
  .photo-viewer__container {
    padding: 16px 4px;
    gap: 4px;
  }

  .photo-viewer__nav {
    font-size: 20px;
    padding: 8px;
  }

  .photo-viewer__image-wrap {
    max-width: calc(100% - 60px);
  }

  .photo-viewer__image {
    max-height: calc(100vh - 60px);
  }

  .photo-viewer__close {
    top: -32px;
    right: -2px;
    font-size: 18px;
  }
}
