/* ------------------------------- photo viewer ----------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #030408;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

body.lightbox-open {
  overflow: hidden;
}

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

.lightbox-figure {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.lightbox-swiper,
.lightbox-swiper .swiper-wrapper,
.lightbox-slide {
  width: 100%;
  height: 100%;
}

.lightbox-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slide .swiper-zoom-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox-slide .swiper-zoom-container > .lightbox-image {
  width: auto;
  height: auto;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3vw, 28px);
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px 14px;
  max-width: min(720px, calc(100vw - 140px));
  padding: 9px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
}

.lightbox-count {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lightbox-caption > [data-lightbox-caption] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-pagination {
  position: static !important;
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto !important;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

.lightbox-pagination[hidden] {
  display: none;
}

.lightbox-pagination .swiper-pagination-bullet {
  width: 7px;
  height: 7px;
  margin: 0 !important;
  border-radius: 50%;
  background: var(--ink-4);
  opacity: 0.6;
  transition: background-color 0.18s ease, opacity 0.18s ease;
}

.lightbox-pagination .swiper-pagination-bullet-active {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 10px rgba(138, 180, 248, 0.6);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.94);
  color: var(--accent-lift);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease,
    opacity 0.18s ease, transform 0.18s var(--ease);
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover:not(.swiper-button-disabled),
.lightbox-nav:focus-visible {
  color: #050505;
  background: var(--accent);
  border-color: var(--accent);
}

.lightbox-close {
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
}

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

.lightbox-nav:hover:not(.swiper-button-disabled),
.lightbox-nav:focus-visible {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-nav.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
}

.lightbox-prev {
  left: clamp(16px, 3vw, 28px);
}

.lightbox-next {
  right: clamp(16px, 3vw, 28px);
}

/* trigger on the "screenshot of the month" card */
.shot-open {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #050505;
  cursor: zoom-in;
}

.shot-open img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  transition: filter 0.25s ease, transform 0.35s var(--ease);
}

.shot-open:hover img,
.shot-open:focus-visible img {
  filter: saturate(1) contrast(1.03) brightness(1);
  transform: scale(1.015);
}

.shot-open::after {
  content: "Развернуть ↗";
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 11px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(5, 5, 5, 0.88);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-lift);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
  pointer-events: none;
}

.shot-open:hover::after,
.shot-open:focus-visible::after {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .shot-open img,
  .shot-open::after {
    transition: none;
  }
}
