/* 이미지 라이트박스 스타일 */

.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-lightbox.active {
  display: flex;
}

/* 오버레이 */
.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

/* 컨텐츠 컨테이너 */
.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: zoomIn 0.3s ease;
}

/* 이미지 */
.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* 캡션 */
.lightbox-caption {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  color: #fff;
  text-align: center;
  font-size: 0.875rem;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  max-width: 90%;
}

.lightbox-caption:empty {
  display: none;
}

/* 닫기 버튼 */
.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-close:active {
  transform: scale(0.95);
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 100%;
    max-height: 100%;
  }

  .lightbox-image {
    max-height: 80vh;
    border-radius: 0;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
  }

  .lightbox-caption {
    font-size: 0.75rem;
    max-width: 95%;
  }
}

/* 포스트 본문 이미지 스타일 개선 */
.prose img {
  transition: opacity 0.2s ease;
}

.prose img:hover {
  opacity: 0.9;
}
