/*************************************************************/
/*************************** GALLERY *************************/
/*************************************************************/
.gallery-carousel {
  position: relative;
}

/*  Viewport: enable touch/momentum scrolling */
.gallery-carousel .viewport {
    display: flex;
    gap: 10px;
    padding: 10px;
    width: 100%;
    height: calc(100vw / 4);
    max-height: calc(1240px / 4);
    overflow-x: auto;                  /* allow horizontal scroll */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* iOS momentum */
    touch-action: pan-x;               /* native horizontal swipe */
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: space-evenly;
}
.gallery-carousel .viewport::-webkit-scrollbar {
  display: none;
}

/* add a �grabbing� cursor when dragging */
.gallery-carousel .viewport.dragging {
    cursor: grabbing;
    user-select: none;
}

.gallery-carousel img {
    flex: 0 0 auto;
    width: calc(25% - 5px);
    height: 100%;
    scroll-snap-align: start;
    scroll-margin-left: 7px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform .2s;
    object-fit: cover;
    box-shadow: -1px 1px 4px -1px grey;
    pointer-events: auto;
}

.gallery-carousel img:hover {
  transform: scale(1.05);
}

/* Prev/Next buttons */
.prev-btn,
.next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; 
  height: 32px;
  color: var(--tln-dark-grey);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.prev-btn { left: -30px; }
.next-btn { right: -30px; }

@media (max-width: 768px) {
    .gallery-carousel .viewport {
        gap: 5px;
        padding: 10px 5px;
        width: 100%;
        height: calc(100vw / 3);
        max-height: calc(1245px / 3);
    }
    .gallery-carousel img {
        width: calc(33.33% - 2px);
        scroll-snap-align: center;
        scroll-margin-left: 0;
    }
}

/* ===============================
   Lightbox Styling
   =============================== */
#lightbox {
  position: fixed;
  inset: 0;
  display: none;           /* hidden by default */
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
}

#lightbox.visible {
  display: flex;           /* show lightbox */
  opacity: 1;
}

#lightbox figure {
  margin: 0;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

#lightbox img {
  max-width: 100%;
  max-height: 80vh;
}

#lightbox figcaption {
  color: #fff;
  margin-top: 8px;
  font-size: 1rem;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 16px; }
.lb-next  { right: 16px; }