.photo-viewer{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  padding: 20px;
}

.photo-viewer.is-open{
  display: flex;
}

.photo-viewer img{
  max-width: min(96vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  background: #111827;
}

.photo-viewer-close{
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  z-index: 10001;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.96);
  color: #0f172a;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  user-select: none;
}

.photo-viewer-close:hover{
  transform: scale(1.03);
}

.photo-viewer-close:active{
  transform: scale(.98);
}

.photo-viewer-caption{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10000;
  margin: 0 auto;
  max-width: 920px;
  padding: 10px 14px;
  border-radius: 14px;
  color: #fff;
  background: rgba(15,23,42,.72);
  backdrop-filter: blur(8px);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 768px){
  .photo-viewer{
    padding: 10px;
  }

  .photo-viewer img{
    max-width: 100vw;
    max-height: 82vh;
    border-radius: 10px;
  }

  .photo-viewer-close{
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    font-size: 26px;
  }

  .photo-viewer-caption{
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    font-size: 13px;
  }
}

.pv-no-scroll,
.pv-no-scroll body {
  overflow: hidden !important;
}

.pv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pv-backdrop.is-open {
  display: flex;
}

.pv-dialog {
  position: relative;
  width: min(96vw, 1600px);
  height: min(94vh, 1000px);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pv-dialog.is-landscape .pv-image,
.pv-dialog.is-square .pv-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pv-dialog.is-portrait .pv-image {
  width: auto;
  height: 100%;
  max-width: min(92vw, 720px);
  object-fit: contain;
}

.pv-image {
  display: block;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.32);
  background: #111;
}

.pv-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.pv-caption {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 2;
  max-width: min(92vw, 1000px);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15,23,42,.55);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 768px) {
  .pv-backdrop {
    padding: 12px;
  }

  .pv-dialog {
    width: 100%;
    height: 100%;
  }

  .pv-dialog.is-portrait .pv-image {
    max-width: 94vw;
  }

  .pv-close {
    top: 10px;
    right: 10px;
  }

  .pv-caption {
    bottom: 10px;
    font-size: 13px;
  }
}


