@charset "utf-8";

.latest-gallery .list ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* 카드 간격 */
}

.latest-gallery .list li {
    position: relative;
    overflow: hidden;
}


.latest-gallery .list li .gall_con {
    position: relative;
    display: block;
}

.latest-gallery .list li .gall_con img {
    width: 100%;
}

.latest-gallery .list li .gall_con:after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 60%);
    transition: all .2s;
    opacity: 0;
    visibility: hidden;
}

.latest-gallery .list li .gall_con:hover:after {
    opacity: 1;
    visibility: visible;
}

/* 텍스트가 들어가면 */
.latest-gallery .list li .gall_con .gall_text_href {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px;
    color: #fff;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    z-index: 3;
}

.latest-gallery .list li .gall_con:hover .gall_text_href {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}


/* 모달 전체 */
#galleryModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow: hidden;
}

#galleryModal .modal-content {
    display: flex;
    align-items: flex-start;
    gap: 100px;
    width: 100%;
    height: calc(100% - 160px);
    position: relative;
    margin: 80px;
    overflow: hidden;
}

/* 썸네일 */
#galleryModal .thumbs-swiper {
    width: 120px;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.main-swiper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: auto;
    max-height: 90vh;

}

/* 공통 */
#galleryModal .swiper-slide img {

    width: 100%;
}

#galleryModal .main-swiper .swiper-slide img {

    object-fit: contain;
    /* 비율 유지 + 잘림 없음 */
    object-position: center;
}

#galleryModal .main-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}


#galleryModal .thumbs-swiper .swiper-slide {
    width: 100%;
    height: auto;
    opacity: 0.5;
    cursor: pointer;
}

#galleryModal .thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}


#galleryModal .main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 닫기 버튼 */
#galleryModal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
}

body.modal-open,
html.modal-open {
    overflow: hidden;
    height: 100%;
}

#cursor_div {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-9999px, -9999px);
    pointer-events: none;
    z-index: 9999;
}

#cursor_div .cursor {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    /* scroll 과 화살표 사이 간격 */
    color: #fff;
    font-size: 14px;
    background: rgb(0, 0, 0, .2);
    height: 35px;
    width: 90px;
    border-radius: 50px;
    justify-content: center;
}



#cursor_div .arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    transform: translateY(-6px);
    /* 🔥 화살표 전체를 위로 올림 */
}

#cursor_div .arrow {
    width: 8px;
    height: 8px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    animation: arrow-down 1.5s infinite;
}

#cursor_div .arrow:nth-child(1) {
    animation-delay: 0s;
}

#cursor_div .arrow:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes arrow-down {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(-45deg);
    }

    50% {
        opacity: 1;
        transform: translateY(4px) rotate(-45deg);
    }

    100% {
        opacity: 0;
        transform: translateY(8px) rotate(-45deg);
    }
}

#cursor_div .cursor.on {
    opacity: 1;
}

#cursor_div .cursor.dragging {
    transform: scale(0.9);
    opacity: 0.9;
}

/* 모바일 전용 페이징 */
.mobile-pagination {
    display: none;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .mobile-pagination {
        display: block;
    }
}


@media (max-width:768px) {
    .modal-content .thumbs-swiper {
        display: none;
    }

    .modal-content {
        height: 100%;
        margin: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #cursor_div {
        display: none;
    }
}
