/* Styles specific to What We Do gallery page */

/* Page title white background to match About -> "Our Mission" */
.section-header .page-title {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 8px;
  font-size: 1.6rem; /* slightly smaller */
  color: #1a1a1a;
  margin: 0;
  position: relative;
  z-index: 3; /* ensure it sits above .page-bg */
}
.section-header { text-align: center; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  max-width: 1200px; /* ensures max 3 items per row */
  gap: 1rem;
  margin: 1.25rem auto 0;
  align-items: start;
}

/* note: .page-bg from CSS/about.css provides the persistent fade-to-white effect; no white-band needed */
.gallery-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(18,52,71,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* make box width fit media */
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1), box-shadow 0.28s;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(18,52,71,0.10);
}
.gallery-media {
  width: 100%;
  display: block;
  background: #f0f4f8;
  max-height: 220px; /* cap general media height */
}

/* Images: show full image (contain) so thumbnails aren't cropped; videos remain cover-style thumbnails. */
.gallery-item img.gallery-media {
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: 220px; /* keep thumbnails smaller */
}
.gallery-item video.gallery-media {
  object-fit: cover;
  width: 100%;
  height: 140px;
  max-height: 140px;
}
.gallery-item .meta {
  padding: 0.45rem 0.75rem 0.65rem;
}
.gallery-title {
  font-size: 0.98rem;
  color: #16353a;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
}
.gallery-sub {
  font-size: 0.9rem;
  color: #5b7578;
  margin: 0;
}
.gallery-desc {
  display: none; /* replaced by structured meta (title/sub) */
}

/* Lightbox / modal */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3,6,10,0.6);
  z-index: 9999;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox-content {
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(2,8,23,0.5);
  display: flex;
  flex-direction: column;
}
.lightbox-media {
  width: 100%;
  height: 72vh;
  object-fit: contain;
  background: #000;
}
.lightbox-meta {
  padding: 1rem 1.25rem;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

@media (max-width: 900px) {
  .lightbox-media { height: 56vh; }
}

/* semi-transparent white box that sits above hero but below main content */
.white-box {
  /* content container that visually overlaps the hero by using negative margin
     and internal padding. Keeps the gallery interactive while matching About page. */
  position: relative;
  margin-top: 0px; /* reduce overlap */
  padding: 36px 0 24px; /* shrink padding so box is tighter */
  background: rgba(255,255,255,0.96);
  z-index: 1; /* sits above hero (z-index:0) but container (.container) inside uses z-index:2 from about.css, so content remains above */
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
