/* =========================================================================
   Lightbox
   ========================================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.94);
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}
.lightbox[aria-hidden="false"] {
  display: flex;
  animation: lightbox-fade 220ms ease;
}

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

.lightbox__topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.lightbox__btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background var(--transition), border-color var(--transition);
}
.lightbox__btn:hover,
.lightbox__btn:focus-visible {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
}
.lightbox__btn svg { width: 20px; height: 20px; }

.lightbox__stage {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  min-height: 0;
}

.lightbox__nav {
  background: transparent;
  border: 0;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  background: rgba(255,255,255,0.12);
}
.lightbox__nav svg { width: 28px; height: 28px; }

.lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
}
.lightbox__img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.lightbox__img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.lightbox__caption {
  margin-top: 1rem;
  color: #fff;
  text-align: center;
  padding-inline: 1rem;
  max-width: 60ch;
}
.lightbox__title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  margin: 0 0 0.25rem;
}
.lightbox__meta {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

.lightbox__counter {
  margin-right: auto;
  color: rgba(255,255,255,0.7);
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  padding-left: 1rem;
}

/* Share menu */
.lightbox__share {
  position: relative;
}
.share-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.5rem;
  display: grid;
  gap: 0.25rem;
  min-width: 200px;
  z-index: 10;
}
.share-menu[hidden] { display: none; }
.share-menu button,
.share-menu a {
  background: transparent;
  border: 0;
  color: #fff;
  text-align: left;
  font: inherit;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-decoration: none;
  display: block;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.share-menu button:hover,
.share-menu a:hover,
.share-menu button:focus-visible,
.share-menu a:focus-visible {
  background: rgba(255,255,255,0.1);
}
.share-toast {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.share-toast[hidden] { display: none; }

/* Mobile */
@media (max-width: 720px) {
  .lightbox__stage { padding: 0 0.25rem; grid-template-columns: auto 1fr auto; gap: 0; }
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__nav svg { width: 22px; height: 22px; }
  .lightbox__title { font-size: var(--fs-lg); }
}
