/* ==========================================================================
   RESEARCH FACILITIES - PHOTO GALLERY
   --------------------------------------------------------------------------
   Standalone component, only linked from research_facilities.html.
   Intentionally namespaced "facgal-" so it can never collide with the
   existing video slideshow on this same page (.proto-*, #facility*) or
   with the prototypes.html slideshow it was originally modeled on.

   Behaviour (all driven by facilities-gallery.js):
   - Auto-scrolls on its own, pauses on hover / touch / focus
   - No visible arrow buttons - the left ~40% and right ~40% of the
     photo itself are click targets for prev/next
   - Caption sits BELOW the photo, not overlaid on it
   - Slow "Ken Burns" zoom drift on the active photo while it's showing
   ========================================================================== */

.facgal-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.facgal-heading {
  font-size: 32px;
  font-weight: bold;
  margin: 1.2rem 0 0.35rem;
  text-transform: capitalize;
  color: var(--brand-navy);
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.15rem;
  text-align: center;
}

.facgal-subheading {
  text-align: center;
  font-family: "Open Sans", sans-serif;
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.facgal-wrapper {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  background: #0d1526;
}

.facgal-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(450px, 52vh);
  overflow: hidden;
}

.facgal-track {
  display: flex;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.65, 0, 0.35, 1);
}

.facgal-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090e1a;
}

.facgal-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Invisible left/right click zones over the photo - no arrow icons,
   just a subtle cursor + very light hover tint so it's still discoverable. */
.facgal-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  cursor: pointer;
  background: linear-gradient(90deg, rgba(0,0,0,0.16), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.facgal-hit-left {
  left: 0;
}

.facgal-hit-right {
  right: 0;
  background: linear-gradient(270deg, rgba(0,0,0,0.16), rgba(0,0,0,0));
}

.facgal-viewport:hover .facgal-hit {
  opacity: 1;
}

.facgal-hit::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  opacity: 0.9;
}

.facgal-hit-left::after {
  left: 22px;
  transform: translateY(-50%) rotate(-135deg);
}

.facgal-hit-right::after {
  right: 22px;
  transform: translateY(-50%) rotate(45deg);
}

/* Progress bar for the autoplay timer - fills up, resets each slide */
.facgal-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.18);
  z-index: 4;
}

.facgal-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--brand-blue-light, #6fb3ff);
}

.facgal-progress-bar.animating {
  transition: width linear;
}

.facgal-caption {
  padding: 12px 20px 14px;
  background: #fff;
  text-align: center;
}

.facgal-caption h3 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  color: var(--brand-navy);
  margin: 0 0 4px;
  font-size: 1.12rem;
}

.facgal-caption p {
  font-family: "Open Sans", sans-serif;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.facgal-dots-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.facgal-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand-border);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.facgal-dot:hover {
  background: var(--brand-blue-light);
}

.facgal-dot.active {
  background: var(--brand-navy);
  transform: scale(1.25);
}

/* Small phones */
@media screen and (max-width: 480px) {
  .facgal-container {
    padding: 0 3%;
  }
  .facgal-caption h3 {
    font-size: 0.95rem;
  }
  .facgal-caption p {
    font-size: 0.8rem;
  }
  .facgal-hit::after {
    width: 10px;
    height: 10px;
  }
}

/* Large desktop screens */
@media screen and (min-width: 1400px) {
  .facgal-heading {
    font-size: 2.3rem;
  }
  .facgal-wrapper {
    max-width: 860px;
  }
  .facgal-caption h3 {
    font-size: 1.25rem;
  }
  .facgal-caption p {
    font-size: 0.94rem;
  }
}

/* ==========================================================================
   FACILITIES OVERVIEW GRID
   ========================================================================== */
.fac-grid-heading {
  font-size: 32px;
  font-weight: 700;
  margin: 4rem 0 1rem;
  color: var(--brand-navy, #0d3b66);
  font-family: "Poppins", sans-serif;
  text-align: center;
  letter-spacing: 0.05rem;
}

.fac-grid-subheading {
  text-align: center;
  font-family: "Open Sans", sans-serif;
  color: var(--text-muted, #64748b);
  margin: 0 0 2.5rem;
  font-size: 1rem;
}

.fac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 5rem;
}

.fac-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #eef2f6;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.fac-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(13, 59, 102, 0.14);
}

.fac-card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0d1526;
  position: relative;
}

.fac-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  display: block;
}

.fac-card:hover .fac-card-img-wrap img {
  transform: scale(1.06);
}

.fac-card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fac-card-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--brand-navy, #0d3b66);
  margin: 0 0 10px;
  line-height: 1.4;
}

.fac-card-desc {
  font-family: "Open Sans", sans-serif;
  font-size: 0.92rem;
  color: var(--text-muted, #556987);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.fac-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1f7a8c;
  font-family: "Poppins", sans-serif;
  transition: transform 0.2s ease;
}

.fac-card:hover .fac-card-badge {
  transform: translateX(4px);
}

@media screen and (max-width: 768px) {
  .fac-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .fac-grid-heading {
    font-size: 26px;
  }
}

