/* 팝업 */
#popParent {
    display: none;
}
.pop-parent {
    z-index: 9999;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    padding-bottom: 40px;
    background-color: rgba(0, 0, 0, 0.35);

    .pop {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 500px;

        .btn-toggle {
            width: 40px;
            height: 40px;
            position: relative;
            background-color: black;
            cursor: pointer;

            img {
                width: auto;
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%) rotate(-90deg);
                transition: all 0.3s;
            }
        }
        .swiper-btn-control {
            width: 8px;
            height: 11px;
            margin-left: 16px;
            position: relative;
            top: 2px;
        }
        .btn-close {
            width: 40px;
            height: 40px;
            background-color: black;

            > i {
                color: #fff;
            }
        }
    }
    .pop-btns {
        display: flex;
        justify-content: space-between;
        width: 100%;
        height: 40px;
        background-color: #3c3c3c;

        a {
            color: #fff;
            padding: 7px 14px;
        }
        #oneday_check {
            position: absolute;
            clip: rect(0, 0, 0, 0);
        }
        #oneday_check + label {
            display: flex;
            align-items: center;
            padding: 0 10px;
            font-size: 14px;
            color: #fff;
            cursor: pointer;
        }
        #oneday_check + label:before {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            margin-right: 10px;
            border: 1px solid #fff;
        }
    }
    .popupSwiper {
        background-color: #fff;
    }
    .swiper-pagination {
        pointer-events: none;
        top: 21px;
        left: auto;
        right: 20px;
        width: fit-content;
    }
    .swiper-pagination-bullet {
        flex: 0 0 auto;
        width: 10px;
        height: 10px;
        margin: 0 5px;
        border-radius: 0;
        border: 1px solid white;
        opacity: 0.5;
        background-color: transparent;
    }
    .swiper-pagination-bullet-active {
        background-color: #fff;
        opacity: 1;
    }
    .active {
        right: -400px;

        .btn-toggle {
            transform: rotate(180deg);
        }
    }
    .m-ratioBox-wrap {
        width: 100%;
        padding-top: 100%;
        position: relative;
        overflow: hidden;

        .m-ratioBox {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-size: cover;
            background-position: center;
            background-color: var(--sub_color01);
        }
        img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translateY(-50%) translateX(-50%);
            z-index: 1;
        }
        iframe {
            width: 105%;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translateY(-50%) translateX(-50%);
            z-index: 1;
        }
    }

    /* 1279px 이하 */
    @media screen and (max-width: 1279px) {
        .pop {
            width: calc(100% - 40px);
        }
        &.active {
            right: calc(- (100% - 40px));
        }
    }

    /* 1023px 이하 */
    @media screen and (max-width: 1023px) {
        .floating-btns-wrap {
            bottom: 16px;
            right: 16px;
        }
    }

    /* 767px 이하 */
    @media screen and (max-width: 767px) {
        top: 50%;
        right: unset;
        left: 50%;
        transform: translate(-50%, -50%);

        .pop-btns {
            width: 100%;
            justify-content: space-between;
        }
        .pop .btn-toggle {
            display: none;
        }
        .pop .btn-close {
            display: block;
        }
    }
}

/*
=============================================================
-------------------------커스텀스타일-------------------------
=============================================================
*/

/* 스티키 메뉴 */
@media screen and (min-width: 1400px) {
    #sticky-menu {
        position: fixed;
        width: 24px;
        height: 24px;
        user-select: none;
        z-index: 99999;

        .menu-btn {
            position: relative;
            width: 100%;
            height: 100%;
            background: url("/images/logo/menu_logo.svg") no-repeat 0 0 / cover;
            cursor: grab;
        }
        .menu-btn:active {
            cursor: grabbing;
        }

        .menu {
            position: absolute;
            top: 0;
            left: calc(100% + 8px);
            display: none;
            width: 215px;
            height: 24px;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            align-items: center;
            background: rgba(245, 245, 245, 0.5);

            &.open {
                display: grid;
            }

            a {
                padding-inline: 8px;
                font-size: 12px;
                font-weight: 300;

                &:hover {
                    opacity: 0.5;
                }
            }
        }
    }
}
@media screen and (max-width: 1399px) {
    #sticky-menu {
        display: none;
    }
}

/* 인덱스 */
#index {
    .gallery-container {
        .gallery {
            width: calc(100% - 32px);
            max-width: 1440px;
            display: flex;
            flex-wrap: wrap;
            gap: 60px 14px;
            margin: 60px auto;
        }
        .main-card,
        .card {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 6px;

            a {
                display: flex;
                flex-direction: column;
                width: 100%;
                height: auto;

                .card-txt {
                    width: 100%;
                    display: flex;
                    flex-direction: column;
                    gap: 6px;
                }

                img {
                    width: 100%;
                    height: auto;
                    object-fit: cover;
                }
            }
        }
        .main-card {
            width: calc(100% - 32px);
            max-width: 1670px;
            margin: 0 auto;

            a {
                max-width: 1286px;
            }
        }
        .card {
            width: 100%;
            max-width: 60%;
        }
    }

    /* 모바일: 1개 */
    @media screen and (max-width: 767px) {
        .gallery-container .gallery {
            gap: 40px !important;

            .card {
                width: 100% !important;
                max-width: 100% !important;
            }
        }
    }

    @media screen and (min-width: 768px) {
        .main-card,
        .card {
            a {
                gap: 6px;

                img {
                    &:hover,
                    &:active {
                        opacity: 0.5;
                    }
                }
            }
        }
    }
    @media screen and (max-width: 767px) {
        .main-card,
        .card {
            a {
                gap: 6px;

                img {
                    &:active {
                        opacity: 0.5;
                    }
                }
            }
        }
    }
}

