﻿/* .files-in-detail , .comments-in-detail {display:none;} */
#dimodeBoard.board-detail .list-in-detail {
    margin-top: 0!important;
}

.book-viewer-section {
    width: 100%;
    margin: 0 auto 50px;
}

.book-viewer-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%; 
    padding: 35px 70px;

    overflow: hidden;
    background: #f4f2ed;
    box-sizing: border-box;
}

#bookViewer {
    margin: 0 auto;
}

#bookViewer canvas {
    max-width: 100%;
}

.book-arrow {
    position: absolute;
    top: 50%;
    z-index: 100;

    width: 48px;
    height: 48px;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.55);
    color: #fff;

    font-size: 17px;
    line-height: 48px;
    text-align: center;

    transform: translateY(-50%);
    cursor: pointer;
}

.book-arrow:hover,
.book-arrow:focus {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    outline: none;
}

.book-prev {
    left: 15px;
}

.book-next {
    right: 15px;
}

.book-page-info {
    padding-top: 14px;
    text-align: center;
    font-size: 15px;
    color: #555;
}


/* 상세 페이지 아래 이전 게시물 */

.list-in-detail .each-document .title-image {  
height:initial!important;
    aspect-ratio: 2 / 1;
}


/*
.list-in-detail {
    margin-top: 60px;
    padding-top: 35px;
    border-top: 1px solid #ddd;
}

.previous-gallery-title {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    color: #222;
}

.list-in-detail .theme-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.list-in-detail .each-document {
    float: none;
    width: auto;
    padding: 0;
}

.list-in-detail .each-document .title-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.list-in-detail .each-document .title {
    display: block;
    padding-top: 12px;
    line-height: 1.5;
    text-align: center;
}

.list-in-detail .theme-list::before,
.list-in-detail .theme-list::after {
    display: none;
}

*/


/* 태블릿 */

@media (max-width: 991px) {
    .book-viewer-wrap { 
        padding-right: 55px;
        padding-left: 55px;
    }

  /*   .list-in-detail .theme-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }*/
}


/* 모바일 */

@media (max-width: 767px) {
    .book-viewer-wrap { 
        padding: 20px 35px;
    }

    .book-arrow {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 13px;
    }

    .book-prev {
        left: 0;
    }

    .book-next {
        right: 0;
    }

    .previous-gallery-title {
        font-size: 20px;
    }

    /* .list-in-detail .theme-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }*/
}




