/* Portfolio Viewer — full-screen lightbox for job profile portfolio items */

.portfolio-item.pv-trigger {
  cursor: pointer;
}

.portfolio-item.pv-trigger:focus-visible {
  outline: 2px solid var(--primary-aqua, #00C9DE);
  outline-offset: 2px;
}

.pv-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 20, 0.94);
  z-index: 3000;
  display: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.pv-overlay.show {
  opacity: 1;
}

.pv-dialog {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pv-stage {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.pv-media-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.pv-overlay.show .pv-media-wrap {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.pv-media-wrap.pv-slide-left {
  animation: pv-slide-in-left 0.22s ease;
}

.pv-media-wrap.pv-slide-right {
  animation: pv-slide-in-right 0.22s ease;
}

@keyframes pv-slide-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pv-slide-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.pv-image,
.pv-video {
  max-width: 92vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.pv-image.pv-zooming {
  transition: none;
  cursor: grab;
}

.pv-image.pv-dragging {
  cursor: grabbing;
}

.pv-video {
  background: #000;
  border-radius: 6px;
}

/* Top bar */
.pv-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  z-index: 2;
  pointer-events: none;
}

.pv-topbar > * {
  pointer-events: auto;
}

.pv-counter {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pv-toolbar {
  display: flex;
  gap: 0.5rem;
}

.pv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}

.pv-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pv-btn:active {
  transform: scale(0.94);
}

.pv-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.pv-btn.pv-hidden {
  display: none;
}

/* Prev / Next arrows */
.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}

.pv-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pv-nav svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.pv-prev { left: 1rem; }
.pv-next { right: 1rem; }

/* Bottom: caption + thumbnails */
.pv-bottom {
  width: 100%;
  padding: 0.75rem 1rem 1.25rem;
  z-index: 2;
}

.pv-caption {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
  margin: 0 auto 0.75rem;
  font-size: 0.9rem;
}

.pv-caption-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.pv-thumbs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.25rem 0.5rem;
  max-width: 100%;
  justify-content: flex-start;
  scrollbar-width: thin;
}

.pv-thumbs::-webkit-scrollbar {
  height: 6px;
}

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

.pv-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  background: #111;
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pv-thumb.pv-thumb-active {
  border-color: var(--primary-aqua, #00C9DE);
  opacity: 1;
  transform: translateY(-2px);
}

.pv-thumb:hover {
  opacity: 1;
}

.pv-thumb-video-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.pv-thumb-video-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.pv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 767px) {
  .pv-thumbs {
    display: none;
  }

  .pv-nav {
    width: 38px;
    height: 38px;
  }

  .pv-nav svg {
    width: 18px;
    height: 18px;
  }

  .pv-prev { left: 0.4rem; }
  .pv-next { right: 0.4rem; }

  .pv-image,
  .pv-video {
    max-height: 70vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pv-overlay,
  .pv-media-wrap,
  .pv-image,
  .pv-thumb {
    transition: none !important;
    animation: none !important;
  }
}
