/* ==========================================================
   Gallery page only. Shared header/nav/background are in site.css.
   ========================================================== */

.gallery-container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.gallery-title {
  font-size: 2rem;
  color: #ffde59;
  text-align: center;
  margin-bottom: 24px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Masonry-style columns: photos of different shapes pack together */
.gallery-grid {
  list-style: none;
  column-count: 3;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  background-color: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.gallery-item a {
  display: block;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease;
}

.gallery-item a:hover img {
  opacity: 0.85;
}

.gallery-item a:focus-visible {
  outline: 3px solid #ffde59;
  outline-offset: -3px;
}

.gallery-item figcaption {
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ddd;
}

@media (max-width: 900px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 560px) {
  .gallery-container {
    padding: 24px 0 40px;
  }

  .gallery-title {
    font-size: 1.6rem;
  }

  .gallery-grid {
    column-count: 1;
  }
}

/* ---------- Click-to-enlarge viewer (built by js/gallery.js) ---------- */
dialog.lightbox {
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
}

dialog.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.94);
}

dialog.lightbox figure {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 56px 20px;
}

dialog.lightbox img {
  max-width: 100%;
  max-height: calc(100% - 44px);
  object-fit: contain;
}

dialog.lightbox figcaption {
  margin-top: 12px;
  min-height: 24px;
  font-size: 0.95rem;
  text-align: center;
  color: #ddd;
}

dialog.lightbox button {
  position: absolute;
  background: rgba(0, 0, 0, 0.6);
  color: #ffde59;
  border: 1px solid rgba(255, 222, 89, 0.5);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

dialog.lightbox button:hover,
dialog.lightbox button:focus-visible {
  background: rgba(255, 222, 89, 0.2);
  outline: none;
}

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

@media (max-width: 560px) {
  dialog.lightbox figure {
    padding: 56px 8px 16px;
  }
}

/* ---------- Gallery page extras ---------- */
.gallery-jump {
  text-align: center;
  margin-bottom: 8px;
  color: #ddd;
}

.gallery-jump a {
  color: #ffde59;
  font-weight: bold;
  text-decoration: none;
  padding: 6px 8px;
}

.gallery-jump a:hover {
  text-decoration: underline;
}

.gallery-heading {
  font-size: 1.4rem;
  color: #ffde59;
  margin: 28px 0 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  scroll-margin-top: 140px; /* clears the pinned header after a jump link */
}

/* Download link shown inside the viewer for press photos */
dialog.lightbox .lb-download {
  margin-top: 6px;
  color: #ffde59;
  font-weight: bold;
  font-size: 0.9rem;
}

dialog.lightbox .lb-download[hidden] {
  display: none;
}

/* Press photos inside the EPK card: same masonry cards as the Gallery */
.press-gallery {
  margin-top: 8px;
}

.press-gallery .gallery-item {
  background-color: #111;
  box-shadow: none;
}

.press-gallery .gallery-item figcaption .dl {
  display: block;
  margin-top: 4px;
  color: #ffde59;
  font-weight: bold;
}

@media (max-width: 560px) {
  .gallery-heading {
    scroll-margin-top: 170px; /* header is taller on phones */
  }
}

/* Photographer credit line under a caption */
.gallery-item figcaption .credit {
  display: block;
  margin-top: 2px;
  font-size: 0.85em;
  opacity: 0.75;
}

/* Featured video at the top of the gallery: 16:9, scales to the page width */
.gallery-video {
  max-width: 800px;
  margin: 0 auto 24px;
}

.gallery-video .video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-video .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-video .video-caption {
  text-align: center;
  margin-top: 10px;
}

.gallery-video .video-caption a {
  color: #ffde59;
  font-weight: bold;
  text-decoration: none;
}

.gallery-video .video-caption a:hover {
  text-decoration: underline;
}
