/**
 * Footer and global overlays (lightbox, toast, back-to-top)
 */
.site-footer {
  /*border-top: 1px solid rgba(255, 255, 255, 0.05);*/
  padding-top: 20px;
  padding-bottom: 32px;
  background: transparent
}

.site-footer__inner {
  text-align: center;
}

.site-footer__text {
  font-size: 12px;
  color: #737373;
  margin-top: 12px;
  cursor: default;
  }

.site-footer__legal {
  margin-top: 12px;
  cursor: default;
  }

.site-footer__copy {
  margin-top: 12px;
  font-size: 12px;
  color: #737373;
  cursor: default;
  }

.site-footer__link {
  font-size: 12px;
  color: #737373;
  text-decoration: none;
  transition: color 0.3s;
  cursor: pointer;
}

.site-footer__version {
  margin-top: 12px;
  font-size: 12px;
  color: transparent;
  cursor: default;
  }

.site-footer__version::selection,
.site-footer__version::-moz-selection {
  color: #737373;
  }

.site-footer__link:hover {
  color: #a3a3a3;
}

.site-footer__sep {
  margin: 0 8px;
  color: #404040;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 12px;
  background: #0f0f0f;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 14px;
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 30, 30, 0.9);
  transform: translateY(-3px);
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox img {
  max-width: 100%;
  max-height: calc(85vh - 3rem);
  border-radius: 8px;
  object-fit: contain;
  transition: opacity 0.2s;
  cursor: zoom-out;
  touch-action: pan-y pinch-zoom;
}

.lightbox.has-nav img {
  touch-action: pan-x pan-y pinch-zoom;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.lightbox-caption {
  margin-top: 12px;
  font-family: 'PT Serif', serif;
  font-size: 18px;
  line-height: 1.4;
  color: #a3a3a3;
  text-align: center;
  overflow-wrap: anywhere; /* длинные слова переносятся, а не растягивают подпись */
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-video {
  display: none;
  width: 100%;
  max-width: min(90vw, 960px);
  max-height: calc(85vh - 3rem);
  border-radius: 8px;
  background: #000;
}

.lightbox.is-video .lightbox-video {
  display: block;
}

.lightbox.is-video #lightboxImg {
  display: none;
}

/* В режиме видео подпись не должна быть шире самого видео */
.lightbox.is-video .lightbox-caption {
  max-width: min(90vw, 960px);
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .lightbox,
  .lightbox img {
    cursor: pointer;
  }
}

/* Не показывать кнопку «Наверх», когда открыт лайтбокс (она видна только на основной странице раздела) */
body:has(.lightbox.open) .back-to-top {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
