/* Лайтбокс */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,12,20,.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox.is-open { display: flex; animation: lb-fade .18s ease-out; }
@keyframes lb-fade { from { opacity: 0 } to { opacity: 1 } }

.lightbox__inner {
  position: relative;
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  width: auto;
  background: #0f1320;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.lightbox__image {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  border-radius: 8px;
}

.lightbox__caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: .95rem;
  min-height: 1em;
}

.lightbox__close {
  position: absolute !important;
  top: 14px !important;
  right: 18px !important;
  width: 36px !important; 
  height: 36px !important;
  border-radius: 50% !important;
  border: 1px solid var(--border) !important;
  background: #171a27 !important;
  color: #e6e9ef !important;
  cursor: pointer !important;
  font-size: 24px !important;
  line-height: 34px !important;
  text-align: center !important;
  transition: transform .12s ease, background .2s ease !important;
}
    .lightbox__close:hover { transform: scale(1.06); background: #1f2333; }
  /*[hidden] { display: none !important; }*/
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 20px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  z-index: 10000;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s linear 180ms; 
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s;
}

.to-top:focus {
  outline: 2px solid #4c9ffe;
  outline-offset: 2px;
}

.to-top:hover {
  background: #222;
}


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