/* Lightweight, dependency-free lightbox */

:root {
  --lb-overlay: rgba(0, 0, 0, 0.85);
  --lb-surface: rgba(17, 24, 39, 0.9); /* subtle slate */
  --lb-border: rgba(255, 255, 255, 0.18);
  --lb-focus: #4b92db; /* brand-blue */
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: inherit;
  cursor: zoom-in;
}

.lightbox-trigger:focus-visible {
  outline: 3px solid var(--lb-focus);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.lightbox.is-open {
  display: block;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: var(--lb-overlay);
}

/* Dialog container */
.lightbox__dialog {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox__surface {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  background: var(--lb-surface);
  border: 1px solid var(--lb-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.lightbox__img-wrap {
  background: #000;
  display: grid;
  place-items: center;
}

.lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 160px);
  object-fit: contain;
}

.lightbox__caption {
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.9);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  border-top: 1px solid var(--lb-border);
}

.lightbox__btn {
  position: absolute;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--lb-border);
  background: rgba(0, 0, 0, 0.35);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.lightbox__btn:hover {
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

.lightbox__btn:focus-visible {
  outline: 3px solid var(--lb-focus);
  outline-offset: 3px;
}

.lightbox__close {
  right: 10px;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev {
  left: 10px;
}

.lightbox__next {
  right: 10px;
}

.lightbox__hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  user-select: none;
}

/* Prevent background scroll while open */
html.lightbox-open,
body.lightbox-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox__btn {
    transition: none;
  }
}
