.gallery-main h1 {
  margin-top: 18px;
}

.gallery-main h1 span {
  display: block;
  margin-top: .25em;
  color: #e3c590;
  font-size: .44em;
}

.gallery-main h2 {
  margin: 0 0 14px;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.gallery-return {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-underline-offset: .25em;
}

.gallery-main video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 65svh;
  background: #000;
}

.gallery-trailer,
.gallery-backstage-video {
  max-width: 920px;
  margin: 0 0 clamp(24px, 6vw, 60px);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 16px);
  margin-bottom: 24px;
}

.gallery-photo {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: #201e1a;
  aspect-ratio: 3 / 2;
  cursor: zoom-in;
}

.gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .24s ease;
}

.gallery-photo:hover img {
  transform: scale(1.04);
}

body.lightbox-active {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #080807;
  color: var(--cream);
}

.gallery-lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.gallery-lightbox::backdrop {
  background: #080807;
}

.lightbox-viewport {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 70px clamp(10px, 4vw, 50px) 12px;
  overflow: hidden;
}

.lightbox-viewport img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox-viewport.is-zoomed {
  display: block;
  overflow: auto;
}

.lightbox-viewport.is-zoomed img {
  width: 175%;
  height: auto;
  max-width: none;
}

.lightbox-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 6px 15px max(12px, env(safe-area-inset-bottom));
}

.lightbox-tools button,
.close-lightbox {
  min-width: 48px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 25px;
  color: inherit;
  background: #201e1a;
  cursor: pointer;
}

.lightbox-tools button:hover,
.close-lightbox:hover {
  border-color: #e3c590;
}

.lightbox-tools span {
  font-size: 1.6rem;
}

[dir="rtl"] .lightbox-tools span {
  display: inline-block;
  transform: scaleX(-1);
}

.close-lightbox {
  position: absolute;
  z-index: 1;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
}

.close-lightbox span {
  position: relative;
  width: 22px;
  height: 22px;
  animation: close-enter .25s ease-out both;
  transition: transform .22s ease;
}

.close-lightbox span::before,
.close-lightbox span::after {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
}

.close-lightbox span::after {
  transform: rotate(-45deg);
}

.close-lightbox:hover span,
.close-lightbox:focus-visible span {
  transform: rotate(90deg);
}

@keyframes close-enter {
  from { opacity: 0; rotate: -45deg; }
  to { opacity: 1; rotate: 0deg; }
}

@media (max-width: 680px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .close-lightbox span,
  .gallery-photo img {
    animation: none;
    transition: none;
  }
}
