// 2025_05_30 Create foe new managment of lightbox and add swiper
.cb-image-grid {
  $cb: &;

  background-color: #333;
  color: white;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;

  &--type-one {
    #{$cb}__container {
      margin: 0 auto;
      text-align: center;
      padding-left: 40px;
      padding-right: 40px;
      padding-bottom: 60px;
      padding-top: 60px;
      display: flex;
      justify-content: space-around;

      #{$cb}__image {
        position: relative;
        overflow: hidden;
        width: 150px;
        margin: 0 1rem 1rem 0;
        display: inline-block;
        width: 100%;
        max-height: 90vh;

        &:hover {
          img {
            transform: scale(1.075);
          }
        }

        img {
          border-radius: 4px;
          overflow: hidden;
          z-index: 0;
          position: absolute;
          top: 0;
          left: 0;
          height: 100%;
          width: 100%;
          object-fit: cover;
          transition: transform 0.6s;
          will-change: transform;
        }

        @for $i from 1 through 100 {
          &:nth-child(#{$i}) {
            $h: (
              random(400) + 200) + px;
            height: $h;
          }
        }
      }
    }
  }
}

[lightbox-toggle] {
  cursor: zoom-in;

  &:after {
    position: absolute;
    content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="white" stroke="black" stroke-opacity="0.25" stroke-width="0.25" d="M16.32 14.9l5.39 5.4a1 1 0 0 1-1.42 1.4l-5.38-5.38a8 8 0 1 1 1.41-1.41zM10 16a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm1-7h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H7a1 1 0 0 1 0-2h2V7a1 1 0 1 1 2 0v2z"/></svg>'
    );
  height: 32px;
  width: 32px;
  bottom: 0;
  right: 0;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.2s;
}

&:hover {
  &:after {
    opacity: 1;
    filter: drop-shadow(2px 4px 6px black);
  }
}
}

.c-lightbox {
  $c: &;

  // font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  pointer-events: none;
  position: fixed;
  opacity: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9000000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s;

  &.open {
    opacity: 1;
    pointer-events: all;
  }

  #{$c}__container {
    width: 100%;
    height: 100%;
  }

  #{$c}__close {
    /* 2025_06_06 update Z-index   */
    z-index: 99999;
    position: absolute;
    cursor: pointer;
    top: 1vh;
    right: 1vw;
    font-size: 30px;
    padding: 20px;
    color: white;

    &:hover {
      color: rgba(110, 109, 109, 0.8);
    }
  }

  .swiper-container {
    background-color: black;
    // width: 100%;
    height: 100%;
  }

  .swiper-slide {
    position: relative;
    width: 100%;
    height: 95%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    transition-timing-function: var(--swiper-wrapper-transition-timing-function, initial);
    box-sizing: content-box;
  }

  .swiper-pagination {
    color: white;
  }

  .swiperDescription {
    top: 0px;
    font-weight: bold;
    display: table-cell;
    width: 100%;
    height: 50px;
    background-color: black;
    vertical-align: sub;
    color: #ffffff;
    text-align: center;
    position: absolute;
    bottom: 10px;
    padding: 1em;
    opacity: 50%;
  }

  .swiper-button-next,
  .swiper-button-prev {
    color: white;

    &:hover {
      color: rgba(110, 109, 109, 0.8);
    }

    &:after {
      font-size: 30px;
    }
  }

  #{$c}__image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 75%;
    width: 75%;
    text-align: center;
    cursor: zoom-in;

    img {
      width: auto;
      height: auto;
      max-height: 90vh;
      max-width: 90vw;
    }
  }
}


.c-lightbox .c-lightbox__close {
  /* 2025_06_06 update Z-index   */
  z-index: 99999;
  position: absolute;
  cursor: pointer;
  top: 1vh;
  right: 1vw;
  font-size: 30px;
  padding: 20px;
  color: white;
}

.cb-image-grid {
  padding: 0;
  background-color: white;
  color: white;
  // font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}


.cb-image-grid--type-one .cb-image-grid__container {
  margin: 0 auto;
  text-align: center;
}

.cb-image-grid--type-one .cb-image-grid__container .cb-image-grid__images-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}

.cb-image-grid--type-one .cb-image-grid__container .cb-image-grid__image:nth-child(1) {
  height: 267px;
}

.cb-image-grid--type-one .cb-image-grid__container .cb-image-grid__image {
  position: relative;
  overflow: hidden;
  width: 150px;
  margin: 0 1rem 1rem 0;
  display: inline-block;
  width: 100%;
  max-height: 90vh;
}

.cb-image-grid__image {
  // font-family: Verdana, sans-serif;
  color: #5c5b5b;
  font-weight: bold;
  width: 300px;
  height: 300px;
  overflow: hidden;
  object-fit: cover;
  padding: 20px;
}

.c-lightbox .c-lightbox__container {
  width: inherit;
  height: 100%;
  font-size: 2vw;
  text-align: center;
}

.c-lightbox .c-lightbox__image {
  display: block;
  margin-top: auto;
  margin: auto;
  object-fit: contain;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  max-width: 90%;
  height: inherit;
  text-align: center;
  cursor: zoom-in;
}

.c-lightbox__image img {
  display: block;
  margin: auto;
  object-fit: contain;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  max-width: 90%;
  height: inherit;
  text-align: center;
}

.cb-image-grid__image-caption {
  position: relative;
}

.c-lightbox .c-lightbox__caption {
  color: var(--color-light);
  position: fixed;
  bottom: 60px;
  text-align: center;
  width: 100%;
  max-height: fit-content;
  padding: 10px 20px 10px 20px;
  font-size: 2vw;
  background: radial-gradient(circle, rgba(40, 39, 39, 0.75) 40%, rgba(2, 0, 36, 0) 100%);
  display: block;
  will-change: transform;
  transition: transform 0.3s;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}


.c-lightbox .swiper-pagination {
  bottom: 60px;
  font-size: 1vw;
}

.c-lightbox {

  .swiper-button-next,
  .swiper-button-prev {
    color: white;
    font-size: 1vw;
  }
}

.c-lightbox .c-lightbox__close {
  font-size: 2vw;
}

.c-lightbox .c-lightbox__close:hover {
  color: rgba(110, 109, 109, 0.8);
}

.swiper-wrapper {
  top: 30px;
}