/*
 * K-BOOKS GLOBAL CONTENT PROTECT v1
 * 학습 본문/원본 페이지/삽화 보호
 * 메뉴·검색·입력·버튼은 정상 사용
 */

body.kbooks-protect-active .kbooks-protected-content{
    position:relative;
    -webkit-user-select:none;
    user-select:none;
    -webkit-touch-callout:none;
}

body.kbooks-protect-active .kbooks-protected-content input,
body.kbooks-protect-active .kbooks-protected-content textarea,
body.kbooks-protect-active .kbooks-protected-content select,
body.kbooks-protect-active .kbooks-protected-content [contenteditable="true"],
body.kbooks-protect-active .kbooks-protected-content .kbooks-allow-copy{
    -webkit-user-select:text!important;
    user-select:text!important;
    -webkit-touch-callout:default!important;
}

body.kbooks-protect-active .kbooks-protected-content img{
    -webkit-user-drag:none;
    user-drag:none;
    -webkit-touch-callout:none;
    user-select:none;
}

/* 전체 학습 글에 아주 옅은 출처 워터마크 */
.kbooks-page-wm{
    position:absolute;
    z-index:25;
    left:50%;
    transform:translateX(-50%) rotate(-26deg);
    width:135%;
    text-align:center;
    color:rgba(15,45,60,.03);
    font-size:clamp(13px,1.2vw,18px);
    font-weight:900;
    letter-spacing:.12em;
    line-height:1;
    white-space:nowrap;
    pointer-events:none;
    user-select:none;
}

/* 책 원본/WebP/삽화 영역은 조금 더 분명하게 */
.kbooks-protected-media{
    position:relative!important;
    overflow:hidden;
}

.kbooks-wm-layer{
    position:absolute;
    inset:0;
    z-index:30;
    pointer-events:none;
    user-select:none;
    display:flex;
    flex-direction:column;
    justify-content:space-evenly;
    align-items:center;
    overflow:hidden;
}

.kbooks-wm-layer span{
    display:block;
    width:145%;
    transform:rotate(-26deg);
    text-align:center;
    color:rgba(15,45,60,.038);
    font-size:clamp(11px,1vw,16px);
    line-height:1;
    font-weight:900;
    letter-spacing:.1em;
    white-space:nowrap;
    text-shadow:0 0 1px rgba(255,255,255,.65);
}

/* 차단 안내 */
#kbooksProtectToast{
    position:fixed;
    z-index:2147483000;
    left:50%;
    bottom:30px;
    transform:translate(-50%,12px);
    max-width:min(90vw,430px);
    padding:10px 14px;
    border-radius:9px;
    background:rgba(14,35,46,.94);
    color:#fff;
    font-size:12px;
    font-weight:750;
    line-height:1.45;
    text-align:center;
    box-shadow:0 10px 30px rgba(0,0,0,.18);
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease,transform .18s ease;
}

#kbooksProtectToast.show{
    opacity:1;
    transform:translate(-50%,0);
}

/* 인쇄로 본문 복제 억제 */
@media print{
    body.kbooks-protect-active .kbooks-protected-content{
        display:none!important;
    }
    body.kbooks-protect-active::before{
        content:"K-BOOKS 무료 웹 학습자료 · 무단 복제·전재·재배포를 금합니다.  k-books.kr";
        display:block!important;
        padding:35px!important;
        color:#111!important;
        background:#fff!important;
        font:700 15px/1.7 sans-serif!important;
    }
}

/* 모바일 */
@media(max-width:700px){
    .kbooks-page-wm{
        font-size:13px;
        color:rgba(15,45,60,.028);
    }
    .kbooks-wm-layer span{
        font-size:11px;
    }
}

/* v1.2: 일반 본문에는 워터마크를 표시하지 않습니다. */
.kbooks-page-wm{display:none!important}
