/* ============ GALLERY PAGE ============
   Extends style.css — shared variables, fonts, header, footer.
   This file only holds gallery-specific layout. */

.gallery-page .site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-active {
  color: var(--gold-deep);
  position: relative;
}
.nav-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--gold);
}

.gallery-main {
  position: relative;
  z-index: 2;
  padding: 12rem 7vw 6rem;
  max-width: 1440px;
  margin: 0 auto;
}

.gallery-hero {
  max-width: 42vw;
  margin-bottom: 5rem;
}
.gallery-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 4.6vw, 4.6rem);
  line-height: 1.05;
  color: var(--ink);
  margin: 0.9rem 0 1.2rem;
}
.gallery-tagline {
  max-width: 100%;
  font-size: clamp(1rem, 1.1vw, 1.1rem);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.gallery-item {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--hairline);
  background: var(--white);
  overflow: hidden;
}
.gallery-item--square { aspect-ratio: 4 / 5; }

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.gallery-item:hover img { transform: scale(1.045); }

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0) 48%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}
.gallery-item:hover::after { opacity: 1; }

.gallery-caption {
  position: absolute;
  left: 1.2rem;
  bottom: 1.1rem;
  z-index: 2;
  color: var(--white);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .gallery-main { padding: 9rem 6vw 4rem; }
  .gallery-hero { max-width: 100%; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 7, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  position: relative;
  max-width: 78vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0;
}
.lightbox-figure img {
  max-width: 78vw;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  opacity: 1;
  transform: translateX(0) scale(1);
  transition: opacity 0.32s var(--ease), transform 0.38s var(--ease);
}
.lightbox-img--out-left  { opacity: 0; transform: translateX(-32px) scale(0.98); }
.lightbox-img--out-right { opacity: 0; transform: translateX(32px) scale(0.98); }
.lightbox-img--in-left   { animation: lb-in-left 0.38s var(--ease); }
.lightbox-img--in-right  { animation: lb-in-right 0.38s var(--ease); }
@keyframes lb-in-left {
  from { opacity: 0; transform: translateX(-32px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes lb-in-right {
  from { opacity: 0; transform: translateX(32px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

figcaption#lightbox-caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0.9;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(212, 185, 118, 0.35);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-light);
  cursor: pointer;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
  z-index: 501;
}
.lightbox-close svg,
.lightbox-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  transform: scale(1.08);
}
.lightbox-nav:active { transform: scale(0.96); }

.lightbox-close {
  top: 2.2rem;
  right: 2.2rem;
}
.lightbox-prev { left: 2.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 2.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-prev:active { transform: translateY(-50%) scale(0.96); }
.lightbox-next:active { transform: translateY(-50%) scale(0.96); }

/* gentle idle pulse so the nav buttons read as interactive on load */
.lightbox--open .lightbox-prev,
.lightbox--open .lightbox-next {
  animation: lb-nav-in 0.5s var(--ease) 0.1s backwards;
}
.lightbox--open .lightbox-close {
  animation: lb-close-in 0.5s var(--ease) 0.1s backwards;
}
@keyframes lb-nav-in {
  from { opacity: 0; transform: translateY(-50%) scale(0.7); }
  to   { opacity: 1; transform: translateY(-50%) scale(1); }
}
@keyframes lb-close-in {
  from { opacity: 0; transform: scale(0.7) rotate(-45deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@media (max-width: 700px) {
  .lightbox-figure { max-width: 92vw; max-height: 70vh; }
  .lightbox-figure img { max-width: 92vw; max-height: 62vh; }
  .lightbox-close, .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-close { top: 1.2rem; right: 1.2rem; }
  .lightbox-prev { left: 0.6rem; }
  .lightbox-next { right: 0.6rem; }
}
