@import url('../styles.css');
.gallery-home { position:fixed; top:28px; left:30px; z-index:20; color:var(--gold); text-decoration:none; text-transform:uppercase; letter-spacing:.2em; font-size:.7rem; }


/* V3 gallery refinement: descriptions replace the former metadata accent. */
.gallery-intro {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .25em;
  font-size: .7rem;
  line-height: 1.7;
  margin-top: 14px;
}

/* V3 TYPOGRAPHY SYSTEM — GALLERY SUBTEXT */
.gallery-subtext {
  color: var(--gold);
  font-family: Montserrat, Arial, sans-serif;
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .25em;
  text-transform: uppercase;
  margin-top: 14px;
}



/* =========================================================
   V3 EXPERIMENT — EDITORIAL MASONRY GALLERY
   Preserves every photograph's native aspect ratio.
   ========================================================= */
.gallery-page {
  width: 96vw;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.masonry-gallery {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  column-width: 300px;
  column-gap: 14px;
}

.masonry-gallery button {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  break-inside: avoid;
  vertical-align: top;
  overflow: hidden;
}

.masonry-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  transform: none;
  transition: opacity .35s ease, transform .45s ease;
}

.masonry-gallery button:hover img {
  opacity: .88;
  transform: scale(1.012);
}



@media (max-width: 820px) {
  .gallery-page {
    width: 94vw;
  }

  .masonry-gallery {
    column-width: 240px;
    column-gap: 10px;
  }

  .masonry-gallery button {
    margin-bottom: 10px;
  }
}

@media (max-width: 520px) {
  .masonry-gallery {
    width: 100%;
    columns: 2;
    column-width: auto;
    column-gap: 8px;
  }

  .masonry-gallery button {
    margin-bottom: 8px;
  }
}


/* =========================================================
   V4 PHOTO TITLES + CAPTIONS
   Desktop: elegant lower-third hover overlay.
   Mobile/touch: grid stays clean; metadata appears in lightbox.
   ========================================================= */
.masonry-gallery button {
  position: relative;
  cursor: pointer;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 22px 20px;
  box-sizing: border-box;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.28) 38%, rgba(0,0,0,0) 68%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.photo-overlay-title,
.photo-overlay-caption {
  transform: translateY(8px);
  transition: transform .35s ease;
}

.photo-overlay-title {
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(.9rem, 1.1vw, 1.15rem);
  line-height: 1.25;
  letter-spacing: .04em;
  color: #fff;
}

.photo-overlay-caption {
  margin-top: 7px;
  font-family: Montserrat, Arial, sans-serif;
  font-size: .62rem;
  line-height: 1.45;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.masonry-gallery button:hover .photo-overlay,
.masonry-gallery button:focus-visible .photo-overlay {
  opacity: 1;
}

.masonry-gallery button:hover .photo-overlay-title,
.masonry-gallery button:hover .photo-overlay-caption,
.masonry-gallery button:focus-visible .photo-overlay-title,
.masonry-gallery button:focus-visible .photo-overlay-caption {
  transform: translateY(0);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(88vw, 1400px);
  max-height: 90vh;
}

.lightbox-content > img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 76px);
  object-fit: contain;
}

.lightbox-copy {
  width: 100%;
  box-sizing: border-box;
  padding-top: 13px;
  text-align: center;
}

.lightbox-title {
  font-family: Cinzel, Georgia, serif;
  font-size: .95rem;
  letter-spacing: .05em;
  color: #fff;
}

.lightbox-caption {
  margin-top: 5px;
  font-family: Montserrat, Arial, sans-serif;
  font-size: .62rem;
  line-height: 1.45;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.lightbox-title:empty,
.lightbox-caption:empty,
.lightbox-copy:has(.lightbox-title:empty):has(.lightbox-caption:empty) {
  display: none;
}


/* Photos with no title and no caption remain completely clean on hover. */
.masonry-gallery button:not(.has-metadata) .photo-overlay {
  display: none;
}

@media (hover: none), (max-width: 520px) {
  .photo-overlay { display: none; }
}
