/* =========================================================
   Лайтбокс и кликабельные скриншоты кейсов
   ========================================================= */

/* --- обёртка вокруг картинки кейса --- */
.case__media { position: relative; overflow: hidden; }

.case__zoom {
  display: block;
  position: relative;
  cursor: zoom-in;
  color: inherit;
}
.case__zoom img {
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .3s ease;
}
.case__zoom:hover img,
.case__zoom:focus-visible img { transform: scale(1.035); }

/* подсказка «Открыть крупно» */
.case__zoom-hint {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.94);
  opacity: 0;
  pointer-events: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(12, 10, 24, .72);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
  transition: opacity .22s ease, transform .22s ease;
  white-space: nowrap;
  z-index: 2;
}
.case__zoom:hover .case__zoom-hint,
.case__zoom:focus-visible .case__zoom-hint {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.case__zoom::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8, 13, 23, .45));
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.case__zoom:hover::after,
.case__zoom:focus-visible::after { opacity: 1; }

/* лёгкая рамка при наведении, чтобы читалось «кликабельно» */
.case__zoom::before {
  content: "";
  position: absolute; inset: 0;
  border: 2px solid var(--accent);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 3;
}
.case__zoom:hover::before,
.case__zoom:focus-visible::before { opacity: .55; }

/* =========================================================
   Лайтбокс
   ========================================================= */
.lb {
  position: fixed; inset: 0;
  z-index: 12000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 16, .92);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.lb.is-open { opacity: 1; visibility: visible; }

.lb__figure {
  margin: 0;
  max-width: min(1600px, 96vw);
  max-height: 90vh;
  display: flex; flex-direction: column;
  gap: 12px;
}

.lb__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto; height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .6);
  background: #fff;
}

.lb__caption {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  font-family: var(--mono);
  font-size: .82rem;
  color: rgba(255, 255, 255, .82);
  padding: 0 4px;
}
.lb__count { color: rgba(255, 255, 255, .5); white-space: nowrap; }

.lb__close,
.lb__nav {
  position: absolute;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
  backdrop-filter: blur(6px);
}
.lb__close:hover,
.lb__nav:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); }

.lb__close { top: 22px; right: 22px; font-size: 1.1rem; }
.lb__nav--prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb__nav--next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb__nav--prev:hover { transform: translateY(-50%) scale(1.06); }
.lb__nav--next:hover { transform: translateY(-50%) scale(1.06); }

@media (max-width: 760px) {
  .lb { padding: 12px; }
  .lb__img { max-height: 70vh; border-radius: 8px; }
  .lb__close { top: 10px; right: 10px; width: 44px; height: 44px; }
  .lb__nav { width: 44px; height: 44px; font-size: 1.3rem; }
  .lb__nav--prev { left: 8px; }
  .lb__nav--next { right: 8px; }
  .lb__caption { font-size: .74rem; gap: 10px; }
  .case__zoom-hint { display: none; }
}

@media print {
  .lb, .case__zoom-hint { display: none !important; }
  .case__zoom::before, .case__zoom::after { display: none; }
}
