/* gallery.css — /gallery/ page: photo grid + lightbox (page-scoped via $page_extra_css). */
/* Page-local styles for the gallery grid + lightbox */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-base);
  border: 1px solid var(--line);
  background: var(--bg);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  transition: transform var(--dur-quick) ease, box-shadow var(--dur-quick) ease;
}
.gallery-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(var(--black-rgb),0.08); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-grid--flat { margin-top: 0; }
.gallery-card--video { cursor: default; aspect-ratio: auto; }
.gallery-card--video:hover { transform: none; box-shadow: none; }

/* Lightbox overlay */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(var(--black-rgb),0.92);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--space-6);
}
.gallery-lightbox.is-open { display: flex; }
.gallery-lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: var(--radius-md); }
.gallery-lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(var(--white-rgb),0.1); border: 1px solid rgba(var(--white-rgb),0.2);
  color: var(--text-inverse); font-size: 2rem; line-height: 1;
  width: 3rem; height: 3rem; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-quick);
}
.gallery-lightbox__nav:hover { background: rgba(var(--white-rgb),0.2); }
.gallery-lightbox__nav--prev { left: 1rem; }
.gallery-lightbox__nav--next { right: 1rem; }
.gallery-lightbox__count {
  position: absolute; left: 0; right: 0; bottom: 1rem;
  text-align: center;
  color: rgba(var(--white-rgb),0.7);
  font-size: var(--size-small);
}
.gallery-lightbox__close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(var(--white-rgb),0.1); border: 1px solid rgba(var(--white-rgb),0.2);
  color: var(--text-inverse); font-size: 1.25rem; line-height: 1;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.gallery-lightbox__close:hover { background: rgba(var(--white-rgb),0.2); }

