/* Gallery page — Little Blossoms Academy */

/* ─── Section h2 scale ─── */
.sect-gallery-intro h2, .sect-gallery-cta h2 {
  font-size: clamp(2.1875rem, 1.95rem + 1vw, 2.8125rem);
}

/* ─── Padding ─── */
.sect-gallery-intro,
.sect-gallery-grid { padding-bottom: var(--section-pad); }

/* ─── Page header — centred, dark, no photo ─── */
.gallery-page-header {
  background: var(--color-dark);
  color: var(--color-dark-ink);
  padding-block: clamp(4rem, 10vw, 7rem);
  text-align: center;
}
.gallery-page-header h1 { color: var(--color-dark-ink); max-width: 720px; margin: 0.75rem auto 1.25rem; }
.gallery-page-header .hand-accent { color: var(--color-accent-2); }
.gallery-page-header .subheading { max-width: 600px; margin: 0 auto; color: color-mix(in srgb, var(--color-dark-ink) 80%, transparent); font-size: 1.0625rem; line-height: 1.65; }

/* ─── Intro body ─── */
.gallery-intro-body { max-width: 640px; margin: 0.75rem auto 0; text-align: center; }
.gallery-intro-body p { color: var(--color-muted); font-size: 1.0625rem; }

/* ─── Masonry grid ─── */
.gallery-masonry {
  column-count: 4;
  column-gap: 1rem;
  margin-top: 2.5rem;
}
@media (max-width: 1100px) { .gallery-masonry { column-count: 3; } }
@media (max-width: 720px)  { .gallery-masonry { column-count: 2; } }
@media (max-width: 420px)  { .gallery-masonry { column-count: 1; } }

.gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 350ms ease, filter 350ms ease;
}
.gallery-item:hover img { transform: scale(1.03); filter: brightness(0.92); }
.gallery-item:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}
.gallery-item__caption {
  position: absolute; inset: auto 0 0 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--color-dark) 72%, transparent) 0%, transparent 100%);
  padding: 1.5rem 1rem 0.75rem;
  opacity: 0;
  transition: opacity 200ms ease;
}
.gallery-item:hover .gallery-item__caption,
.gallery-item:focus-visible .gallery-item__caption { opacity: 1; }
.gallery-item__caption span {
  display: block;
  font-family: var(--font-heading); font-size: 0.8125rem; font-weight: 600;
  color: var(--color-dark-ink);
}

/* ─── Lightbox overlay ─── */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--color-dark) 88%, transparent);
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}
.gallery-lightbox__inner {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90dvh;
  display: flex; flex-direction: column; align-items: center;
}
.gallery-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 82dvh;
  border-radius: var(--radius-md, 16px);
  object-fit: contain;
  box-shadow: 0 32px 80px -16px color-mix(in srgb, var(--color-dark) 55%, transparent);
}
.gallery-lightbox__caption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--color-dark-ink) 70%, transparent);
  text-align: center;
}
.gallery-lightbox__close {
  position: absolute; top: -2.75rem; right: 0;
  background: none; border: none;
  color: var(--color-dark-ink); cursor: pointer; opacity: 0.7;
  transition: opacity 150ms ease;
  padding: 0.25rem;
}
.gallery-lightbox__close:hover { opacity: 1; }
.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: color-mix(in srgb, var(--color-dark-ink) 12%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--color-dark-ink) 22%, transparent);
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-dark-ink); cursor: pointer;
  transition: background 150ms ease;
}
.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover { background: color-mix(in srgb, var(--color-dark-ink) 22%, transparent); }
.gallery-lightbox__prev { left: clamp(0.5rem, 2vw, 2rem); }
.gallery-lightbox__next { right: clamp(0.5rem, 2vw, 2rem); }

/* ─── CTA band ─── */
.sect-gallery-cta { background: var(--color-dark); color: var(--color-dark-ink); padding-block: var(--section-pad); text-align: center; }
.sect-gallery-cta h2 { color: var(--color-dark-ink); margin-bottom: 1rem; }
.sect-gallery-cta p { color: color-mix(in srgb, var(--color-dark-ink) 80%, transparent); max-width: 50ch; margin: 0 auto 2rem; }
.sect-gallery-cta .hand-accent { color: var(--color-accent-2); }
