/* Bagmutskiy Lightbox — PhotoSwipe 5 theme. Photo > chrome. */

html.bagmutskiy-lb-open,
html.bagmutskiy-lb-open body {
  overscroll-behavior: none;
}

.pswp {
  --pswp-bg: #0a0a0a;
  --pswp-placeholder-bg: #0a0a0a;
  --pswp-icon-color: #f2f2f2;
  --pswp-icon-color-secondary: #111;
  --pswp-icon-stroke-color: #111;
  --pswp-icon-stroke-width: 1px;
}

.pswp__bg {
  background: #0a0a0a;
  opacity: 0.94;
}

.pswp__top-bar {
  background: transparent;
  opacity: 1;
}

.pswp__counter {
  left: 12px;
  top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 1;
  text-shadow: none;
}

.pswp__button--close {
  margin-right: 4px;
}

.pswp__button--zoom {
  /* Only shown by PS when zoomable */
}

.pswp__button--arrow {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.pswp__button--arrow:hover,
.pswp__button--arrow:focus-visible {
  opacity: 1;
}

@media (max-width: 700px) {
  .pswp__button--arrow {
    /* Swipe is primary; keep for a11y but visually quiet */
    opacity: 0.35;
  }
}

.pswp__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 20px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.pswp__caption[hidden] {
  display: none !important;
}

/* Optional thumbs overlay (long galleries) */
.pswp__button--bag-thumbs {
  /* Match default PS button box — width:auto + emoji caused hover jitter ("ringing"). */
  width: 50px;
  height: 60px;
  padding: 0;
  color: var(--pswp-icon-color, #f2f2f2);
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.pswp__button--bag-thumbs:hover,
.pswp__button--bag-thumbs:focus-visible {
  opacity: 1;
}

.pswp__button--bag-thumbs .pswp__icn {
  /* Same slot as close/zoom icons — no ::before emoji */
  top: 14px;
  left: 9px;
  color: inherit;
  fill: currentColor;
  transform: none !important;
  animation: none !important;
  filter: none !important;
}

.pswp__button--bag-thumbs::before {
  content: none;
}

.bagmutskiy-lb-thumbs {
  display: none;
  position: absolute;
  inset: 48px 12px 12px;
  z-index: 20;
  overflow: auto;
  padding: 12px;
  background: rgba(10, 10, 10, 0.94);
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  align-content: start;
}

html.bagmutskiy-lb-thumbs-open .bagmutskiy-lb-thumbs {
  display: grid;
}

.bagmutskiy-lb-thumb {
  border: 0;
  padding: 0;
  background: #1a1a1a;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
}

.bagmutskiy-lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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