@charset "UTF-8";

/* 토글 버튼 레이아웃 */
.ctp-badge-container {
    position: fixed;
    z-index: 1000000;
}

.ctp-badge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    user-select: none;
    transition: transform 0.25s ease, background-color 0.2s ease;
}
.ctp-badge:hover {
    transform: scale(1.08);
}

.ctp-style-book_tag {
    padding: 12px 4px 8px 4px;
    box-shadow: 3px 4px 15px rgba(0,0,0,0.22) !important;
}
.ctp-style-book_tag .ctp-badge-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
    font-size: 12px;
}
.ctp-style-book_tag .ctp-badge-close {
    top: 2px;
    right: 4px;
    font-size: 12px;
}

.ctp-badge-close {
    position: absolute;
    top: 3px;
    right: 7px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
}
.ctp-badge-close:hover {
    opacity: 1;
}
.ctp-badge-text {
    line-height: 1.1;
    text-transform: uppercase;
    text-align: center;
}
.ctp-badge-count {
    background: #ff4757;
    color: #ffffff !important;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    margin-top: 4px;
    line-height: 1.2;
}

/* 마우스 오버 드롭다운 */
.ctp-title-hover-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.25);
    list-style: none;
    padding: 6px 0;
    margin: 6px 0 0 0;
    z-index: 1000001;
}
.ctp-title-hover-list::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}
.ctp-title-hover-list li {
    padding: 10px 15px;
    font-size: 13px;
    color: #333333;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s, color 0.15s;
}
.ctp-title-hover-list li:last-child {
    border-bottom: none;
}
.ctp-title-hover-list li:hover {
    background: #2575fc;
    color: #ffffff;
}

/* 팝업 모달 전체 레이아웃 초기화 */
.ctp-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(2px);
    z-index: 999998;
    align-items: center;
    justify-content: center;
}

.ctp-popup-container {
    width: 92%;
    max-width: 900px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

/* 핵심 수정: 슬라이드 내부 여백 및 폰트 라인 높이 완전 제거 */
.ctp-slides-wrapper {
    position: relative;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

.ctp-slides-wrapper .slick-list,
.ctp-slides-wrapper .slick-track {
    margin: 0 !important;
    padding: 0 !important;
}

.ctp-slide-item {
    display: block !important;
    outline: none;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

.ctp-popup-link {
    display: block !important;
    width: 100%;
    text-decoration: none;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

.ctp-img-wrapper {
    width: 100%;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

/* 이미지 하단 공백 제거 */
.ctp-popup-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 80vh !important;
    display: block !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    vertical-align: bottom !important; /* 빈틈 방지 */
}

.ctp-custom-code-wrapper iframe, 
.ctp-custom-code-wrapper video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
}

/* Slick Carousel 슬라이더 컨트롤 */
.ctp-slides-wrapper .slick-prev { left: 15px; z-index: 10; }
.ctp-slides-wrapper .slick-next { right: 15px; z-index: 10; }
.ctp-slides-wrapper .slick-dots { bottom: 10px; margin: 0; }
.ctp-slides-wrapper .slick-dots li button:before { color: #ffffff; font-size: 10px; opacity: 0.7; }
.ctp-slides-wrapper .slick-dots li.slick-active button:before { opacity: 1; color: #2575fc; }

/* 핵심 수정: 이미지 바로 아래 밀착되는 버튼 바 레이아웃 */
.ctp-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 !important;
    line-height: 1.5 !important;
    font-size: 12px !important;
}

.ctp-btn {
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    line-height: 1.2;
}
.ctp-btn:hover {
    opacity: 0.85;
}
.ctp-btn-today .x-mark {
    margin-left: 4px;
    font-weight: bold;
}

@media screen and (max-width: 480px) {
    .ctp-footer {
        flex-direction: column;
        padding: 8px;
    }
    .ctp-btn {
        width: 100%;
        padding: 8px;
    }
}