/* ==========================================================
   📁 sections/section_cablecar.css (V3 - Interactive Gallery)
   🔹 데스크탑: Faded Zoom & Pan 인터랙티브 갤러리
   🔹 모바일: Swiper.js 기반 터치 갤러리
========================================================== */

/* ============================ */
/* 💻 Desktop Styles (>= 769px) */
/* ============================ */
#cablecar {
    padding: 0;
    margin: 0;
    background-color: #111;
    /* ✅ 스크롤 고정 효과를 위해 높이를 늘리고 overflow를 해제합니다. */
    height: 300vh;
    position: relative;
    overflow: visible;
}

.cablecar-sticky-wrapper {
    /* ✅ 이 래퍼가 화면 상단에 고정됩니다. */
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.cablecar-container {
    width: 100%;
    height: 100%;
    position: relative;
}


#cablecar-desktop-view {
    width: 100%;
    height: 100%;
    position: relative;
    display: block;
}

.cablecar-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cablecar-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* ✅ 시작 시 아래에 위치하며 약간 투명한 상태로 전환을 준비합니다. */
    transform: translateY(50px);
    /* ✅ 페이드인 및 슬라이드업 전환 효과 */
    transition: opacity 1.2s cubic-bezier(0.7, 0, 0.3, 1),
        transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
}

.cablecar-image.is-active {
    opacity: 1;
    /* ✅ 활성화 시 원래 위치로 부드럽게 올라옵니다. */
    transform: translateY(0);
}

.cablecar-content-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    padding: 5vw;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    box-sizing: border-box;
    pointer-events: none;
    /* 오버레이 자체는 클릭 방지 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 40%), linear-gradient(to right, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
}

.cablecar-text-content {
    max-width: 450px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.cablecar-text-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.cablecar-text-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #e0e0e0;
    margin-bottom: 3rem;
}

/* NEW: Cablecar specs styles - Text-based and grouped */
.cablecar-specs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em 1.2em;
    /* Row and column gap */
    pointer-events: auto;
}

.spec-group {
    display: flex;
    align-items: center;
    gap: 0 0.8em;
    /* Gap between items in a group */
    color: #fff;
    position: relative;
    padding-right: 1.2em;
    /* Space for the separator */
}

/* Add separator between groups */
.spec-group:not(:last-child)::after {
    content: "|";
    color: rgba(255, 255, 255, 0.4);
    font-weight: 100;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.spec-item .spec-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 0.4em;
}

.spec-item .spec-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Pretendard', sans-serif;
    white-space: nowrap;
}


.cablecar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    /* 내비게이션만 클릭 가능 */
}

.cablecar-nav-item {
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 16px 24px;
    transition: color 0.3s ease, transform 0.3s ease;
    text-align: right;
    position: relative;
}

.cablecar-nav-item:hover {
    color: #fff;
    transform: translateX(-10px);
}

.cablecar-nav-item.is-active {
    color: #fff;
    font-weight: 700;
}

.cablecar-nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background-color: #fff;
    transition: height 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.cablecar-nav-item.is-active::before {
    height: 100%;
}

