.maso-lb {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 72px 64px 28px;
  /* Frosted glass: blur + near-white wash so page colors don't bleed through */
  background: rgb(255 255 255 / 72%);
  backdrop-filter: blur(40px) saturate(1);
  -webkit-backdrop-filter: blur(40px) saturate(1);
  animation: maso-lb-fade 0.28s ease;
}

.maso-lb[hidden] {
  display: none !important;
}

@keyframes maso-lb-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.maso-lb__stage {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(92vw, 1040px);
  max-height: calc(85vh - 80px);
  min-height: 0;
  pointer-events: none;
}

.maso-lb__img {
  display: block;
  max-width: 100%;
  max-height: calc(85vh - 80px);
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 18%);
  opacity: 0;
  transform: scale(0.98);
  pointer-events: auto;
}

.maso-lb__img--in {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.maso-lb__close,
.maso-lb__nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 55%);
  color: #001026;
  cursor: pointer;
  transition: background-color 0.2s ease;
  backdrop-filter: blur(8px);
}

.maso-lb__close:hover,
.maso-lb__nav:hover {
  background: rgb(255 255 255 / 85%);
}

.maso-lb__close {
  top: 16px;
  left: 16px;
  width: 48px;
  height: 48px;
}

.maso-lb__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}

.maso-lb__prev {
  right: 16px;
}

.maso-lb__next {
  left: 16px;
}

.maso-lb__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(92vw, 720px);
  z-index: 2;
}

.maso-lb__counter {
  margin: 0;
  color: rgb(0 16 38 / 70%);
  font-size: 14px;
}

.maso-lb__thumbs {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 100%;
  overflow-x: auto;
}

.maso-lb__thumbs button {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: rgb(255 255 255 / 45%);
  cursor: pointer;
  opacity: 0.55;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.maso-lb__thumbs button.is-active,
.maso-lb__thumbs button:hover {
  opacity: 1;
  border-color: rgb(0 16 38 / 55%);
}

.maso-lb__thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.maso-lb-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .maso-lb {
    padding: 64px 12px 20px;
  }

  .maso-lb__nav {
    width: 44px;
    height: 44px;
  }

  .maso-lb__prev {
    right: 8px;
  }

  .maso-lb__next {
    left: 8px;
  }
}
