/* Full-screen photo viewer (PhotoLightbox.jsx). Rendered into <body>, so it carries its own
   values rather than the gallery page tokens. */
.pl-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 70% at 50% 45%, rgba(20, 38, 30, 0.55) 0%, rgba(20, 38, 30, 0) 70%),
    rgba(6, 10, 8, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  animation: pl-fade-in 0.3s ease both;
  user-select: none;
}

.pl-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
}

.pl-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pl-title {
  overflow: hidden;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pl-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.58);
}

.pl-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.pl-counter span,
.pl-counter strong {
  font-family: 'Inter', system-ui, sans-serif;
}

.pl-counter strong {
  color: #fff;
  font-weight: 600;
}

.pl-progress {
  display: block;
  width: 88px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.pl-progress span {
  display: block;
  height: 100%;
  background: #f5a900;
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.pl-close {
  justify-self: end;
}

.pl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.pl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.36);
}

.pl-btn:focus-visible,
.pl-thumb:focus-visible {
  outline: 2px solid #f5a900;
  outline-offset: 3px;
}

.pl-stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4px 96px 8px;
  touch-action: pan-y;
}

.pl-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pl-img.is-loaded {
  opacity: 1;
  transform: none;
}

.pl-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  margin-top: -26px;
}

.pl-prev { left: 24px; }
.pl-next { right: 24px; }

.pl-prev:hover { transform: translateX(-2px); }
.pl-next:hover { transform: translateX(2px); }

.pl-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: #f5a900;
  animation: pl-spin 0.8s linear infinite;
}

.pl-caption {
  max-width: 64ch;
  margin: 10px auto 0;
  padding: 0 24px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

.pl-thumbs {
  display: flex;
  gap: 8px;
  padding: 16px 24px 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pl-thumbs::-webkit-scrollbar {
  display: none;
}

/* margin: auto centres the strip while it fits and lets it scroll from the start when it doesn't */
.pl-thumb:first-child { margin-left: auto; }
.pl-thumb:last-child { margin-right: auto; }

.pl-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  opacity: 0.42;
  box-shadow: 0 0 0 0 rgba(245, 169, 0, 0);
  transition: opacity 0.25s, box-shadow 0.25s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.pl-thumb:hover {
  opacity: 0.85;
}

.pl-thumb.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px #f5a900;
  transform: translateY(-2px);
}

@keyframes pl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pl-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .pl-top {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 12px 14px;
  }
  .pl-counter { order: 2; }
  .pl-close { order: 3; }
  .pl-progress { display: none; }
  .pl-stage { padding: 0 10px; }
  .pl-nav { display: none; } /* swipe or use the thumbnails on touch screens */
  .pl-thumbs { padding: 12px 14px 18px; }
  .pl-thumb {
    width: 60px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-overlay,
  .pl-img,
  .pl-thumb,
  .pl-btn,
  .pl-progress span {
    animation: none;
    transition: none;
  }
}
