.gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  flex-direction: column;
  pointer-events: auto;
}
.gallery-overlay.open { display: flex; }
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem;
  color: #e0e0e0;
  font-size: 0.95rem;
  border-bottom: 1px solid #1a2a4e;
  flex: 0 0 auto;
}
.gallery-close {
  background: transparent;
  border: 1px solid #1a5ab8;
  color: #e0e0e0;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.gallery-close:hover { background: #0f3460; }
.gallery-grid {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  align-content: start;
}
.gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  background: #16213e;
  display: block;
}
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 110;
  cursor: zoom-out;
}
.gallery-lightbox.open { display: flex; }
.gallery-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.4rem;
    padding: 0.5rem;
  }
  .gallery-grid img { height: 120px; }
}
