/* 큰 사진 섹션 (스크롤 시 고정되는 히어로 영역) */
.visual-section {
    position: sticky; top: 0; width: 100%; height: 100vh; 
    z-index: 1; overflow: hidden; background-color: black;
}

/* 이미지 컨테이너 및 슬라이드 관련 */
.image-carousel {
    position: relative; width: 100%; height: 100vh;
}

/* 슬라이드: 모바일 대응을 위해 absolute를 유지하고, PC에서 height: 100%를 가져야 함 */
.carousel-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; transition: opacity 1s ease-in-out; text-decoration: none;
    display: block; visibility: hidden; z-index: 5;
    overflow: hidden;          
}

.carousel-slide.active { opacity: 1; visibility: visible; z-index: 8; }
.carousel-slide:hover { cursor: pointer; }

/* 1. 이미지: 가로 100% + 원형 유지 + height: auto 설정 (기본은 100% 유지) */
.carousel-slide img {
    width: 100%;
    /* PC 환경에서는 부모의 100% 높이를 채우도록 설정 */
    height: 100%; 
    display: block;
    /* 원형 유지를 위해 object-fit: contain 대신 cover를 유지합니다. */
    /* object-fit: contain을 쓰면 좌우에 검은 여백이 생기므로, cover가 의도에 더 맞습니다. */
    object-fit: cover; 
    transition: transform 0.3s ease-out, filter 0.3s ease-out; 
}

/* 이미지 위에 텍스트 오버레이 */
.image-text-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    color: white; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); text-align: center; 
    opacity: 0; transition: opacity 1s ease-in-out; z-index: 10; width: 90%; max-width: 800px;
}
.image-text-overlay.active { opacity: 1; }
.image-text-overlay p { font-size: 1.8em; font-weight: bold; margin: 10px 0; line-height: 1.4; }
.image-text-overlay p:first-child { font-size: 2.5em; }
.image-text-overlay a {
    display: inline-block; margin-top: 20px; padding: 12px 30px; 
    background-color: rgba(255, 255, 255, 0.2); color: white; text-decoration: none; 
    border: 2px solid white; border-radius: 5px; font-size: 1.1em; 
    transition: background-color 0.3s, transform 0.3s;
}

/* 버튼, 닷 컨테이너는 동일 */
.nav-button {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.5); 
    color: white; border: none; padding: 15px 10px; cursor: pointer; 
    font-size: 24px; z-index: 20; user-select: none; transition: background 0.3s;
}
.prev-button { left: 0; border-radius: 0 5px 5px 0; }
.next-button { right: 0; border-radius: 5px 0 0 5px; }
.carousel-dots-container {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); 
    z-index: 20; display: flex; gap: 10px;
}
.dot {
    width: 10px; height: 10px; background: rgba(255, 255, 255, 0.5); 
    border-radius: 50%; cursor: pointer; transition: background 0.3s, transform 0.3s;
}
.dot.active { background: white; transform: scale(1.2); }

/* 콘텐츠 섹션은 동일 */
.content-section {
    position: relative; z-index: 2; /*padding: 80px 50px; min-height: 100vh; */
    box-sizing: border-box;
    /*background-color: white; box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);*/
}

/* =========================================================
   스크롤 애니메이션
   ========================================================= */

/* 1. 애니메이션 적용 전 초기 상태 (숨김/이동) */
/* h2와 .jura_container 모두 초기 상태는 같지만, 딜레이만 다릅니다. */
.content-section h2 { 
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; 
    /* h2 (제목)는 0.1초 딜레이로 먼저 나타남 */
    transition-delay: 0.1s; 
}

.content-section .jura_container {
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; 
    /* jura_container (본문)는 0.2초 딜레이로 h2 뒤에 나타남 */
    transition-delay: 0.2s; 
}

/* 2. 애니메이션 적용 후 상태 (보임/원래 위치) */
/* .animate 클래스 활성화 시, h2, p, .jura_container 모두 최종 상태로 전환 */
.content-section.animate h2, 
.content-section.animate p,
.content-section.animate .jura_container { 
    opacity: 1; 
    transform: translateY(0);
}
/* =========================================================
   스크롤 애니메이션 끝
   ========================================================= */

/* 2. 모바일 대응 미디어 쿼리 (가장 중요한 수정) */
@media (max-width: 767px) {
    
    /* visual-section 높이를 100vh에서 auto로 변경하여 이미지 높이에 맞춤. */
    .visual-section {
        height: auto;
        min-height: 0; /* min-height 설정 제거 */
        /* 스크롤 섹션이 sticky top: 0에서 잘 작동하도록 height: auto만 유지. */
    }

    .image-carousel {
        height: auto; /* 이미지 컨테이너도 높이를 auto로 설정 */
    }
    
    /* carousel-slide에서 absolute 제거 및 높이 auto 설정 (이미지를 감싸도록) */
    .carousel-slide {
        position: relative; /* absolute 해제하고 relative로 전환 */
        height: auto; 
        opacity: 1; /* 캐러셀 슬라이드가 높이를 결정할 수 있도록 강제로 보이게 함 */
        visibility: visible;
    }

    /* 활성 슬라이드를 제외한 나머지 슬라이드는 숨김 */
    .carousel-slide:not(.active) {
        height: 0;
        visibility: hidden;
        opacity: 0;
        position: absolute; /* 다시 absolute로 전환하여 공간 차지 막음 */
    }
    
    /* 이미지 높이도 auto로 설정하여 원본 비율 유지 */
    .carousel-slide.active img {
        height: auto; /* 이미지 자체의 비율에 맞게 높이 설정 */
        position: relative; /* absolute 제거 */
    }
}