/*-- -------------------------- -->
<---          Gallery           -->
<--- -------------------------- -*/

/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
  #gallery-405 {
    padding: var(--sectionPadding);
  }
  #gallery-405 .cs-container {
    width: 100%;
    max-width: 80rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 48px - 64px */
    gap: clamp(3rem, 6vw, 4rem);
    position: relative;
    z-index: 1;
  }
  #gallery-405 .cs-content {
    /* set text align to left if content needs to be left aligned */
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* centers content horizontally, set to flex-start to left align */
    align-items: center;
  }
  #gallery-405 .cs-title {
    margin: 0 0 1.5rem 0;
  }
  #gallery-405 .cs-button-group {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #gallery-405 .cs-button {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    color: var(--bodyTextColor);
    background-color: transparent;
    border: 1.5px solid #d1d5db;
    border-radius: 100px;
    padding: 0.5rem 1.125rem;
    cursor: pointer;
    transition: color 0.25s, background-color 0.25s, border-color 0.25s;
    white-space: nowrap;
  }
  #gallery-405 .cs-button:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
  #gallery-405 .cs-button.cs-active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }
  #gallery-405 .cs-gallery-wrapper {
    width: 100%;
    position: relative;
    z-index: 1;
  }
  #gallery-405 .cs-gallery {
    width: 100%;
    padding: 0;
    margin: 0;
    opacity: 1;
    visibility: visible;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* 16px - 20px */
    gap: clamp(1rem, 1.5vw, 1.25rem);
    transition: transform 0.7s, opacity 0.3s, visibility 0.5s, top 0.3s, left 0.3s;
    /* makes the transfrom scaling orgin the top left corner, dictates the direction by which the scale transforms animate towards */
    transform-origin: left top;
  }
  #gallery-405 .cs-gallery.cs-hidden {
    /* by using visibility:hidden instead of display:none, we can see the animations from the opacity and transforms, display:none won't render animations. */
    visibility: hidden;
    /* prevents the mouse from interacting with it */
    pointer-events: none;
    /* hidden galleries have a 0 opacity, and we animate the opacity to 1 when they become active */
    opacity: 0;
    /* this top and left value help control the animation, by setting it to position absolute and left 0, the gallery won't fly off screen to the left, it will stop its position to be at the left edge of the .cs-container (left: 0). Same for the bottom:0 value, the gallery won't go past that posiiton when it animates */
    top: 0;
    left: 0;
    position: absolute;
    /* prevents the hidden galleries from overflowing the section, and makes a nice animations to transition to and from */
    transform: scaleY(0) scaleX(0);
  }
  #gallery-405 .cs-gallery.cs-hidden .cs-image {
    /* when gallery is hidden, add these styles to the cs-image to animate from when cs-hidden is removed from the .cs-gallery */
    transform: translateY(2.1875rem);
    opacity: 0;
  }
  #gallery-405 .cs-image {
    width: calc(50% - 0.625rem);
    /* 150px - 300px */
    height: clamp(9.375rem, 39vw, 18.75rem);
    max-width: 21.875rem;
    /* clips the image corners */
    overflow: hidden;
    display: block;
    position: relative;
    /* when .cs-hidden is removed from the .cs-gallery, reset these values and animate between their hidden styles */
    transform: translateY(0rem);
    opacity: 1;
    transition: opacity 0.6s, transform 0.6s;
  }
  #gallery-405 .cs-image:nth-of-type(4n+1) { transition-delay: 0.15s; }
  #gallery-405 .cs-image:nth-of-type(4n+2) { transition-delay: 0.3s; }
  #gallery-405 .cs-image:nth-of-type(4n+3) { transition-delay: 0.45s; }
  #gallery-405 .cs-image:nth-of-type(4n+4) { transition-delay: 0.6s; }
  #gallery-405 .cs-image img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    /* makes it act like a background image */
    object-fit: cover;
  }
}
/* Small Desktop - 1024px */
@media only screen and (min-width: 64rem) {
    #gallery-405 .cs-image {
        width: calc(50% - 0.625rem);
        aspect-ratio: 16 / 9;
        height: auto;
        max-width: none;
    }
  #gallery-405 .cs-image:nth-of-type(4n+1) { transition-delay: 0.15s; }
  #gallery-405 .cs-image:nth-of-type(4n+2) { transition-delay: 0.3s; }
  #gallery-405 .cs-image:nth-of-type(4n+3) { transition-delay: 0.45s; }
  #gallery-405 .cs-image:nth-of-type(4n+4) { transition-delay: 0.6s; }
}

/* ─────────────────────────────────────────
   Clickable thumbnails
───────────────────────────────────────── */
#gallery-405 .cs-image {
  cursor: pointer;
}

#gallery-405 .cs-image img {
  transition: transform 0.3s ease;
}

#gallery-405 .cs-image:hover img {
  transform: scale(1.06);
}

/* ─────────────────────────────────────────
   Lightbox
───────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

#lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

#lightbox .lb-figure {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}

#lightbox .lb-img {
  max-width: 100%;
  max-height: 100%;
  -o-object-fit: contain;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#lightbox .lb-img.is-loaded {
  opacity: 1;
}

#lightbox .lb-close,
#lightbox .lb-prev,
#lightbox .lb-next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#lightbox .lb-close:hover,
#lightbox .lb-prev:hover,
#lightbox .lb-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

#lightbox .lb-close {
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}

#lightbox .lb-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

#lightbox .lb-prev,
#lightbox .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

#lightbox .lb-prev { left: 0.5rem; }
#lightbox .lb-next { right: 0.5rem; }

#lightbox .lb-prev svg,
#lightbox .lb-next svg {
  width: 1.5rem;
  height: 1.5rem;
}

#lightbox .lb-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: var(--bodyFont);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}

@media (max-width: 40rem) {
  #lightbox .lb-figure {
    padding: 4.5rem 0.5rem 3rem;
  }
  #lightbox .lb-prev,
  #lightbox .lb-next {
    width: 2.5rem;
    height: 2.5rem;
  }
  #lightbox .lb-prev { left: 0.25rem; }
  #lightbox .lb-next { right: 0.25rem; }
  #lightbox .lb-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
  }
}
  