/* 프로젝트 */
#project {
    position: relative;

    .filter-buttons-container {
        position: sticky;
        top: calc(100vh - 0px);
        left: 0;
        width: 100%;
        max-width: 1440px;
        height: 0;
        margin: 0 auto;
        z-index: 9999;

        #filter-buttons {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 54px;
            overflow: hidden;

            display: flex;
            flex-wrap: wrap-reverse;
            flex-direction: row;
            gap: 17px 20px;
            background: rgba(34, 34, 34, 0.8);

            button {
                font-size: 14px;
                color: rgba(255, 255, 255, 0.5);

                &.active-filter {
                    color: rgba(255, 255, 255, 1);
                }
            }

            .filter-plus {
                position: absolute;
                bottom: 15px;
                right: 15px;
                width: 27px;
                height: 27px;
                display: flex;
                align-items: center;
                justify-content: center;
                overflow: hidden;
                font-size: 20px;
                color: rgba(255, 255, 255, 1);
                transition: all 0.3s;

                &.active-btn {
                    transform: rotate(45deg);
                }
            }
        }
    }

    .gallery-container {
        padding-bottom: 245px;
        margin-top: -20px;
        min-height: 100vh;

        .gallery {
            width: calc(100% - 12px);
            max-width: 1460px;
            margin-inline: auto;

            .card {
                height: auto;
                padding: 20px 10px;
                display: flex;
                flex-direction: column;
                gap: 6px;

                a {
                    display: flex;
                    flex-direction: column;
                    gap: 10px;

                    .card-txt {
                        width: 100%;
                        height: auto;
                        display: flex;
                        flex-direction: column;
                        gap: 6px;
                    }

                    img {
                        width: 100%;
                        height: auto;
                        display: block;
                        object-fit: cover;
                    }
                }
            }
        }
    }

    @media screen and (min-width: 1024px) {
        #filter-buttons {
            padding: 20px 130px 20px 20px;
        }

        .gallery {
            .gallery-sizer,
            .card {
                width: calc(100% / 4);

                img {
                    &:hover,
                    &:active {
                        opacity: 0.5;
                    }
                }
            }
        }
    }
    @media screen and (max-width: 1023px) and (min-width: 768px) {
        #filter-buttons {
            padding: 20px 50px 20px 20px;
        }
        .gallery {
            .gallery-sizer,
            .card {
                width: calc(100% / 3);

                img {
                    &:hover,
                    &:active {
                        opacity: 0.5;
                    }
                }
            }
        }
    }
    @media screen and (max-width: 767px) and (min-width: 640px) {
        #filter-buttons {
            padding: 20px 50px 20px 20px;
        }
        .gallery {
            .gallery-sizer,
            .card {
                width: calc(100% / 2);

                img {
                    &:active {
                        opacity: 0.5;
                    }
                }
            }
        }
    }
    @media screen and (max-width: 639px) {
        #filter-buttons {
            padding: 20px;
            justify-content: center;
        }
        .gallery {
            .gallery-sizer,
            .card {
                width: calc(100% / 1);

                img {
                    &:active {
                        opacity: 0.5;
                    }
                }
            }
        }
    }
}

/* 프로젝트 상세 리사이즈 */
.resizer {
    width: 10px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
}
.resizer::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(98, 98, 98, 1);
    transform: translateX(-50%);
}
.resizer:hover::before,
.resizer.resizing::before {
    background: rgba(98, 98, 98, 0.3);
    width: 2px;
}
body.resizing {
    user-select: none;
    cursor: col-resize;
}

/* 드래그 */
.gutter {
    position: relative;
    background-color: red;
    background-repeat: no-repeat;
    background-position: 50%;
    box-sizing: border-box;
    width: 1px !important;
    height: 100%;
    padding: 0 20px;

    &.gutter-horizontal,
    &.gutter-vertical {
        cursor: col-resize;
        background-color: transparent;
    }

    &::after {
        position: absolute;
        top: 0;
        left: 50%;
        content: "";
        display: block;
        width: 1px;
        height: 100%;
        background-color: rgba(98, 98, 98, 1);
    }

    &:hover::after,
    &:active::after {
        background-color: rgba(98, 98, 98, 0.3);
    }
}

.lazy-card {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy-card.loaded {
    opacity: 1;
}

/* 뉴스 카드 리사이즈 */
.card,
.news-card {
    transform: none !important;
}

.project-detail-table:not(:has(*)) {
    display: none;
}
