/* ============================================================
   Lightbox + EXIF Metadata Overlay
   Design: minimal, elegant, non-distracting
   ============================================================ */

/* ---------- Backdrop ---------- */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 8, 6, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  cursor: zoom-out;
}

.lightbox-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Stage ---------- */
.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 80px);
  cursor: default;
}

/* ---------- Image ---------- */
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  user-select: none;
  transition: opacity 0.2s ease;
}

.lightbox-img.is-loading {
  opacity: 0.3;
}

/* ---------- EXIF Overlay ---------- */
.lightbox-exif {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 20px 18px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.38) 55%,
    transparent 100%
  );
  border-radius: 0 0 3px 3px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.lightbox-stage:hover .lightbox-exif,
.lightbox-stage:focus-within .lightbox-exif {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-exif__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

/* Left column: location + datetime */
.lightbox-exif__location-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.lightbox-exif__place {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9375rem;       /* 15px */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-exif__datetime {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.6875rem;       /* 11px */
  font-weight: 300;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Right column: camera + lens */
.lightbox-exif__camera-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
  min-width: 0;
  flex-shrink: 0;
}

.lightbox-exif__camera {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;         /* 12px */
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.lightbox-exif__lens {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.6875rem;       /* 11px */
  font-weight: 300;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading / empty state */
.lightbox-exif__placeholder {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.06em;
  text-align: center;
}

/* ---------- Nav Buttons ---------- */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1010;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-backdrop.is-open:hover .lightbox-nav,
.lightbox-backdrop.is-open:focus-within .lightbox-nav {
  opacity: 1;
}

.lightbox-nav:hover {
  opacity: 1 !important;
}

.lightbox-nav--prev { left: 16px; }
.lightbox-nav--next { right: 16px; }

.lightbox-nav svg {
  width: 28px;
  height: 28px;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.15s ease;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.lightbox-nav:hover svg {
  stroke: rgba(255, 255, 255, 0.95);
}

/* ---------- Close Button ---------- */
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1010;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-backdrop.is-open:hover .lightbox-close,
.lightbox-backdrop.is-open:focus-within .lightbox-close {
  opacity: 1;
}

.lightbox-close:hover {
  opacity: 1 !important;
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.15s ease;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.lightbox-close:hover svg {
  stroke: rgba(255, 255, 255, 0.95);
}

/* ---------- Counter ---------- */
.lightbox-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1010;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.lightbox-backdrop.is-open:hover .lightbox-counter,
.lightbox-backdrop.is-open:focus-within .lightbox-counter {
  opacity: 1;
}

/* ---------- Spinner ---------- */
.lightbox-spinner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: lightbox-spin 0.7s linear infinite;
  display: none;
}

.lightbox-stage.is-loading .lightbox-spinner {
  display: block;
}

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

/* ---------- Gallery trigger ---------- */
.gallery-item {
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 3px;
  display: block;
  position: relative;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .lightbox-stage {
    max-width: 100vw;
    max-height: calc(100dvh - 60px);
  }

  .lightbox-nav--prev { left: 8px; }
  .lightbox-nav--next { right: 8px; }

  .lightbox-exif__place { font-size: 0.875rem; }

  .lightbox-exif__camera,
  .lightbox-exif__lens,
  .lightbox-exif__datetime {
    font-size: 0.625rem;
  }
}
