.image-overlay-figure {
  position: relative;
  z-index: 2;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.image-overlay-caption {
  margin-top: 18px;
  color: #fff;
  font-size: 1.1rem;
  background: rgba(10,10,10,0.45);
  padding: 10px 28px;
  border-radius: 8px;
  max-width: 80vw;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  font-family: 'Manrope', system-ui, sans-serif;
}
.image-overlay-error {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: #fff;
  background: rgba(120,0,0,0.8);
  padding: 18px 32px;
  border-radius: 10px;
  font-size: 1.2rem;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.gallery-item img {
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.4,1.3,.6,1), box-shadow 0.18s;
}
.gallery-item img:hover {
  transform: scale(1.04) rotate(-1deg);
  box-shadow: 0 6px 32px rgba(0,0,0,0.18);
  z-index: 2;
  filter: brightness(1.08) saturate(1.1);
}
.image-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 10000;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  transition: opacity 0.2s;
}
.image-overlay-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  z-index: 1;
}
.image-overlay-img {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  border-radius: 12px;
  background: transparent;
}
.image-overlay-close {
  position: absolute;
  top: 32px; right: 48px;
  z-index: 3;
  font-size: 2.5rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 12px;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.image-overlay-close:hover { opacity: 1; }
.image-overlay-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 3;
  font-size: 2.5rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 18px;
  opacity: 0.85;
  transition: opacity 0.2s;
  user-select: none;
}
.image-overlay-prev { left: 24px; }
.image-overlay-next { right: 24px; }
.image-overlay-nav:hover { opacity: 1; }
@media (max-width: 900px) {
  .image-overlay { display: none !important; }
}
/* Gallery Page Styles */
.gallery-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px;
}
.gallery-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--green-900, #1a3e2c);
  margin-bottom: 0.5rem;
}
.gallery-desc {
  color: var(--gray-600, #64748b);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.gallery-item {
  aspect-ratio: 4 / 3;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(26,62,44,0.04);
  overflow: hidden;
  padding: 0;
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  display: block;
}
.gallery-skeleton {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2;
}

/* Gallery page: force nav bar solid, no transition */
.gallery-page .pub-nav,
body.gallery-page .pub-nav {
  background: var(--f) !important;
  box-shadow: 0 2px 28px rgba(2,40,24,.12);
  transition: none !important;
}
.gallery-page .pub-nav.transparent,
.gallery-page .pub-nav.scrolled {
  background: var(--f) !important;
  box-shadow: 0 2px 28px rgba(2,40,24,.12);
}
