/* ════════════════════════════════════
   IMAGE LIGHTBOX
   Full-screen overlay popup for images
   ════════════════════════════════════ */

.media-lightbox {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 1.5rem) env(safe-area-inset-bottom, 1.5rem) env(safe-area-inset-left, 1.5rem);
  box-sizing: border-box;
  z-index: 9999;
  background: rgba(10, 9, 8, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.media-lightbox.open {
  display: flex;
}

.media-lightbox-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

.media-lightbox-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(156, 142, 130, 0.5);
  letter-spacing: 0.06em;
  padding: 0.5rem 0;
  user-select: none;
  pointer-events: none;
}

.media-lightbox-close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 1rem) + 1rem);
  right: calc(env(safe-area-inset-right, 1.5rem) + 1rem);
  background: rgba(22, 19, 16, 0.96);
  border: 1px solid rgba(156, 142, 130, 0.4);
  border-radius: 8px;
  color: #cec9c0;
  font-size: 1.25rem;
  font-family: var(--font-mono);
  cursor: pointer;
  line-height: 1;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  z-index: 10000;
}

.media-lightbox-close:hover {
  color: #fff;
  border-color: rgba(206, 201, 192, 0.7);
  background: rgba(45, 38, 30, 0.98);
}

.media-lightbox-close:active {
  background: rgba(60, 50, 38, 0.98);
}

/* Body scroll lock when lightbox is open */
body.lightbox-active {
  overflow: hidden;
}

/* Clickable image button style */
button.media-img {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
}

button.media-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

button.media-img:hover img {
  opacity: 0.85;
}