.nav-item-title {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-item-desc {
    display: block;
    font-size: 0.85rem;
    opacity: 0;
    max-height: 0;
    transition: opacity 0.4s ease, max-height 0.4s ease;
}

.cablecar-nav-item.is-active .nav-item-desc {
    opacity: 1;
    max-height: 100px;
    /* 충분한 높이 */
    margin-top: 4px;
}


/* =========================== */
/* 📱 Mobile Styles (<= 768px) */
/* =========================== */

@media screen and (max-width: 768px) {
    #cablecar {
        /* ✅ 모바일에서는 스티키 효과를 해제하고 일반 섹션으로 되돌립니다. */
        height: auto;
        background-color: #f9f9f9;
        padding: 60px 0;
        overflow: hidden;
    }

    .cablecar-sticky-wrapper {
        /* ✅ 모바일에서 래퍼의 스티키 속성을 해제합니다. */
        position: static;
        height: auto;
        overflow: visible;
    }

    #cablecar-desktop-view {
        display: none;
    }

    #cablecar-mobile-view {
        display: block;
        width: 100%;
        height: auto;
    }

    .cablecar-mobile-header {
        text-align: center;
        padding: 0 20px 30px 20px;
    }

    .cablecar-mobile-header h2 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 8px;
        color: #222;
    }

    .cablecar-mobile-header p {
        font-size: 0.95rem;
        color: #666;
        margin: 0;
    }

    .cablecar-main-swiper {
        width: 100%;
        height: auto;
    }

    .cablecar-main-swiper .swiper-slide {
        width: 80%;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        transform: scale(0.9);
        transition: transform 0.4s ease;
    }

    .cablecar-main-swiper .swiper-slide-active {
        transform: scale(1);
    }

    .cablecar-main-swiper .swiper-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        aspect-ratio: 3 / 4;
        /* ✅ 4:3 비율에서 3:4 비율로 변경하여 세로 길이를 늘렸습니다. */
    }

    /* ✅ NEW: Mobile specs as a horizontal bar */
    .cablecar-specs-bar-mobile {
        display: flex;
        justify-content: space-between;
        /* 아이템을 균등하게 배분합니다. */
        align-items: center;
        /* --- 배경 박스 관련 스타일 제거 --- */
        margin: 24px auto 0;
        max-width: 500px;
        width: 100%;
        box-sizing: border-box;
    }

    .spec-item-bar-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: relative;
        flex: 1;
        min-width: 0;
    }

    /* ✅ 각 스펙 항목 사이에 세로 구분선을 다시 추가합니다. */
    .spec-item-bar-mobile:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 50%;
        /* 구분선 높이 */
        background-color: #e0e0e0;
        /* 구분선 색상 */
    }

    .spec-value-bar-mobile {
        font-size: 0.75rem;
        font-weight: 700;
        color: #212529;
        margin-bottom: 4px;
        line-height: 1.2;
    }

    .spec-label-bar-mobile {
        font-size: 0.7rem;
        color: #6c757d;
        font-weight: 500;
        white-space: nowrap;
    }

    .cablecar-text-container {
        text-align: center;
        padding: 30px 24px 20px 24px;
        min-height: 120px;
    }

    .cablecar-text-container .cablecar-title,
    .cablecar-text-container .cablecar-desc {
        opacity: 0;
        transform: translateY(15px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .cablecar-text-container.is-active .cablecar-title {
        opacity: 1;
        transform: translateY(0);
    }

    .cablecar-text-container.is-active .cablecar-desc {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.1s;
    }

    .cablecar-title {
        font-size: 1.4rem;
        font-weight: 700;
        color: #333;
        margin: 0 0 8px 0;
    }

    .cablecar-desc {
        font-size: 0.9rem;
        color: #555;
        line-height: 1.6;
        margin: 0;
    }

    .cablecar-pagination {
        position: static;
        margin-top: 10px;
    }

    .cablecar-pagination .swiper-pagination-bullet {
        background-color: #ccc;
        opacity: 1;
        transition: background-color 0.3s, width 0.3s;
    }

    .cablecar-pagination .swiper-pagination-bullet-active {
        background-color: #333;
        width: 20px;
        border-radius: 5px;
    }

    @media (max-width: 360px) {
        .spec-value-v2 {
            font-size: 1.1rem;
        }

        .spec-label-v2 {
            font-size: 0.7rem;
        }

        .cablecar-specs-bar-mobile {
            padding: 15px 5px;
        }
    }
}

/* --- Image Zoom Modal (Mobile) - UPDATED FOR SWIPER --- */
.cablecar-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cablecar-zoom-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.cablecar-zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    transition: transform 0.2s ease;
}

.cablecar-zoom-close:hover {
    transform: scale(1.1);
}

.cablecar-zoom-overlay .zoom-swiper {
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.cablecar-zoom-overlay.visible .zoom-swiper {
    opacity: 1;
    transform: scale(1);
}

.cablecar-zoom-overlay .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.cablecar-zoom-overlay .swiper-slide img {
    display: block;
    object-fit: contain;
}

.cablecar-zoom-overlay .swiper-slide img.portrait {
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    transform: rotate(0deg);
}

.cablecar-zoom-overlay .swiper-slide img.landscape {
    width: auto;
    height: auto;
    max-width: 100vh;
    max-height: 100vw;
    transform: rotate(90deg);
}

/* Modal Swiper Controls */
.cablecar-zoom-overlay .zoom-nav-button {
    color: #fff;
    --swiper-navigation-size: 32px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.cablecar-zoom-overlay .zoom-pagination {
    position: absolute;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: auto;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
}