/* お祝いメッセージページ固有スタイル */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.message-card__body {
    flex: 1;
    min-height: 0;
    font-size: 12px;
    line-height: 1.6;
    overflow-y: auto;
}

.message-card__author {
    flex-shrink: 0;
    font-size: 0.75rem;
    text-align: right;
    margin-top: 8px;
    color: #444;
    align-self: flex-end;
    text-shadow:
        0 0 2px rgba(255, 255, 255, 1),
        0 0 6px rgba(255, 255, 255, 1),
        0 0 12px rgba(255, 255, 255, 0.85),
        0 0 22px rgba(255, 255, 255, 0.6),
        0 0 36px rgba(255, 255, 255, 0.35);
}

.message-card--2 .message-card__body,
.message-card--3 .message-card__body {
    text-shadow:
        0 0 2px rgba(255, 255, 255, 1),
        0 0 6px rgba(255, 255, 255, 1),
        0 0 12px rgba(255, 255, 255, 0.85),
        0 0 22px rgba(255, 255, 255, 0.6),
        0 0 36px rgba(255, 255, 255, 0.35);
}

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

.message-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;
}

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

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

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

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

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

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

    .message-paper {
        height: 520px;
    }

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

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

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

    .message-grid {
        gap: 8px;
    }

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

    .message-card__author {
        font-size: 0.65rem;
        text-shadow:
            0 0 2px rgba(255, 255, 255, 1),
            0 0 6px rgba(255, 255, 255, 1),
            0 0 14px rgba(255, 255, 255, 0.9),
            0 0 26px rgba(255, 255, 255, 0.7),
            0 0 42px rgba(255, 255, 255, 0.45);
    }

    .message-card--2 .message-card__body,
    .message-card--3 .message-card__body {
        text-shadow:
            0 0 2px rgba(255, 255, 255, 1),
            0 0 6px rgba(255, 255, 255, 1),
            0 0 14px rgba(255, 255, 255, 0.9),
            0 0 26px rgba(255, 255, 255, 0.7),
            0 0 42px rgba(255, 255, 255, 0.45);
    }

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