/* BS4-Toon Skin - 만화 게시판 전용 스킨 */

/* =============================================
   공통
   ============================================= */
#bo_list_wrap, #bo_v {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =============================================
   작품 목록 뷰 (.toon-comic-*)
   ============================================= */
.toon-comic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0;
}

@media (min-width: 576px) {
    .toon-comic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .toon-comic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .toon-comic-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.toon-comic-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.toon-comic-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.toon-comic-card a {
    text-decoration: none;
    color: inherit;
}

/* 세로형 썸네일 (2:3 비율) */
.toon-comic-thumb-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 150%; /* 2:3 비율 */
    overflow: hidden;
    background: #f5f5f5;
}

.toon-comic-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.toon-comic-thumb-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #aaa;
    font-size: 40px;
}

.toon-comic-info {
    padding: 10px 12px;
    flex-grow: 1;
}

.toon-comic-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toon-comic-latest {
    font-size: 12px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 관리자 버튼 */
.toon-comic-admin {
    display: flex;
    border-top: 1px solid #f0f0f0;
}

.toon-comic-admin a {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 5px 4px;
    text-decoration: none;
    transition: background 0.15s;
}

.toon-comic-admin .btn-admin-edit {
    color: #856404;
    background: #fff8e1;
    border-right: 1px solid #f0f0f0;
}

.toon-comic-admin .btn-admin-edit:hover {
    background: #ffc107;
    color: #fff;
}

.toon-comic-admin .btn-admin-del {
    color: #721c24;
    background: #fff5f5;
}

.toon-comic-admin .btn-admin-del:hover {
    background: #dc3545;
    color: #fff;
}

/* =============================================
   에피소드 목록 뷰 (.toon-episode-*)
   ============================================= */
.toon-episode-header {
    display: flex;
    align-items: center;
    padding: 12px 0 16px;
    border-bottom: 2px solid #222;
    margin-bottom: 0;
}

.toon-episode-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-right: 16px;
    white-space: nowrap;
    transition: background 0.15s;
}

.toon-episode-back:hover {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.toon-episode-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.toon-episode-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toon-episode-item {
    border-bottom: 1px solid #eee;
    transition: background 0.1s;
}

.toon-episode-item:hover {
    background: #f9f9f9;
}

.toon-episode-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 8px;
    text-decoration: none;
    color: inherit;
}

.toon-episode-thumb {
    width: 170px;
    height: 115px;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
    flex-shrink: 0;
}

.toon-episode-thumb-placeholder {
    width: 170px;
    height: 115px;
    background: #eee;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 28px;
}

.toon-episode-meta {
    flex-grow: 1;
    min-width: 0;
}

.toon-episode-num {
    font-size: 13px;
    font-weight: 700;
    color: #0066cc;
    margin-bottom: 6px;
}

.toon-episode-subject {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toon-episode-date {
    font-size: 13px;
    color: #aaa;
    flex-shrink: 0;
    text-align: right;
    min-width: 80px;
}

/* 관리자 인라인 버튼 */
.toon-episode-admin {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.toon-episode-admin a {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    text-decoration: none;
}

.toon-episode-admin .btn-ep-edit {
    background: #fff8e1;
    color: #856404;
    border: 1px solid #ffc107;
}

.toon-episode-admin .btn-ep-del {
    background: #fff5f5;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =============================================
   에피소드 뷰 (.toon-view-*)
   ============================================= */
.toon-view-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* 이전/다음화 네비바 */
.toon-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    gap: 8px;
}

.toon-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
    min-width: 80px;
    justify-content: center;
}

.toon-nav-btn:hover {
    background: #222;
    color: #fff;
    border-color: #222;
    text-decoration: none;
}

.toon-nav-btn.disabled {
    color: #ccc;
    border-color: #eee;
    background: #f9f9f9;
    pointer-events: none;
    cursor: default;
}

.toon-nav-list {
    background: #555;
    color: #fff;
    border-color: #555;
    font-weight: 600;
}

.toon-nav-list:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.toon-nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* 뷰 헤더 (제목 + 날짜) */
.toon-view-header {
    padding: 12px 0;
}

.toon-view-comic-name {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.toon-view-episode-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px;
}

.toon-view-episode-info {
    font-size: 12px;
    color: #aaa;
}

/* 이미지 캔버스 영역 */
#toon-canvas-wrap {
    width: 100%;
    background: #1a1a1a;
    pointer-events: none; /* 컨테이너 전체 클릭/드래그 차단 */
}

#toon-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    -webkit-touch-callout: none;
    user-select: none;
    pointer-events: none; /* 개별 캔버스도 차단 */
}

/* 로딩 인디케이터 */
.toon-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

/* 뷰 하단 네비 (상단과 동일하나 border 반전) */
.toon-nav-bottom {
    margin-top: 0;
    border-top: 1px solid #eee;
    border-bottom: none;
    padding: 10px 0 16px;
}

/* =============================================
   페이지네이션 공통
   ============================================= */
.toon-pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0 0;
}

/* =============================================
   반응형
   ============================================= */
@media (max-width: 575px) {
    .toon-episode-date {
        display: none;
    }
    .toon-episode-thumb {
        width: 110px;
        height: 75px;
    }
    .toon-episode-thumb-placeholder {
        width: 110px;
        height: 75px;
        font-size: 20px;
    }
    .toon-episode-subject {
        font-size: 14px;
    }
    .toon-nav-btn {
        padding: 7px 10px;
        font-size: 13px;
        min-width: 60px;
    }
    .toon-comic-title {
        font-size: 13px;
    }
    .toon-comic-latest {
        font-size: 11px;
    }
    .toon-view-episode-title {
        font-size: 16px;
    }
}