.book-viewer-section {
        position: relative;
        width: 100%;
        max-width: 1400px;
        margin: 0 auto 25px;
    }


    /* =========================
       이미지 영역
    ========================= */

    .book-viewer-wrap {
        position: relative;

        width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;

        overflow: hidden;

        background: #111;
    }


    .book-slider {
        position: relative;

        width: 100%;

        overflow: hidden;

        touch-action: pan-y;
    }


    .book-slider-track {
        display: flex;

        width: 100%;

        transition: transform 0.38s ease;

        will-change: transform;
    }


    .book-slide {
        flex: 0 0 100%;

        width: 100%;
        min-width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;

        overflow: hidden;
    }


    /*
     * 기존 min-height 때문에
     * 생기던 쓸데없는 여백 제거
     */
    .book-image-wrap {
        position: relative;

        width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;

        overflow: hidden;

        min-height: 0;
    }


    .board-theme .theme-detail .detail-content .book-viewer-section img,
    .book-slide img {
        display: block;

        width: 100% !important;
        height: auto;

        max-width: none !important;

        margin: 0 !important;

        object-fit: contain;

        user-select: none;
        -webkit-user-select: none;
        -webkit-user-drag: none;

        transform-origin: center center;

        transition: transform 0.15s ease;

        cursor: zoom-in;

        will-change: transform;
    }


    .book-slide img.is-zoomed {
        cursor: grab;

        touch-action: none;
    }


    .book-slide img.is-dragging {
        cursor: grabbing;

        transition: none;
    }


    /* =========================
       좌우 화살표
    ========================= */

    .book-arrow {
        position: absolute;

        top: 50%;

        transform: translateY(-50%);

        z-index: 30;

        width: 46px;
        height: 74px;

        padding: 0;

        border: 0;
        border-radius: 5px;

        background: rgba(0, 0, 0, 0.45);

        color: #fff;

        font-size: 22px;

        cursor: pointer;

        opacity: 0.28;

        transition:
            opacity 0.2s ease,
            background 0.2s ease;
    }


    .book-arrow:hover {
        opacity: 1;

        background: rgba(0, 0, 0, 0.7);
    }


    .book-arrow:disabled {
        opacity: 0.07;

        cursor: default;
    }


    .book-arrow:disabled:hover {
        opacity: 0.07;
    }


    .book-prev {
        left: 12px;
    }


    .book-next {
        right: 12px;
    }


    /* =========================
       하단 컨트롤
       이미지 위에 띄움
    ========================= */

    .book-controls {
        position: absolute;

        left: 50%;
        bottom: 12px;

        transform: translateX(-50%);

        z-index: 40;

        display: flex;
        justify-content: center;
        align-items: center;

        gap: 12px;

        min-height: 0;

        margin: 0;

        padding: 6px 9px;

        border-radius: 5px;

        background: rgba(0, 0, 0, 0.4);

        color: #fff;

        opacity: 0.3;

        transition:
            opacity 0.2s ease,
            background 0.2s ease;
    }


    .book-controls:hover {
        opacity: 1;

        background: rgba(0, 0, 0, 0.7);
    }


    .book-page-info {
        order: 1;

        min-width: 45px;

        margin: 0;

        color: #fff;

        text-align: center;

        font-size: 13px;

        white-space: nowrap;
    }


    .book-zoom-controls {
        position: static;

        order: 2;

        display: flex;
        align-items: center;

        gap: 4px;
    }


    .book-zoom-btn {
        display: inline-flex;
        justify-content: center;
        align-items: center;

        width: 30px;
        height: 30px;

        padding: 0;

        border: 0;
        border-radius: 3px;

        background: rgba(255, 255, 255, 0.15);

        color: #fff;

        cursor: pointer;

        transition: background 0.15s ease;
    }


    .book-zoom-btn:hover {
        background: rgba(255, 255, 255, 0.32);
    }


    .book-zoom-value {
        display: inline-block;

        min-width: 45px;

        color: #fff;

        text-align: center;

        font-size: 12px;
    }


    /* =========================
       모바일
    ========================= */

    @media (max-width: 768px) {

        .book-viewer-section {
            margin: 0 auto 15px;
        }


        .book-viewer-wrap {
            width: 100%;
        }


        /*
         * 모바일에서는
         * 원본 비율 그대로 화면 폭에 맞춤
         */
        .book-slide img {
            width: 100% !important;
            height: auto;

            max-height: none;

            object-fit: contain;
        }


        /*
         * 모바일은 hover가 없으므로
         * 버튼이 너무 안 보이지 않게
         */
        .book-arrow {
            width: 34px;
            height: 52px;

            font-size: 17px;

            opacity: 0.55;

            background: rgba(0, 0, 0, 0.38);
        }


        .book-prev {
            left: 5px;
        }


        .book-next {
            right: 5px;
        }


        /*
         * 확대는 핀치로 하니까
         * 모바일에서는 확대 버튼 숨김
         */
        .book-zoom-controls {
            display: none;
        }


        /*
         * 페이지 숫자만 이미지 위에 표시
         */
        .book-controls {
            bottom: 7px;

            padding: 4px 9px;

            opacity: 0.55;

            background: rgba(0, 0, 0, 0.38);
        }


        .book-page-info {
            min-width: 35px;

            font-size: 12px;
        }

    }


    @media (max-width: 480px) {

        .book-arrow {
            width: 29px;
            height: 45px;

            font-size: 14px;
        }


        .book-prev {
            left: 3px;
        }


        .book-next {
            right: 3px;
        }


        .book-controls {
            bottom: 5px;
        }

    }





.book-mobile-modal {
    display: none;
}

@media (max-width: 768px) {

    .book-mobile-modal {
        position: fixed;
        inset: 0;

        z-index: 99999;

        width: 100vw;
        height: 100vh;

        background: #000;

        overflow: hidden;

        touch-action: none;
    }

    .book-mobile-modal.is-open {
        display: block;
    }

    .book-modal-stage {
        position: absolute;
        inset: 0;

        display: flex;
        justify-content: center;
        align-items: center;

        overflow: hidden;
    }

    #bookModalImage {
        display: block;

        width: 100%;
        height: auto;

        max-width: none !important;
        max-height: none !important;

        object-fit: contain;

        transform-origin: center center;

        user-select: none;
        -webkit-user-select: none;
        -webkit-user-drag: none;

        will-change: transform;
    }

    .book-modal-close {
        position: absolute;

        top: max(12px, env(safe-area-inset-top));
        right: 12px;

        z-index: 100;

        width: 42px;
        height: 42px;

        border: 0;
        border-radius: 50%;

        background: rgba(0, 0, 0, 0.5);
        color: #fff;

        font-size: 22px;

        opacity: 0.7;
    }

    .book-modal-arrow {
        position: absolute;

        top: 50%;

        transform: translateY(-50%);

        z-index: 90;

        width: 36px;
        height: 56px;

        border: 0;

        background: rgba(0, 0, 0, 0.35);
        color: #fff;

        font-size: 18px;

        opacity: 0.55;
    }

    .book-modal-prev {
        left: 4px;
    }

    .book-modal-next {
        right: 4px;
    }

    .book-modal-arrow:disabled {
        opacity: 0.12;
    }

    .book-modal-page-info {
        position: absolute;

        left: 50%;
        bottom: max(12px, env(safe-area-inset-bottom));

        transform: translateX(-50%);

        z-index: 100;

        padding: 5px 10px;

        border-radius: 20px;

        background: rgba(0, 0, 0, 0.45);

        color: #fff;

        font-size: 13px;
    }

}