/* Просмотр картинок галереи во весь экран. Подключается вместе с js/lightbox.js. */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px 76px;
  background: rgba(26, 18, 18, .88);
  backdrop-filter: blur(2px);
}
.lightbox.is-open { display: flex; }

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .55);
  animation: lightbox-in .2s ease;
}
@keyframes lightbox-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.lightbox-caption {
  max-width: 900px;
  color: #F4EDE6;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}
.lightbox-counter {
  display: block;
  margin-top: 4px;
  color: #C9BDB4;
  font-size: 13px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent center / contain no-repeat;
}
.lightbox-close {
  top: 14px;
  right: 18px;
  width: 40px;
  height: 40px;
  color: #F4EDE6;
  font-size: 30px;
  line-height: 1;
  border-radius: 50%;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .14); }

.lightbox-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
  text-indent: -9999px;
  opacity: .92;
  transition: transform .15s;
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.06); opacity: 1; }
.lightbox-prev { left: 14px; background-image: url('../Главная страница/стрелка влево.png'); }
.lightbox-next { right: 14px; background-image: url('../Главная страница/стрелка вправо.png'); }
.lightbox.single .lightbox-nav { display: none; }

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible { outline: 2px solid #F0E2D6; outline-offset: 3px; }

/* превью в сетке — видно, что по картинке можно кликнуть */
.gallery-grid img:focus-visible { outline: 2px solid #7c3a00; outline-offset: 2px; }

body.lightbox-open { overflow: hidden; }

@media (max-width: 760px) {
  .lightbox { padding: 52px 12px 68px; }
  .lightbox-image { max-height: calc(100vh - 170px); }
  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}
