/* Loaded by Banner Design and SNS Design only. */
.gallery-lightbox {
  width: max-content;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 20px);
  margin: auto;
  padding: 48px clamp(8px, 2vw, 24px) 18px;
  border: 0;
  border-radius: 14px;
  background: rgba(33, 38, 55, .96);
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  overflow: hidden;
}

.gallery-lightbox[open] {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  column-gap: clamp(4px, 1vw, 12px);
  animation: lightbox-appear .2s ease-out both;
}

.gallery-lightbox::backdrop { background: rgba(12, 16, 29, .78); }

.lightbox-image {
  display: block;
  grid-column: 2;
  grid-row: 1;
  width: auto;
  height: auto;
  max-width: min(1200px, calc(100vw - 136px));
  max-height: calc(100dvh - 132px);
  object-fit: contain;
  cursor: zoom-out;
}

.gallery-lightbox button {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, .13);
  cursor: pointer;
}

.gallery-lightbox button:hover { background: rgba(255, 255, 255, .25); }

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  width: 40px;
  height: 48px;
  border-radius: 8px;
  font-size: 32px;
  line-height: 1;
}

.lightbox-prev { grid-column: 1; grid-row: 1; }
.lightbox-next { grid-column: 3; grid-row: 1; }
.gallery-lightbox button[hidden] { display: none; }

.lightbox-caption {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

@keyframes lightbox-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .gallery-lightbox[open] {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
  }
  .lightbox-image {
    max-width: calc(100vw - 100px);
    max-height: calc(100dvh - 110px);
  }
  .lightbox-prev,
  .lightbox-next { width: 32px; height: 44px; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-lightbox[open] { animation: none; }
}
