/* =========================================
   GALLERY PAGE STYLES
   ========================================= */

/* Gallery Sections */
.gallery-section { padding: 72px 0; }

.gallery-section-header {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-section-header h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  color: var(--charcoal);
  margin-bottom: 10px;
}

.gallery-section-header p {
  font-size: 16px;
  color: var(--text-light);
  max-width: 560px;
  margin: 0 auto;
}

/* Setup Photos */
.setup-photos {
  display: flex;
  flex-direction: row;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.setup-photos .photo-item {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.setup-photos .photo-item img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 2-Column Photo Grid */
.photo-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--medium-gray);
}

.photo-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.photo-item:hover img { transform: scale(1.04); }

.photo-item::after {
  content: '🔍';
  position: absolute;
  inset: 0;
  background: rgba(44, 62, 80, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover::after { opacity: 1; }

/* Single photo (odd-numbered final item) */
.photo-item-single {
  grid-column: 1 / -1;
  max-width: 50%;
  margin: 0 auto;
}

/* Gallery CTA Section */
.gallery-cta {
  padding: 80px 24px;
  text-align: center;
}

.gallery-cta h2 { color: var(--white); font-size: clamp(26px, 4vw, 40px); margin-bottom: 16px; }
.gallery-cta p { color: rgba(255,255,255,0.7); font-size: 17px; margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* Lightbox — centered overlay, image always fits in viewport.
   Sizing math: lightbox vertical padding (76 top + 40 bottom = 116px) +
   caption (~18px) + hint (~16px) + two 10px gaps = ~170px of chrome.
   Image max-height must reserve at least that much, plus a small safety
   margin so portrait shots aren't clipped at the bottom on any screen. */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 2000;
  /* sides: 80px clear the prev/next arrows; top: 76px clears the close button */
  padding: 76px 80px 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox.open { display: flex; }

.lightbox-img-wrap {
  margin: 0 auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lightbox-img-wrap img {
  max-width: 100%;
  /* 76 top padding + 40 bottom padding + 10 gap + ~18 caption + 10 gap + ~16 hint
     = ~170px; round up to 200px to guarantee headroom on every device. */
  max-height: calc(100dvh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.lightbox-caption {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  text-align: center;
}

.lightbox-hint {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  text-align: center;
}

/* Close button — always fixed in top-right, visible no matter how far you scroll */
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  color: var(--white);
  font-size: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus { background: rgba(255,255,255,0.3); outline: none; }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 36px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2001;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.2); }

/* Setup Videos */
.setup-videos {
  margin-top: 40px;
}

.setup-video-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--charcoal);
  margin-bottom: 20px;
  text-align: center;
}

/* Video Section */
.gallery-section-header.light h2 { color: var(--white); }
.gallery-section-header.light p { color: rgba(255,255,255,0.7); }

.video-category { margin-bottom: 48px; }
.video-category:last-child { margin-bottom: 0; }

.video-category-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--white);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  position: relative;
  cursor: pointer;
}

.video-wrap video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  pointer-events: none; /* clicks go to the wrap, not the native controls */
}

/* Play button circle */
.video-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0,0,0,0.6);
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  transition: background 0.2s, transform 0.2s;
}

/* Play triangle arrow */
.video-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid white;
  z-index: 3;
  pointer-events: none;
}

.video-wrap:hover::before {
  background: rgba(0,0,0,0.85);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video lightbox */
.video-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 2000;
  padding: 76px 20px 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-lightbox.open { display: flex; }

.video-lightbox-wrap {
  margin: 0 auto;
  width: 100%;
  max-width: 960px;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.video-lightbox-wrap video {
  width: 100%;
  /* same headroom math as the photo lightbox; use dvh so mobile URL-bar
     chrome doesn't push the bottom of the video below the viewport */
  max-height: calc(100dvh - 200px);
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
}

@media (max-width: 768px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-section { padding: 48px 0; }
  .photo-grid-2 { gap: 10px; }
  .photo-item-single { max-width: 100%; }
  .lightbox { padding: 68px 56px 32px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-prev, .lightbox-next { width: 42px; height: 42px; font-size: 28px; }
  .setup-photos { flex-direction: column; }
  .setup-photos .photo-item img { height: 300px; }
}

@media (max-width: 480px) {
  .photo-grid-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
}
