/* ==========================================================================
   SCCWS Nepal — Gallery page styles
   Built on the shared design tokens / components in style.css. Adds the
   gallery hero banner, the photo grid, and the click-through lightbox
   (big image + previous/next) used only on gallery.html.
   ========================================================================== */

/* ---- Gallery Hero ---------------------------------------------------------- */
.gallery-hero {
  position: relative;
  overflow: hidden;
}

.gallery-hero__glow {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background: radial-gradient(ellipse 42% 70% at 50% 50%, var(--color-brand-mint) 0%, rgba(158, 209, 189, 0) 70%);
}

.gallery-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.gallery-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--color-brand-forest-light);
  color: #8abda9;
  width: fit-content;
}

.gallery-hero__badge svg { width: 14px; height: 14px; }
.gallery-hero__badge span { font-size: 12px; font-weight: 700; }

.gallery-hero__inner h1 {
  font-size: 48px;
  line-height: 56px;
  color: var(--color-white);
}

.gallery-hero__lede {
  font-size: 18px;
  line-height: 28px;
  color: var(--color-brand-mint);
}

@media (max-width: 767.98px) {
  .gallery-hero__inner h1 { font-size: 32px; line-height: 38px; }
  .gallery-hero__lede { font-size: 16px; line-height: 25px; }
}

/* ---- Photo Grid ------------------------------------------------------------ */
.gallery-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

.gallery-page__tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-bg-card);
}

.gallery-page__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gallery-page__tile:hover img,
.gallery-page__tile:focus-visible img {
  transform: scale(1.05);
}

.gallery-page__tile:focus-visible {
  outline: 2px solid var(--color-brand-forest);
  outline-offset: 2px;
}

.gallery-page__caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
  background: linear-gradient(to top, rgba(0, 54, 41, 0.82) 0%, rgba(0, 54, 41, 0) 55%);
  opacity: 0;
  transition: opacity 200ms ease;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-white);
  text-align: left;
}

.gallery-page__tile:hover .gallery-page__caption,
.gallery-page__tile:focus-visible .gallery-page__caption {
  opacity: 1;
}

@media (max-width: 767.98px) {
  .gallery-page__grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-4); }
  .gallery-page__caption {
    opacity: 1;
    padding: var(--space-3);
    font-size: 13px;
    background: linear-gradient(to top, rgba(0, 54, 41, 0.78) 0%, rgba(0, 54, 41, 0) 65%);
  }
}

/* ---- Lightbox --------------------------------------------------------------- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
}

.gallery-lightbox[hidden] {
  display: none;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 15, 13, 0.92);
}

.gallery-lightbox__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: min(90vw, 1100px);
  max-height: 90vh;
}

.gallery-lightbox__stage img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  background-color: var(--color-bg-card);
}

.gallery-lightbox__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-white);
  text-align: center;
}

.gallery-lightbox__caption { font-size: 14px; font-weight: 600; }
.gallery-lightbox__count { font-size: 13px; color: var(--color-brand-mint); white-space: nowrap; }

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.gallery-lightbox__close svg,
.gallery-lightbox__nav svg { width: 22px; height: 22px; }

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:focus-visible {
  background-color: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}

.gallery-lightbox__close {
  top: var(--space-6);
  right: var(--space-6);
}

.gallery-lightbox__nav--prev { left: var(--space-6); top: 50%; transform: translateY(-50%); }
.gallery-lightbox__nav--next { right: var(--space-6); top: 50%; transform: translateY(-50%); }

@media (max-width: 767.98px) {
  .gallery-lightbox { padding: var(--space-4); }
  .gallery-lightbox__stage img { max-height: 62vh; }
  .gallery-lightbox__close { top: var(--space-3); right: var(--space-3); width: 38px; height: 38px; }
  .gallery-lightbox__close svg, .gallery-lightbox__nav svg { width: 18px; height: 18px; }
  .gallery-lightbox__nav { width: 38px; height: 38px; }
  .gallery-lightbox__nav--prev { left: var(--space-3); }
  .gallery-lightbox__nav--next { right: var(--space-3); }
}
