/**
 * Franklin Mini Lightbox Styles
 * Sprite-based carousel architecture
 * CSP-compliant: no inline styles
 */

/* Overlay */
.fmlb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fmlb-overlay.fmlb-active {
  display: flex;
}

.fmlb-overlay.fmlb-visible {
  opacity: 1;
}

/* Overlay transitioning for swipe-to-close */
.fmlb-overlay.fmlb-transitioning {
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Slides container - the sprite that slides */
.fmlb-slides-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  will-change: transform;
}

/* Transitioning class for smooth sliding with stronger end easing */
.fmlb-slides-container.fmlb-transitioning {
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Individual slide slots */
.fmlb-slide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  box-sizing: border-box;
}

/* Position slides: -100% (left/prev), 0% (center/current), +100% (right/next) */
.fmlb-slide:nth-child(1) {
  left: -100%;
}

.fmlb-slide:nth-child(2) {
  left: 0;
}

.fmlb-slide:nth-child(3) {
  left: 100%;
}

/* Media elements */
.fmlb-slide img,
.fmlb-slide video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: auto;
  object-fit: contain;
}

.fmlb-slide audio {
  width: 100%;
  max-width: 500px;
}

/* Zoomed state */
.fmlb-slide.fmlb-zoomed img {
  max-width: 200%;
  cursor: move;
}

/* Close button */
.fmlb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.fmlb-close:hover,
.fmlb-close:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

/* Navigation arrows */
.fmlb-nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fmlb-nav-arrow.fmlb-prev {
  left: 20px;
}

.fmlb-nav-arrow.fmlb-next {
  right: 20px;
}

.fmlb-overlay.fmlb-show-arrows .fmlb-nav-arrow {
  opacity: 1;
}

.fmlb-nav-arrow:hover,
.fmlb-nav-arrow:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .fmlb-slides-container.fmlb-transitioning {
    transition: none;
  }

  .fmlb-close,
  .fmlb-nav-arrow {
    transition: none;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .fmlb-slide {
    padding: 40px 10px;
  }

  .fmlb-close {
    top: 10px;
    right: 10px;
  }

  .fmlb-nav-arrow {
    display: none; /* Hide arrows on mobile, use swipe instead */
  }
}
