/* ================================================================
   gallery.css — Photo Gallery for Institute of Nursing Islamia Hospital
   Matches site palette from style.css + enhance.css.
   Load AFTER enhance.css.
   ================================================================ */

/* ── GALLERY SECTION ─────────────────────────────────────────── */

.gallery-section {
  padding: 60px 0 70px;
}

.gallery-intro {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-intro h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: #003e7d;
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
  padding-bottom: 16px;
}

.gallery-intro h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 55px;
  height: 3px;
  background: linear-gradient(90deg, #003e7d, #0586ee);
  border-radius: 3px;
}

.gallery-intro p {
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  color: #4a5568;
  margin-top: 14px;
}

/* ── GALLERY GRID ────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

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

/* ── GALLERY ITEM ────────────────────────────────────────────── */

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #001230;
  box-shadow:
    0 2px 0 rgba(0, 62, 125, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 4px 0 rgba(0, 62, 125, 0.14),
    0 12px 36px rgba(0, 0, 0, 0.22);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.75);
}

/* Overlay with zoom icon */
.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0, 18, 60, 0.45);
  transition: opacity 0.28s ease;
  border-radius: 10px;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay .zoom-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  transition: background 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-item:hover .zoom-icon {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.12);
}

/* Image counter badge */
.gallery-item .gallery-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 62, 125, 0.75);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  letter-spacing: 0.4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.gallery-item:hover .gallery-num {
  opacity: 1;
  transform: translateY(0);
}

/* ── LIGHTBOX MODAL ──────────────────────────────────────────── */

.gl-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 8, 28, 0.94);
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gl-overlay.gl-open {
  display: flex;
}

/* Image wrapper */
.gl-image-wrap {
  position: relative;
  max-width: 88vw;
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: glFadeIn 0.28s ease;
}

@keyframes glFadeIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.gl-image-wrap img {
  max-width: 88vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  display: block;
}

/* Close button */
.gl-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9600;
  transition: background 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.gl-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg) scale(1.1);
}

/* Prev / Next nav buttons */
.gl-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9600;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 62, 125, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.gl-btn:hover {
  background: rgba(0, 62, 125, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.gl-prev { left: 16px; }
.gl-next { right: 16px; }

/* Counter indicator */
.gl-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9600;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Dot strip */
.gl-dots {
  position: fixed;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9600;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 80vw;
}

.gl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.22s ease, transform 0.22s ease;
  flex-shrink: 0;
}

.gl-dot.gl-dot-active {
  background: #ffffff;
  transform: scale(1.4);
}

/* Loading spinner while image loads */
.gl-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 28px;
}

.gl-spinner.gl-hidden {
  display: none;
}

@media (max-width: 600px) {
  .gl-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .gl-prev { left: 8px; }
  .gl-next { right: 8px; }

  .gallery-intro h2 {
    font-size: 24px;
  }
}
