.gallery-block figure {
  margin-bottom: 0;
}

.gallery-block img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
}

.gallery-image-button {
  display: block;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
}

.gallery-item {
  display: block;
  opacity: 1;
  max-height: 1000px;
  overflow: hidden;
  transform: translateY(0);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    max-height 0.35s ease,
    margin 0.35s ease;
}

.gallery-item.is-hidden {
  display: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(20px);
}

.gallery-item img {
  transition: transform 0.3s ease-in-out;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  padding: 0 !important;
}

.gallery-modal .modal-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
}

.gallery-modal .modal-content {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.92);
}

.gallery-modal .modal-body {
  width: 100%;
  height: 100%;
}

.gallery-modal-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 3rem 7rem;
}

.gallery-modal-image-wrapper img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  border-radius: 20px;
}

.gallery-modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.gallery-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.gallery-modal .carousel-control-prev,
.gallery-modal .carousel-control-next {
  top: 50%;
  bottom: auto;
  width: auto;
  padding: 1.5rem;
  opacity: 1;
  transform: translateY(-50%);
}

.gallery-modal .carousel-control-prev {
  left: 2rem;
}

.gallery-modal .carousel-control-next {
  right: 2rem;
}

.gallery-arrow-prev {
  transform: rotate(180deg);
}

.carousel-control-next:hover .gallery-arrow {
  transform: translateX(3px);
}

.carousel-control-prev:hover .gallery-arrow-prev {
  transform: rotate(180deg) translateX(3px);
}

.show_more_btn {
  color: white !important;
}

@media (max-width: 767.98px) {
  .gallery-modal-image-wrapper {
    padding: 4rem 1rem;
  }

  .gallery-modal-image-wrapper img {
    max-height: calc(100vh - 8rem);
  }

  .gallery-modal-close {
    top: 1rem;
    right: 1rem;
  }

  .gallery-modal .carousel-control-prev {
    left: 0.25rem;
  }

  .gallery-modal .carousel-control-next {
    right: 0.25rem;
  }

  .gallery-modal .carousel-control-prev,
  .gallery-modal .carousel-control-next {
    padding: 0.5rem;
  }

  .gallery-arrow {
    width: 3rem;
    height: 3rem;
  }
}

.gallery-block .gallery-item.is-hidden {
  display: none !important;
}
