@charset "utf-8";

:root {
    --ebook-primary: #173e70;
    --ebook-dark: #0d294c;
    --ebook-gold: #c9a45c;
    --ebook-text: #374151;
    --ebook-muted: #6b7280;
    --ebook-line: #e2e8f0;
    --ebook-soft: #f5f8fc;
}

#glory-ebook-list,
#glory-ebook-list * {
    box-sizing: border-box;
}

#glory-ebook-list {
    width: 100%;
    color: var(--ebook-text);
    font-family: "Noto Sans KR", sans-serif;
}

#glory-ebook-list a {
    color: inherit;
    text-decoration: none;
}

.ebook-list-head {
    display: flex;
    margin-bottom: 30px;
    padding: 28px 30px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, #f9fbfe, #eef3f9);
    border: 1px solid var(--ebook-line);
    border-radius: 14px;
}

.ebook-list-kicker {
    color: var(--ebook-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .15em;
}

.ebook-list-head h2 {
    margin: 7px 0 8px;
    color: var(--ebook-dark);
    font-size: clamp(27px, 4vw, 40px);
}

.ebook-list-head p {
    margin: 0;
    color: var(--ebook-muted);
    line-height: 1.7;
}

.btn_bo_user {
    display: flex;
    margin: 0;
    padding: 0;
    gap: 7px;
    list-style: none;
}

.btn_bo_user li {
    position: relative;
}

.btn_bo_user .btn,
.btn_bo_user button.btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    background: var(--ebook-primary) !important;
    border: 1px solid var(--ebook-primary) !important;
    border-radius: 7px;
    cursor: pointer;
}

.more_opt {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    z-index: 100;
    min-width: 130px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--ebook-line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(13,41,76,.15);
}

.more_opt button {
    width: 100%;
    padding: 9px 10px;
    color: var(--ebook-text);
    text-align: left;
    background: #fff;
    border: 0;
    white-space: nowrap;
}

.ebook-all-check {
    margin-bottom: 16px;
}

.selec_chk {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.chk_box label {
    position: relative;
    display: inline-flex;
    min-height: 24px;
    padding-left: 27px;
    align-items: center;
    cursor: pointer;
}

.chk_box label > span {
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.chk_box input:checked + label > span {
    background: var(--ebook-primary);
    border-color: var(--ebook-primary);
}

.chk_box input:checked + label > span::after {
    content: "✓";
    position: absolute;
    top: -2px;
    left: 3px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.ebook-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.ebook-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ebook-line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(13,41,76,.09);
    transition: transform .22s ease, box-shadow .22s ease;
}

.ebook-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(13,41,76,.15);
}

.ebook-check {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}

.ebook-cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #e9eef5;
}

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

.ebook-cover-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 25px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: #fff;
    text-align: center;
    background:
        linear-gradient(145deg, rgba(201,164,92,.88), rgba(13,41,76,.96));
}

.ebook-cover-placeholder i {
    font-size: 54px;
}

.ebook-cover-placeholder strong {
    font-size: 16px;
    letter-spacing: .14em;
}

.ebook-pdf-state {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 9px;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ebook-card-body {
    padding: 19px 19px 21px;
}

.ebook-category {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 8px;
    color: #7a5516 !important;
    background: #fff5dc;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ebook-card h3 {
    margin: 0;
    color: var(--ebook-dark);
    font-size: 19px;
    line-height: 1.45;
}

.ebook-card-body > p {
    min-height: 72px;
    margin: 12px 0 15px;
    color: var(--ebook-muted);
    font-size: 14px;
    line-height: 1.7;
}

.ebook-meta {
    display: flex;
    margin-bottom: 16px;
    gap: 12px;
    color: #8792a2;
    font-size: 12px;
}

.ebook-card-actions {
    display: flex;
    gap: 8px;
}

.ebook-read-button,
.ebook-edit-button {
    display: inline-flex;
    min-height: 40px;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
}

.ebook-read-button {
    flex: 1;
    gap: 7px;
    color: #fff !important;
    background: var(--ebook-primary);
}

.ebook-read-button.disabled {
    color: #8b1c1c !important;
    background: #fee2e2;
}

.ebook-edit-button {
    color: var(--ebook-primary) !important;
    background: #fff;
    border: 1px solid #ccd7e5;
}

.ebook-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    color: var(--ebook-muted);
    text-align: center;
    background: #fff;
    border: 1px solid var(--ebook-line);
    border-radius: 12px;
}

.pg_wrap {
    display: block;
    margin: 30px 0 0;
    text-align: center;
}

.bo_sch_wrap {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
}

.bo_sch_bg {
    position: absolute;
    inset: 0;
    background: rgba(13,41,76,.55);
}

.bo_sch {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: min(520px, calc(100% - 30px));
    padding: 24px;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid var(--ebook-line);
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(0,0,0,.22);
}

.bo_sch h3 {
    margin: 0 0 15px;
    color: var(--ebook-dark);
}

.bo_sch form {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 9px;
}

