.custom-gallery-ext {
    background: #213180;
}
.custom-gallery-ext .container {
    max-width: 1100px;
    margin: 0px auto !important;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  border-radius: 16px;
  overflow: hidden;
}
/* First photo spans 2 rows on the left */
.gallery-grid .g-item:first-child {
  grid-row: span 2;
}
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid .g-item:first-child {
    grid-row: span 1;
  }
  /* 7 photos on a 2-col grid leaves a lone tile  let it fill the row */
  .gallery-grid .g-item:last-child {
    grid-column: span 2;
  }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

.g-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
}
.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  min-height: 160px;
}
.g-item:hover img { transform: scale(1.06); }
.g-item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(33,49,128,0.6) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
}
.g-item:hover .g-item-overlay { opacity: 1; }

/* Hover hint that photos are clickable */
.g-item::after {
  content: '🔍';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: 1.8rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.g-item:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* GALLERY LIGHTBOX */
.g-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,12,30,0.94);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.g-lightbox.active { display: flex; animation: lbFadeIn 0.2s ease; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.g-lightbox-img {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  object-fit: contain;
}
.g-lightbox-close,
.g-lightbox-nav {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.g-lightbox-close:hover,
.g-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.g-lightbox-close { top: 1.5rem; right: 1.5rem; width: 44px; height: 44px; font-size: 1.6rem; }
.g-lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.6rem; }
.g-lightbox-prev { left: 1.5rem; }
.g-lightbox-next { right: 1.5rem; }
.g-lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
@media (max-width: 600px) {
  .g-lightbox-nav { width: 40px; height: 40px; font-size: 1.3rem; }
  .g-lightbox-prev { left: 0.5rem; }
  .g-lightbox-next { right: 0.5rem; }
  .g-lightbox-close { top: 1rem; right: 1rem; width: 38px; height: 38px; font-size: 1.3rem; }
}