/* lightbox.css — Image modal styles */

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.lightbox-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Image wrapper */
.lightbox-image-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fcf9f3;
  border: 1px solid #8e7164;
  max-height: 85vh;
  padding: 20px;
}

#lightbox-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
  animation: lightbox-fade-in 0.3s ease;
}

@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Navigation buttons */
.lightbox-prev,
.lightbox-next,
.lightbox-close {
  background: rgba(255, 102, 0, 0.9);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  background: #FF6600;
  transform: scale(1.1);
}

.lightbox-prev:focus-visible,
.lightbox-next:focus-visible,
.lightbox-close:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

/* Info section */
.lightbox-info {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: white;
}

#lightbox-counter {
  font-family: Inter, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lightbox-copy-btn {
  background: none;
  border: 1px solid rgba(255, 102, 0, 0.5);
  color: #FF6600;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox-copy-btn:hover {
  background: rgba(255, 102, 0, 0.1);
  border-color: #FF6600;
}

.lightbox-copy-btn:focus-visible {
  outline: 2px solid #FF6600;
  outline-offset: 2px;
}

.lightbox-open-btn {
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FF6600;
  text-decoration: none;
  border: 1px solid #FF6600;
  padding: 6px 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox-open-btn:hover {
  background: #FF6600;
  color: white;
}

.lightbox-open-btn:focus-visible {
  outline: 2px solid #FF6600;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .lightbox-container {
    gap: 8px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .lightbox-prev {
    left: -50px;
  }

  .lightbox-next {
    right: -50px;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: -45px;
  }

  .lightbox-image-wrapper {
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .lightbox-container {
    gap: 12px;
    flex-direction: column;
  }

  .lightbox-image-wrapper {
    max-height: 60vh;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .lightbox-prev {
    left: -55px;
  }

  .lightbox-next {
    right: -55px;
  }

  .lightbox-close {
    top: -55px;
  }
}

@media (max-width: 600px) {
  .lightbox-overlay {
    padding: 16px;
  }

  .lightbox-container {
    width: 100%;
    gap: 8px;
  }

  .lightbox-image-wrapper {
    max-height: 50vh;
    padding: 8px;
    border-radius: 2px;
  }

  #lightbox-image {
    max-width: 100%;
    max-height: 100%;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 18px;
    top: auto;
    position: static;
    transform: none;
    margin: 0 8px;
    flex-shrink: 0;
  }

  .lightbox-container {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
  }

  .lightbox-image-wrapper {
    order: 2;
    flex: 1;
    min-width: 0;
  }

  .lightbox-prev {
    order: 1;
  }

  .lightbox-next {
    order: 3;
  }

  .lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 20px;
  }

  .lightbox-info {
    position: static;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  #lightbox-counter {
    font-size: 12px;
  }

  .lightbox-open-btn {
    padding: 8px 14px;
    font-size: 10px;
    width: 100%;
    text-align: center;
  }

  /* Touch-friendly tap target minimum 44px */
  .lightbox-prev,
  .lightbox-next,
  .lightbox-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay,
  #lightbox-image,
  .lightbox-prev,
  .lightbox-next,
  .lightbox-close,
  .lightbox-open-btn {
    transition: none;
  }

  #lightbox-image {
    animation: none;
  }
}
