@charset "UTF-8";

/* ==========================================
   共通：拡大（Expand）ボタンのデザイン
   ========================================== */
.cl-col-main .cl-expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 20px;
    line-height: 1.2;
    cursor: pointer;
    transition: 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.cl-col-main .cl-expand-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

/* ==========================================
   ▼▼▼ デバイスごとの拡大時挙動の設定 ▼▼▼
   ========================================== */

/* ------------------------------------------
   A. PC版（min-width: 769px）の拡大時スタイル
   ------------------------------------------ */
@media (min-width: 769px) {
    body .cl-layout-centerer div[id^="manga_"].is-expanded {
        width: 800px !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        display: block !important; 
        margin: 0 auto !important;
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-col-main {
        width: 800px !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-viewport {
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-viewport picture,
    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-viewport .cl-image {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        transform: none !important; 
        display: block !important;
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-col-sidebar {
        display: none !important;
    }
    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-mobile-swap-btn {
        display: inline-block !important;
    }
}

/* ------------------------------------------
   B. スマホ版（max-width: 768px）の拡大時スタイル
   ------------------------------------------ */
@media (max-width: 768px) {
    /* ★修正点：スマホでもFlexboxを完全に解除（display: block）して、画像が切れるのを防ぐ！ */
    body .cl-layout-centerer div[id^="manga_"].is-expanded {
        height: auto !important;
        max-height: none !important;
        display: block !important; 
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-col-main {
        height: auto !important;
        max-height: none !important;
        display: block !important; 
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-viewport {
        height: auto !important;
        min-height: 0 !important;
        display: block !important; 
        flex: none !important;
    }

    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-viewport picture,
    body .cl-layout-centerer div[id^="manga_"].is-expanded .cl-viewport .cl-image {
        height: auto !important;
        max-height: none !important;
        transform: none !important; 
        display: block !important; 
    }
}