/* ============================================================
   Picture Viewer — standalone CSS (prefix: pv-)
   Drop this file + picture-viewer.js into any page.
   ============================================================ */

/* ---- Overlay ---- */
.pv-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  user-select: none;
  overflow: hidden;
}

.pv-overlay.pv-active {
  display: flex;
  opacity: 1;
}

/* ---- Backdrop (click-to-close) ---- */
.pv-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ---- Slider & Track ---- */
.pv-slider {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 85vh;
  overflow: hidden;
}

.pv-track {
  display: flex;
  height: 100%;
  align-items: center;
  will-change: transform;
  cursor: grab;
}

.pv-track:active {
  cursor: grabbing;
}

.pv-track.pv-dragging {
  transition: none !important;
}

.pv-track.pv-animating {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Slide ---- */
.pv-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 10px;
}

.pv-slide img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  flex-shrink: 0;
}

.pv-slide img.pv-loading {
  opacity: 0.3;
}

.pv-slide img.pv-loaded {
  opacity: 1;
  transition: opacity 0.3s;
}

/* ---- Page indicator ---- */
.pv-page {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 10;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ---- Toolbar ---- */
.pv-toolbar {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pv-toolbar button {
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.pv-toolbar button:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.08);
}

.pv-toolbar button:active {
  transform: scale(0.92);
}

.pv-toolbar button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Navigation arrows ---- */
.pv-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pv-nav:hover {
  background: rgba(255, 255, 255, 0.20);
  transform: translateY(-50%) scale(1.06);
}

.pv-nav svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pv-nav.pv-prev {
  left: 24px;
}

.pv-nav.pv-next {
  right: 24px;
}

/* ---- Footer (title) ---- */
.pv-footer {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .pv-nav {
    width: 40px;
    height: 40px;
    padding: 10px;
  }

  .pv-nav.pv-prev {
    left: 8px;
  }

  .pv-nav.pv-next {
    right: 8px;
  }

  .pv-toolbar button {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .pv-toolbar {
    top: 12px;
    right: 12px;
    gap: 4px;
  }

  .pv-page {
    top: 16px;
    left: 16px;
    font-size: 14px;
  }

  .pv-footer {
    font-size: 14px;
    bottom: 18px;
  }

  .pv-slider {
    width: 100%;
    height: 80vh;
  }

  .pv-slide {
    padding: 10px 5px;
  }
}
