/* ==========================================================================
   Lightbox Component Styles
   Overlay component that displays enlarged images with navigation arrows.
   Includes dark overlay background, smooth animations, and focus trap styling.
   Requirements: 10.4, 10.5, 19.4
   ========================================================================== */

/* ==========================================================================
   Lightbox Overlay
   Full-screen dark overlay that contains the enlarged image and controls.
   ========================================================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Lightbox Image
   The enlarged image displayed in the center of the overlay.
   ========================================================================== */

.lightbox__image {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 300ms ease 100ms, transform 300ms ease 100ms;
}

.lightbox--open .lightbox__image {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Lightbox Controls (Close, Previous, Next)
   Navigation buttons for browsing and closing the lightbox.
   ========================================================================== */

.lightbox__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: var(--color-white);
  font-size: 1.75rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  z-index: 1;
  line-height: 1;
}

.lightbox__close:hover,
.lightbox__close:focus {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: scale(1.1);
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  z-index: 1;
  line-height: 1;
}

.lightbox__prev {
  left: var(--space-lg);
}

.lightbox__next {
  right: var(--space-lg);
}

.lightbox__prev:hover,
.lightbox__prev:focus,
.lightbox__next:hover,
.lightbox__next:focus {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.lightbox__prev:hover,
.lightbox__prev:focus {
  transform: translateY(-50%) scale(1.1);
}

.lightbox__next:hover,
.lightbox__next:focus {
  transform: translateY(-50%) scale(1.1);
}

/* ==========================================================================
   Responsive - Mobile adjustments
   ========================================================================== */

@media screen and (max-width: 768px) {
  .lightbox__image {
    max-width: 95%;
    max-height: 70vh;
  }

  .lightbox__close {
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .lightbox__prev,
  .lightbox__next {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .lightbox__prev {
    left: var(--space-sm);
  }

  .lightbox__next {
    right: var(--space-sm);
  }
}

/* ==========================================================================
   Reduced Motion
   Disable animations for users who prefer reduced motion.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    transition: none;
  }

  .lightbox__image {
    transition: none;
  }
}
