/* 編集後記ページ固有スタイル */

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

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

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

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

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

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

/* ============================================================
   中央ペーパーエリア（750×700px）
   ============================================================ */
.henshukoki-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;
}

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

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

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

.henshukoki-paper .paper-spread {
    position: relative;
    align-items: stretch;
    justify-content: flex-start;
    padding: 48px 24px;
    box-sizing: border-box;
}

.henshukoki-paper .paper-spread::before,
.henshukoki-paper .paper-spread::after {
    content: '';
    display: block;
    width: 350px;
    height: 48px;
    background-size: 100% auto;
    background-repeat: no-repeat;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

.henshukoki-paper .paper-spread::before {
    top: 12px;
    background-image: url('../img/common/frame_top.png');
    background-position: top center;
}

.henshukoki-paper .paper-spread::after {
    bottom: 12px;
    background-image: url('../img/common/frame_bottom.png');
    background-position: bottom center;
}

/* ============================================================
   常時表示の左ページ（静的・turn.js 管理外）
   ============================================================ */
.henshukoki-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へ戻るボタン */
.henshukoki-home-btn {
    position: absolute;
    bottom: -10px;
    right: -47px;
    display: block;
    z-index: 200;
    transition: opacity 0.2s;
}

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

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

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

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

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

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

/* タイトル固定ページ */
.henshukoki-title-page {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 48px 0;
}

.henshukoki-title-page .henshukoki-list {
    flex: 1;
    padding: 0 24px;
    height: auto;
}

.henshukoki-title-page__header {
    flex: 0 0 33.33%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0 24px 16px;
    margin-top: 15px;
    gap: 6px;
    border-bottom: 1px solid rgba(192, 168, 128, 0.4);
}

.henshukoki-title-page__org {
    font-size: 1.5rem;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

.henshukoki-title-page__title {
    font-size: 3.2rem;
    color: #333;
    margin: 0;
    letter-spacing: 0.1em;
}

/* カードリスト（縦並び） */
.henshukoki-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0 20px 0 36px;
    box-sizing: border-box;
}

/* 1コメント = ページの1/3固定 */
.henshukoki-card {
    flex: 0 0 33.33%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    padding: 8px 0;
    width: 350px;
    border-bottom: 1px dashed rgba(192, 168, 128, 0.4);
    overflow: hidden;
    box-sizing: border-box;
}

.henshukoki-card:last-child {
    border-bottom: none;
}

/* タイトルページは2件で2/3を埋める */
.henshukoki-title-page .henshukoki-card {
    flex: 0 0 50%;
}

/* 左：画像 */
.henshukoki-card__image {
    flex-shrink: 0;
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.henshukoki-card__image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* 右：コメント＋名前 */
.henshukoki-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.henshukoki-card__body {
    flex: 1;
    min-height: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #333;
    padding-left: 10px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* 投稿者名：フロー内で右下に配置 */
.henshukoki-card__author {
    flex-shrink: 0;
    align-self: flex-end;
    font-size: 0.75rem;
    color: #333;
    margin: 2px 0 0;
    padding-right: 4px;
}

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

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

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

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

    .henshukoki-paper {
        height: 520px;
        background-image: none;
    }

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

    .henshukoki-home-btn {
        right: 4px;
        bottom: -40px;
    }

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

    .henshukoki-list {
        padding: 0 8px;
    }

    .henshukoki-card {
        width: auto;
    }

    .henshukoki-card__body {
        font-size: 0.7rem;
    }

    .henshukoki-title-page__org {
        font-size: 1.2rem;
        line-height: 1.6;
    }

    .henshukoki-title-page__title {
        font-size: 2.6rem;
        letter-spacing: 0.1em;
    }

    .henshukoki-paper .paper-spread::before,
    .henshukoki-paper .paper-spread::after {
        left: 50%;
        width: 90%;
    }

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