/* Archive.css */
#archive {
  padding-top: 5rem;
  overflow: hidden;
}

.section h2 {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  color: #111827;
}

.carousel-container {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* =============================================== */
/* Desktop & Tablet 캐러셀 (PC, iPad) */
/* =============================================== */
.desktop-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px; /* 포스터 간격 확대 */
  padding: 40px;
  position: relative;
}

.mobile-carousel {
  display: none;
}

.carousel-slide {
  position: relative;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: blur(1.5px);
  transform: scale(0.8);
  cursor: pointer;
  flex-shrink: 0;
}

.carousel-slide.slick-center {
  filter: blur(0px);
  transform: scale(1);
}

.carousel-slide img {
  width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.image-wrapper {
  position: relative;
  width: 300px;
  height: auto;
  overflow: visible; /* 호버 이미지가 나올 수 있도록 */
  border-radius: 12px;
}

.image-wrapper .default {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: none; /* 기본적으로 트랜지션 없음 */
}

.image-wrapper .hover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; /* width 100% 유지 */
  height: 50%; /* height 50% 유지 */
  object-fit: cover;
  opacity: 0;
  transition: none;
  border-radius: 8px;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* 그림자 효과 */
}

.image-wrapper .archive-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none; /* 기본적으로 클릭 불가 */
}

/* 중앙 슬라이드에서만 트랜지션과 호버 효과 활성화 */
.carousel-slide.slick-center .image-wrapper .default {
  transition: opacity 0.3s ease; /* 기본 이미지 투명도 트랜지션 */
}

.carousel-slide.slick-center .image-wrapper .hover {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.carousel-slide.slick-center .archive-link {
  pointer-events: auto; /* 중앙 슬라이드만 클릭 가능 */
}

/* PC에서만 호버 효과 (마우스가 있는 환경, 그리고 터치 디바이스가 아닌 경우) */
@media (hover: hover) and (pointer: fine) {
  .carousel-slide.slick-center .image-wrapper:hover .default {
    opacity: 0.3; /* 기본 이미지를 투명하게 */
  }
  
  .carousel-slide.slick-center .image-wrapper:hover .hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1); /* 약간 확대 효과 */
  }
}

/* 터치 디바이스(아이패드, 태블릿 등)에서는 중앙 슬라이드가 항상 호버 상태 유지 */
@media (hover: none) or (pointer: coarse) {
  .carousel-slide.slick-center .image-wrapper .default {
    opacity: 0.3; /* 항상 투명하게 */
  }
  
  .carousel-slide.slick-center .image-wrapper .hover {
    opacity: 1; /* 항상 보이게 */
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* 사이드 슬라이드에서는 호버 효과 완전 차단 */
.carousel-slide:not(.slick-center) .image-wrapper .hover {
  opacity: 0 !important; /* 항상 숨기기 */
  display: none; /* 아예 렌더링하지 않음 */
}

/* =============================================== */
/* Mobile 캐러셀 (아이패드 미니, 폰) */
/* =============================================== */
@media (max-width: 1024px) {
  #archive {
    padding-top: 4rem;
    padding-bottom: 2rem;
  }
  
  .section h2 {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
  }
  
  .desktop-carousel {
    gap: 40px; /* 태블릿에서는 간격 조금 줄이기 */
  }
  
  .carousel-slide {
    transform: scale(1) !important;
    filter: blur(0) !important;
  }

  .carousel-slide img,
  .image-wrapper {
    width: 250px;
  }
  
  /* 태블릿에서도 사이드 슬라이드 호버 차단 */
  .carousel-slide:not(.slick-center) .image-wrapper .hover {
    opacity: 0 !important;
    display: none;
  }
}

@media (max-width: 767px) {
  .desktop-carousel {
    display: none;
  }
  
  .mobile-carousel {
    display: block;
  }
  
  .mobile-slide-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
  }
  
  .mobile-slide {
    display: none;
    position: relative;
  }
  
  .mobile-slide.active {
    display: block;
  }
  
  .mobile-slide .image-wrapper {
    position: relative;
    width: 280px;
    height: auto;
    border-radius: 12px;
  }
  
  .mobile-slide .mobile-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    opacity: 0.3; /* 모바일에서 기본 이미지를 투명하게 */
  }
  
  /* Mobile에서 호버 이미지를 실제 img 태그로 표시 */
  .mobile-slide .hover-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    width: 100%;
    height: 50%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    object-fit: cover;
  }
}

/* =============================================== */
/* Mobile Dots */
/* =============================================== */
.slick-dots {
  display: none;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.slick-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #cccccc;
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 0;
}

.slick-dot.slick-active {
  background: #4f46e5;
}

@media (max-width: 767px) {
  .slick-dots {
    display: flex;
  }
}

/* =============================================== */
/* 작은 모바일 (아이폰 등) */
/* =============================================== */
@media (max-width: 480px) {
  .mobile-slide .image-wrapper {
    width: 250px;
  }
  
  .carousel-slide img,
  .image-wrapper {
    width: 220px;
  }
  
  .desktop-carousel {
    gap: 30px; /* 작은 화면에서는 간격 더 줄이기 */
  }
}