/* ── Gallery Section ── */
.gallery-section {
  width: 100%;
  background-color: #f6efdf;
  padding: 48px 24px;
  overflow-x: hidden;
}

.gallery-section > .container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ── Title ── */
.gallery-section__title {
  margin: 0;
  color: #17407d;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.44vw, 4rem);
  line-height: 1;
  letter-spacing: -0.64px;
  text-transform: uppercase;
}

/* ── Desktop grid (3-column masonry) ── */
.gallery-section__grid {
  display: flex;
  gap: 16px;
}

.gallery-section__column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-section__gridItem {
  border: 0;
  padding: 0;
  margin: 0;
  background: #d9d9d9;
  cursor: pointer;
  overflow: hidden;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-section__gridItem--short {
  height: 372px;
}

.gallery-section__gridItem--tall {
  height: 515px;
}

/* Shorter images when gallery is inside blog/event post content */
.blog-post-page .gallery-section__gridItem--short,
.event-post-page .gallery-section__gridItem--short {
  height: 280px;
}

.blog-post-page .gallery-section__gridItem--tall,
.event-post-page .gallery-section__gridItem--tall {
  height: 380px;
}

.blog-post-page .gallery-section__mobileImage,
.event-post-page .gallery-section__mobileImage {
  height: 240px;
}

.gallery-section__gridImage {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 300ms ease;
}

.gallery-section__gridItem:hover .gallery-section__gridImage {
  transform: scale(1.03);
}

/* ── Mobile (hidden on desktop) ── */
.gallery-section__mobile {
  display: none;
}

/* ── Mobile swiper track ── */
.gallery-section__mobileTrack {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-section__mobileTrack::-webkit-scrollbar {
  display: none;
}

.gallery-section__mobileSlide {
  flex: 0 0 calc(100% - 60px);
  border: 0;
  padding: 0;
  margin: 0;
  background: #d9d9d9;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-section__mobileImage {
  width: 100%;
  height: 306px;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ── Mobile navigation ── */
.gallery-section__mobileNav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.gallery-section__navBtn {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: #377ee4;
  color: #ffffff;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.gallery-section__navBtn--disabled {
  background: transparent;
  border: 0.7px solid #cbc4b5;
  color: #cbc4b5;
  cursor: default;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   Lightbox
   ══════════════════════════════════════════ */
.gallery-section__lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: default;
}

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

.gallery-section__lightboxClose {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-section__lightboxArrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 200ms ease;
  z-index: 1;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.gallery-section__lightboxArrow--prev {
  left: 24px;
}

.gallery-section__lightboxArrow--next {
  right: 24px;
}

.gallery-section__lightboxArrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-section__lightboxImage {
  max-width: calc(100% - 144px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
}

/* ══════════════════════════════════════════
   Mobile  (≤ 768px)
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .gallery-section {
    padding: 32px 12px;
  }

  .gallery-section > .container {
    gap: 56px;
  }

  .gallery-section__title {
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.32px;
  }

  .gallery-section__grid {
    display: none !important;
  }

  .gallery-section__mobile {
    display: flex;
    flex-direction: column;
    gap: 56px;
  }

  .gallery-section__lightboxArrow {
    width: 36px;
    height: 36px;
  }

  .gallery-section__lightboxArrow--prev {
    left: 12px;
  }

  .gallery-section__lightboxArrow--next {
    right: 12px;
  }

  .gallery-section__lightboxImage {
    max-width: calc(100% - 96px);
    max-height: calc(100vh - 120px);
  }
}
