/* Shared image gallery lightbox — all public hubs */

.gallery-lightbox {
  --gallery-lightbox-backdrop: rgba(5, 8, 11, 0.92);
  --gallery-lightbox-border: rgba(255, 255, 255, 0.14);
  --gallery-lightbox-control-bg: rgba(5, 8, 11, 0.82);
  --gallery-lightbox-text: #f4f7fb;
  --gallery-lightbox-text-dim: rgba(244, 247, 251, 0.65);
  --gallery-lightbox-accent: #ff6b9d;

  padding: 0;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: visible;
}

.gallery-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox::backdrop {
  background: var(--gallery-lightbox-backdrop);
}

.gallery-lightbox__panel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(96vw, 1200px);
  margin: 0;
  padding: 1rem 1.25rem 1.25rem;
}

.gallery-lightbox__figure {
  margin: 0;
  min-width: 0;
  text-align: center;
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: min(84vh, 56rem);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.gallery-lightbox__counter {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gallery-lightbox-text-dim);
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gallery-lightbox-border);
  background: var(--gallery-lightbox-control-bg);
  color: var(--gallery-lightbox-text);
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox__close {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 1;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  border-color: var(--gallery-lightbox-accent);
  color: var(--gallery-lightbox-accent);
  outline: none;
}

.attachment-gallery .attachment-gallery__link {
  cursor: zoom-in;
}

@media (max-width: 640px) {
  .gallery-lightbox__panel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 3.5rem 1rem 1rem;
  }

  .gallery-lightbox__nav {
    display: none;
  }
}
