﻿/* Лайтбокс MskBro — порт с art-decoupage */
.al-zoomable { cursor: zoom-in; }

html.al-lightbox-open {
  overflow: hidden;
}

.al-lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  background: transparent;
  color: #f7f1e8;
}

.al-lightbox::backdrop {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(55, 40, 28, 0.55), rgba(18, 14, 12, 0.88) 70%);
  backdrop-filter: blur(6px);
}

.al-lightbox__frame {
  position: relative;
  display: grid;
  align-content: center;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  padding: 0.85rem 1.25rem 1.25rem;
  box-sizing: border-box;
}

.al-lightbox__viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(96vw, 1100px);
  min-height: 0;
}

.al-lightbox__zoom {
  position: static;
  top: auto;
  left: auto;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  transform: none;
  padding: 0.2rem 0.35rem;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.al-lightbox__zoom-label {
  color: rgba(247, 241, 232, 0.9);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.al-lightbox__zoom-btn,
.al-lightbox__close {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 252, 248, 0.96);
  color: #3d2e22;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.al-lightbox__zoom-btn:hover:not(:disabled),
.al-lightbox__close:hover {
  background: #fff;
  border-color: var(--mb-accent, #c45c26);
  color: var(--mb-ink, #1a3a4a);
}

.al-lightbox__zoom-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.al-lightbox__close {
  position: absolute;
  top: 0.85rem;
  right: max(0.85rem, env(safe-area-inset-right));
  z-index: 5;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.65rem;
}

.al-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(68vh, 780px);
  max-height: min(68vh, 780px);
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 10px;
  background: transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.al-lightbox.has-thumbs .al-lightbox__stage {
  height: min(64vh, 760px);
  max-height: min(64vh, 760px);
}

.al-lightbox__plane {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.al-lightbox__stage.is-zoomed {
  cursor: grab;
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.al-lightbox__stage.is-zoomed .al-lightbox__plane {
  max-width: none;
  max-height: none;
}

.al-lightbox__stage.is-zoomed.is-panning {
  cursor: grabbing;
  user-select: none;
}

.al-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 780px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
  flex-shrink: 0;
  animation: al-lightbox-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.al-lightbox.has-thumbs .al-lightbox__img {
  max-height: min(64vh, 760px);
}

.al-lightbox__stage.is-zoomed .al-lightbox__img {
  max-width: none;
  max-height: none;
  border-radius: 0;
  /* Shadow expands scrollable overflow and reads as a dark strip beside the photo */
  box-shadow: none;
  animation: none;
}

.al-lightbox__thumbs {
  display: flex;
  gap: 0.45rem;
  max-width: 100%;
  width: auto;
  padding: 0.1rem 0.1rem 0;
  margin: 0.15rem 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: safe center;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.al-lightbox__thumbs[hidden] {
  display: none !important;
}

.al-lightbox__thumb {
  flex: 0 0 auto;
  display: inline-flex;
  margin: 0;
  padding: 0;
  width: 3.35rem;
  height: 3.35rem;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 248, 0.12);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.al-lightbox__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.al-lightbox__thumb:hover {
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}

.al-lightbox__thumb.is-active {
  border-color: var(--mb-accent, #c45c26);
  box-shadow: 0 0 0 1px var(--mb-accent, #c45c26), 0 6px 16px rgba(0, 0, 0, 0.28);
}

@keyframes al-lightbox-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.al-lightbox__caption,
.al-lightbox__counter {
  margin: 0;
  max-width: min(40rem, 90vw);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(247, 241, 232, 0.82);
  text-wrap: balance;
}

.al-lightbox__caption {
  margin-top: 0.15rem;
}

.al-lightbox__counter {
  margin-top: -0.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(247, 241, 232, 0.55);
}

.al-lightbox__close,
.al-lightbox__nav {
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 252, 248, 0.94);
  color: #3d2e22;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.al-lightbox__close:hover,
.al-lightbox__nav:hover {
  background: #fff;
  border-color: var(--mb-accent, #c45c26);
  color: var(--mb-ink, #1a3a4a);
}

.al-lightbox__close {
  font-size: 1.65rem;
  line-height: 1;
}

.al-lightbox__close span {
  display: block;
  transform: translateY(-0.05em);
}

.al-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.85rem;
  line-height: 1;
  transform: translateY(-50%);
}

.al-lightbox__nav[hidden] {
  display: none !important;
}

.al-lightbox__nav span {
  display: block;
  line-height: 1;
}

.al-lightbox__nav--prev {
  left: max(0.75rem, env(safe-area-inset-left));
}

.al-lightbox__nav--next {
  right: max(0.75rem, env(safe-area-inset-right));
}

.al-lightbox__nav--prev span {
  transform: translate(-0.04em, -0.06em);
}

.al-lightbox__nav--next span {
  transform: translate(0.02em, -0.06em);
}