.bo_sch select,
.bo_sch .sch_input {
    width: 100%;
    height: 44px;
    padding: 0 11px;
    background: #fff;
    border: 1px solid #d5dee9;
    border-radius: 7px;
}

.sch_bar {
    position: relative;
}

.sch_bar .sch_input {
    padding-right: 44px;
}

.sch_btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    color: var(--ebook-primary);
    background: transparent;
    border: 0;
}

.bo_sch_cls {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    color: var(--ebook-muted);
    background: transparent;
    border: 0;
}

@media (max-width: 980px) {
    .ebook-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 680px) {
    .ebook-list-head {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px 18px;
    }

    .ebook-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .ebook-card-body > p {
        min-height: 0;
    }

    .bo_sch form {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Compact E-Book cards
   기능은 그대로 유지하고 목록 카드·표지·버튼 크기만 축소
   ========================================================= */

#glory-ebook-list .ebook-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 180px));
    justify-content: start;
    gap: 18px;
}

#glory-ebook-list .ebook-card {
    width: 100%;
    max-width: 180px;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(13, 41, 76, .08);
}

#glory-ebook-list .ebook-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 13px 28px rgba(13, 41, 76, .13);
}

#glory-ebook-list .ebook-cover {
    aspect-ratio: 3 / 4;
    min-height: 0;
}

#glory-ebook-list .ebook-cover-placeholder {
    padding: 14px;
    gap: 10px;
}

#glory-ebook-list .ebook-cover-placeholder i {
    font-size: 34px;
}

#glory-ebook-list .ebook-cover-placeholder strong {
    font-size: 12px;
    letter-spacing: .1em;
}

#glory-ebook-list .ebook-card-body {
    padding: 12px 12px 14px;
}

#glory-ebook-list .ebook-category {
    margin-bottom: 5px;
    padding: 3px 7px;
    font-size: 10px;
}

#glory-ebook-list .ebook-card h3 {
    font-size: 16px;
    line-height: 1.4;
}

#glory-ebook-list .ebook-card-body > p {
    min-height: 38px;
    margin: 7px 0 10px;
    font-size: 12px;
    line-height: 1.55;
}

#glory-ebook-list .ebook-meta {
    margin-bottom: 10px;
    gap: 8px;
    font-size: 11px;
}

#glory-ebook-list .ebook-card-actions {
    gap: 6px;
}

#glory-ebook-list .ebook-read-button,
#glory-ebook-list .ebook-edit-button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
}

#glory-ebook-list .ebook-edit-button {
    flex: 0 0 auto;
}

#glory-ebook-list .ebook-check {
    top: 7px;
    left: 7px;
}

@media (max-width: 980px) {
    #glory-ebook-list .ebook-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 170px));
        gap: 16px;
    }

    #glory-ebook-list .ebook-card {
        max-width: 170px;
    }
}

@media (max-width: 680px) {
    #glory-ebook-list .ebook-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #glory-ebook-list .ebook-card {
        width: 100%;
        max-width: none;
    }

    #glory-ebook-list .ebook-card-body {
        padding: 10px 10px 12px;
    }

    #glory-ebook-list .ebook-card h3 {
        font-size: 15px;
    }

    #glory-ebook-list .ebook-card-body > p {
        font-size: 11px;
    }

    #glory-ebook-list .ebook-read-button,
    #glory-ebook-list .ebook-edit-button {
        min-height: 32px;
        padding: 0 8px;
        font-size: 11px;
    }
}


/* PDF 첫 페이지 자동 썸네일 */
#glory-ebook-list .ebook-pdf-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    opacity: 0;
    transition: opacity .2s ease;
}

#glory-ebook-list .ebook-pdf-thumb.is-ready {
    opacity: 1;
}

#glory-ebook-list .ebook-thumb-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 12px;
    color: #718096;
    background: linear-gradient(135deg, #f4f7fb, #e8eef6);
    font-size: 11px;
    text-align: center;
}


/* PDF / EPUB 형식 표시 */
#glory-ebook-list .ebook-format-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    padding: 4px 7px;
    color: #fff;
    background: #64748b;
    border-radius: 999px;
    box-shadow: 0 3px 9px rgba(0,0,0,.16);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
}

#glory-ebook-list .ebook-format-badge.pdf {
    background: #b42318;
}

#glory-ebook-list .ebook-format-badge.epub {
    background: #5b3db8;
}

#glory-ebook-list .epub-placeholder {
    background: linear-gradient(145deg, #7658cf, #243b75);
}

#glory-ebook-list .epub-placeholder small {
    color: rgba(255,255,255,.75);
    font-size: 11px;
}
/* EPUB 내부 표지 자동 썸네일 */
#glory-ebook-list .ebook-epub-thumb {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    background: #fff;
    object-fit: contain;
    transition: opacity .2s ease;
}

#glory-ebook-list .ebook-epub-thumb.is-ready {
    opacity: 1;
}

#glory-ebook-list .ebook-thumb-loading.is-fallback {
    color: #fff;
    background:
        linear-gradient(145deg, #7658cf, #243b75);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .12em;
}
#glory-ebook-list .ebook-uploaded-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}