/* Scrolling page + galleries below the spatial home.
   Load AFTER style.css (it overrides the fixed, non-scrolling page from style.css). */

/* The page now scrolls vertically. */
html {
  width: 100%;
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  width: 100%;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

/* The existing spatial canvas becomes the first screen. Its far-off sections stay clipped inside this box. */
#spatial-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

/* Small hint at the bottom of the first screen. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 5;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, color 0.2s ease;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  background: #ffffff;
  color: #000000;
  outline: none;
}

/* Galleries */
#galleries {
  position: relative;
  z-index: 2;
  padding: 40px 0 80px;
}

.gallery-section {
  width: min(1500px, 92vw);
  margin: 0 auto 60px;
  scroll-margin-top: 90px;
}

.gallery-box {
  background: rgba(8, 10, 13, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 50px 40px;
  backdrop-filter: blur(4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Masonry-style columns keep every picture's own proportions (posters and square covers together). */
.gallery-grid {
  column-width: 240px;
  column-gap: 16px;
}

.gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
  cursor: zoom-in;
  break-inside: avoid;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-3px);
  border-color: #ffffff;
  outline: none;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox.open {
  display: flex;
}

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

.lightbox-img {
  max-width: 88vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-align: center;
}

.lightbox-btn {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  font-family: var(--font-family);
  border-radius: 999px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  background: #ffffff;
  color: #000000;
  outline: none;
}

.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-close { right: 20px; top: 20px; }

/* Streaming / purchase buttons under the lightbox caption */
.lightbox-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 88vw;
}

.lightbox-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-family);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.lightbox-link.primary {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
}

.lightbox-link:hover,
.lightbox-link:focus-visible {
  background: #ffffff;
  color: #000000;
  outline: none;
}

@media (max-width: 700px) {
  .gallery-box { padding: 30px 18px; }
  .gallery-grid { column-width: 150px; column-gap: 10px; }
  .gallery-item { margin-bottom: 10px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* Releases: the covers are all square, so they sit in rows (left to right, then the next row) instead of columns.
   This keeps the featured covers (galleries/order.json) in the top row. Placements keeps the columns above. */
.gallery-grid[data-gallery="releases"] {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  align-items: start;
}
.gallery-grid[data-gallery="releases"] .gallery-item { margin: 0; }
@media (max-width: 700px) {
  .gallery-grid[data-gallery="releases"] { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

/* Placements: staggered pictures dealt out row by row into columns (js/gallery.js, byRows), so the first ones are on top. */
.gallery-grid.by-rows { columns: auto; display: flex; align-items: flex-start; gap: 16px; }
.gallery-grid.by-rows .gallery-col { flex: 1 1 0; min-width: 0; }
@media (max-width: 700px) {
  .gallery-grid.by-rows { gap: 10px; }
}

/* small print under the Placements gallery */
.gallery-note { margin: 18px 0 0; font-size: 0.7rem; line-height: 1.5; letter-spacing: 0.3px; color: rgba(255, 255, 255, 0.55); text-align: center; }
