/* 推し活ページ固有スタイル */

/* ============================================================
   外側ラッパー（縦積み）
   ============================================================ */
.oshikatsu-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================================
   全体ラッパー（870×700px、中央配置）
   ============================================================ */
.oshikatsu-wrap {
    width: 1000px;
    height: 700px;
    display: flex;
    margin: 0 auto;
}

/* ============================================================
   左右フレーム（本の紙の端っこ）
   ============================================================ */
.oshikatsu-frame {
    width: 50px;
    height: 700px;
    flex-shrink: 0;
}

.oshikatsu-frame img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.oshikatsu-frame--left img {
    transform: translateX(5px);
}

.oshikatsu-frame--right img {
    transform: translateX(-5px);
}

/* ============================================================
   中央ペーパーエリア（750×700px）
   ============================================================ */
.oshikatsu-paper {
    flex: 1;
    height: 700px;
    background-image: url('../img/common/book_paper.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    position: relative;
    overflow: visible;
}

/* 中央綴じ影 */
.oshikatsu-shadow--left,
.oshikatsu-shadow--right {
    position: absolute;
    top: 0;
    height: 100%;
    width: 80px;
    pointer-events: none;
    z-index: 10;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.oshikatsu-shadow--left {
    right: 50%;
    background-image: url('../img/common/book_paper_shadow_left.png');
    z-index: 100;
}

.oshikatsu-shadow--right {
    left: 50%;
    background-image: url('../img/common/book_paper_shadow_right.png');
    z-index: 100;
}

/* ============================================================
   常時表示の左ページ（静的・turn.js 管理外）
   ============================================================ */
.oshikatsu-page-left-static {
    position: absolute;
    background-image: url('../img/common/book_paper.png');
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
}

/* TOPへ戻るボタン */
.oshikatsu-home-btn {
    position: absolute;
    bottom: -10px;
    right: -47px;
    display: block;
    z-index: 200;
    transition: opacity 0.2s;
}

.oshikatsu-home-btn:hover {
    opacity: 0.75;
}

.oshikatsu-home-btn img {
    width: 80px;
    height: auto;
    display: block;
}

/* ============================================================
   ページエリア
   ============================================================ */
#book-oshikatsu {
    width: 100%;
    height: 100%;
}

/* スプレッド（1ページ分の見開き） */
.oshikatsu-spread {
    display: none;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.oshikatsu-spread:first-child {
    display: grid;
}

.oshikatsu-page {
    padding: 40px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   2×2 グリッド・カード
   ============================================================ */
.oshikatsu-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.oshikatsu-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    overflow: hidden;
    text-align: center;
    color: black;
}

.oshikatsu-card--1 {
    background-image: url('../img/fun_oshikatsu/card_1.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.oshikatsu-card--2 {
    background-image: url('../img/fun_oshikatsu/card_2.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.oshikatsu-card--3 {
    background-image: url('../img/fun_oshikatsu/card_3.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.oshikatsu-card--4 {
    background-image: url('../img/fun_oshikatsu/card_4.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.oshikatsu-card__body {
    font-size: 12px;
    line-height: 1.6;
    overflow: hidden;
}

.oshikatsu-card__author {
    font-size: 0.75rem;
    text-align: right;
    margin-top: 8px;
    color: #666;
}

/* ============================================================
   ページナビゲーション
   ============================================================ */
.oshikatsu-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.oshikatsu-nav__btn {
    background: none;
    border: 1px solid #c0a880;
    color: #1a0a20;
    font-size: 1.6rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.oshikatsu-nav__btn:hover {
    background-color: #c0a880;
}

.oshikatsu-nav__page {
    font-size: 0.85rem;
    color: #1a0a20;
    min-width: 60px;
    text-align: center;
}

/* ============================================================
   画像モーダル
   ============================================================ */
.js-modal-trigger {
    cursor: zoom-in;
}

.oshikatsu-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.oshikatsu-modal.is-open {
    display: flex;
}

.oshikatsu-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.oshikatsu-modal__inner {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oshikatsu-modal__img {
    max-width: 90vw;
    max-height: 90vh;
    display: block;
    object-fit: contain;
}

.oshikatsu-modal__close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

/* ============================================================
   レスポンシブ（768px 以下）
   ============================================================ */
@media screen and (max-width: 768px) {
    .oshikatsu-wrap {
        width: 100%;
        height: 520px;
    }

    /* 右フレームは非表示、左フレームのみ表示 */
    .oshikatsu-frame--right {
        display: none;
    }

    .oshikatsu-frame--left {
        display: block;
        height: 520px;
        width: 50px;
        flex-shrink: 0;
    }

    .oshikatsu-frame--left img {
        width: 50px;
        height: 520px;
        object-fit: fill;
    }

    .oshikatsu-paper {
        height: 520px;
    }

    .oshikatsu-shadow--left,
    .oshikatsu-shadow--right {
        display: none;
    }

    .oshikatsu-home-btn {
        right: 8px;
        bottom: -40px;
    }

    .paper-spread {
        padding: 40px 12px 12px;
    }

    .oshikatsu-grid {
        gap: 8px;
    }

    .oshikatsu-card__body {
        font-size: 10px;
    }

    .oshikatsu-card__author {
        font-size: 0.65rem;
    }

    .oshikatsu-home-btn img {
        width: 65px;
    }
}
