/**
 * @file
 * Custom styles for PhotoSwipe integration.
 */

/* Ensure the PhotoSwipe container is properly positioned and layered */
.pswp {
  z-index: 1500; /* Above most other elements */
}

/* Style the gallery thumbnails in the slider */
.pswp-gallery {
  width: 100%;
}

/* Style for gallery items in the slider */
.gallery-item {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.gallery-item:hover {
  opacity: 0.9;
}

/* Ensure images in the gallery are responsive */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* Add a subtle zoom effect on hover */
.gallery-item:hover img {
  transform: scale(1.02);
}

/* Style the PhotoSwipe UI elements */
.pswp__ui {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pswp--ui-visible .pswp__ui {
  opacity: 1;
}

/* Style the caption */
.pswp__caption {
  background: rgba(0, 0, 0, 0.5);
  padding: 15px 20px;
  color: #fff;
  text-align: center;
}

.pswp__caption__center {
  max-width: 800px;
  margin: 0 auto;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pswp-thumb-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  box-sizing: border-box;
  z-index: 20;
}

.pswp-thumb {
  width: 90px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  /* opacity: 0.6; */
  opacity: 1!important;
}

.pswp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pswp-thumb.is-active {
  border-color: #38bdf8;
  opacity: 1;
}

@media (max-width: 640px) {
  .pswp-thumb {
    width: 60px;
    height: 40px;
  }
}

/* Style the navigation arrows */
.pswp__button--arrow--left,
.pswp__button--arrow--right {
  background: none;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.pswp__button--arrow--left:hover,
.pswp__button--arrow--right:hover {
  opacity: 1;
  background: none;
}

.pswp__button--arrow--left::before,
.pswp__button--arrow--right::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: none;
  border: 2px solid #fff;
  border-radius: 50%;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.pswp__button--arrow--left:hover::before,
.pswp__button--arrow--right:hover::before {
  opacity: 1;
  transform: scale(1.1);
}

/* Style the close button */
.pswp__button--close {
  background: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.pswp__button--close:hover {
  opacity: 1;
  background: none;
}

/* Loading indicator */
.pswp__preloader__icn {
  opacity: 0.6;
}

/* Counter */
.pswp__counter {
  color: #fff;
  font-size: 0.9rem;
  padding: 0 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Make sure the thumbnail slider is properly spaced */
.thumbnail-slider {
  margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pswp__button--arrow--left,
  .pswp__button--arrow--right {
    width: 36px;
    height: 36px;
    margin-top: -18px;
  }

  .pswp__caption {
    padding: 10px 15px;
  }

  .pswp__caption__center {
    font-size: 0.8rem;
  }
}
