/* Local fallback for deprecated photopile CDN */
.photopile-wrapper {
  position: relative;
  width: 100%;
  min-height: 360px;
  overflow: visible;
}

.photopile {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 320px;
}

.photopile li {
  position: absolute;
  margin: 0;
  padding: 0;
  cursor: pointer;
  transform-origin: center center;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.photopile li:hover {
  transform: scale(1.03) rotate(var(--photo-rotation, 0deg));
  z-index: 3;
}

.photopile li a,
.photopile li img {
  display: block;
}

.photopile li img {
  max-width: 220px;
  max-height: 220px;
  object-fit: cover;
  border: 8px solid #fff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  background: #fff;
}

#photopile-active-image-container {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

#photopile-active-image-container.open {
  display: flex;
}

#photopile-active-image {
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  transition: opacity 150ms ease;
}

#photopile-image-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: photopile-spin 0.8s linear infinite;
  display: none;
  z-index: 100001;
}

@keyframes photopile-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

#photopile-close {
  position: fixed;
  top: 20px;
  right: 24px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 100000;
}

#photopile-nav-prev,
#photopile-nav-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 100000;
}

#photopile-nav-prev:hover,
#photopile-nav-next:hover {
  background: rgba(255, 255, 255, 0.38);
}

#photopile-nav-prev {
  left: 20px;
}

#photopile-nav-next {
  right: 20px;
}

#photopile-nav-prev::before,
#photopile-nav-next::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
}

#photopile-nav-prev::before {
  transform: translate(-32%, -50%) rotate(-135deg);
}

#photopile-nav-next::before {
  transform: translate(-68%, -50%) rotate(45deg);
}

@media (max-width: 767px) {
  .photopile li img {
    max-width: 150px;
    max-height: 150px;
  }
}
