/* =======================================
   書籍詳細ページ固有スタイル
   ======================================= */


body {
    background-color: #f5f5f0;
}

h1 {
    transform: rotate(0.05deg);
}

main {
    background-image: unset;
}

.detail-page {
    padding-top: 20px;
    /* ヘッダー下のスペース */
}

.acd-item.is-open .acd-body {
    border-radius: 8px;
}

.detail-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    /* 主要コンテンツを横並びにする */
    gap: 40px;
    justify-content: center;
}

.acd {
    max-width: 940px;
    margin: 20px auto auto auto;
}

/* --- 1. 書影と販売エリア (左側) --- */
.media-purchase-area {
    display: flex;
}

/* 書影ビューア */
.book-media-viewer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 15px;
    width: 350px;
}

.main-cover {
    flex: 1;
    text-align: center;
    justify-content: center;
    border: 1px solid var(--color-black1);
    width: 360px;
    height: auto;
    display: flex;
}

.main-cover img {
    max-width: 100%;
    height: auto;
}

.book_text {
    justify-content: center;
}

.sales-links {
    margin-top: unset;
    width: 100%;
    max-width: 940px;
    margin: auto;
}

.sales-link {
    width: 220px;
    height: 45px;
}


/* サムネイル */
.tmb-list {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    overflow-x: auto;
    justify-content: center;
}

.tmb {
    width: 45px;
    height: 45px;
    cursor: pointer;
    border: 1px solid var(--color-black1);
    overflow: hidden;
    position: relative;
}


.tmb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* ← トリミングなしで全体を収める */
    object-position: center;
    /* 中央揃え */
    display: block;
}

.tmb img .active {
    border-color: var(--color-yellow);
    /* 選択中のサムネイル */
}

/* 販売リンク */
.purchase-links-list {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

/* SNSシェア */
.detail-social-share {
    text-align: center;
    margin-top: 20px;
}

.detail-social-share p {
    margin-bottom: 10px;
}

.share-text {
    font-size: 1.5rem;
    gap: 6px;
    font-weight: 600;
    margin: 20px 0;
}

.marginreset {
    margin: 0;
}

.share-button img {
    width: 50px;
    height: 50px;
}

.button-purchase {
    height: 70px;
    width: 320px;
}

/* --- 2. 情報・コンテンツエリア (右側) --- */
.info-content-area {
    flex: 1;
    max-width: 970px;
    margin: auto;
}

.book-title-sab {
    color: var(--color-black1);
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
}

.book-title-main {
    font-size: 2.5rem;
    color: var(--color-black1);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 900;
    line-height: 1.25;
}

.book-text {
    text-align: center;
}

.book-author {
    margin-bottom: 20px;
    color: var(--color-black2);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.info-separator {
    border: 0;
    height: 1px;
    background-color: var(--color-black2);
    margin: 10px auto;
    width: 100%;
}

/* 書籍スペックリスト */
.book-spec-list {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    gap: 0.5rem 6rem;
    margin: 1rem auto;
    max-width: 800px;
    text-align: left;
    font-size: 0.825rem;
}

.spec-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    white-space: nowrap;
    color: var(--color-black1);
}

.spec-item dt {
    color: var(--color-blue);
    font-weight: bold;
}

.spec-item dd {
    margin: 0;
    font-feature-settings: "palt" 1;
}

/* ナビゲーションボタン */
.volume-nav-buttons {
    display: flex;
    margin: 40px auto 20px;
    gap: 30px;
    justify-content: center;
}

.button-nav {
    position: relative;
    padding: 10px 15px;
    border: 1px solid var(--color-black2);
    border-radius: 35px;
    text-align: center;
    width: 200px;
    transition: background-color 0.3s;
    background-color: #e6f0ff;
    color: var(--color-black2);
}

.button-nav:hover {
    background-color: white;
}

/* ▶ 右矢印 */
.button-nav.next::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    /* ← ボタン右端からの距離 */
    width: 12px;
    height: 12px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    /* 縦中央で右向き */
}

/* ◀ 左矢印 */
.button-nav.prev::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 15px;
    width: 12px;
    height: 12px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: translateY(-50%) rotate(-45deg);
}

.btn_gry {
    color: #aaa;
    background-color: var(--color-white);
}

.tab-container {
    width: 100%;
    max-width: 940px;
    display: block;
    margin: auto;
}

/* タブ切り替え */

.tab-content-area {
    background-color: var(--color-white);
    width: 100%;
    margin: auto;
    z-index: 5;
    position: relative;
    border-radius: 5px;
}

.tab-content p,
.tab-content li {
    color: var(--color-black1);
    font-weight: 500;
    font-size: 1.125rem;
    transform: rotate(0.05deg);
    padding: 2px;
    line-height: 1.5;
}


.tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: auto;
    width: 95%;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1em;
    border-bottom: 2px solid transparent;
    margin-bottom: -8px;
    background-color: var(--color-yellow);
    border-radius: 5px;
    z-index: 0;
    color: var(--color-black2);
    width: 45%;
    transition: filter 0.2s ease;
    /* ← なめらかに */
}

.tab-button:hover {
    filter: brightness(1.1);
}

.tab-button.active {
    font-weight: bold;
    background-color: var(--color-white);
}


.tab-content {
    width: 100%;
    margin: auto;
    display: none;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.75;
    text-align: justify;
    gap: 5px;
    transform: rotate(0.05deg);
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-bottom: 15px;
}


.custom-button:hover {
    background-color: #3b56c4;
    /* ホバー時の色を少し明るく */
}

/* 最下部トップへボタン */
.back-to-top-container {
    text-align: center;
    padding: 50px 20px;
}

.button-large {
    width: 280px;
    height: 60px;
    border: 3px solid white;
    border-radius: 40px;
    color: var(--color-white);
    background-color: var(--color-blue);
    font-size: 1.5rem;
    display: flex;
    font-weight: bold;
    margin: auto;
    text-align: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    align-items: center;
}

.btn-box {
    gap: 10px;
    display: flex;
    flex-direction: row;
}

/* --- 追従ボタン（詳細ページ用）--- */

.back-to-list-button {
    background-color: var(--color-red);
    width: 80px;
    height: 80px;
    line-height: 50px;
    border-radius: 40px;
    font-size: 1em;
    margin-top: 5px;
    color: var(--color-white);
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: filter 0.25s ease;
}


/* ホバー時に少し明度を落とす（＝薄く見える） */
.back-to-list-button:hover {
    filter: brightness(0.85);
}


.to-top-button {
    width: 80px;
    height: 80px;
}

/* セクション4: ムービー */
.movie-box {
    width: 100%;
    max-width: 920px;
    aspect-ratio: 16/9;
    margin: 50px auto auto auto;
}

.movie-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    /* 余白対策 */
}




/* ===== ボタングリッド（3列×複数行） ===== */
.btn-grid {
    display: flex;
    gap: 12px;
    margin: 12px 0 24px;
    flex-wrap: wrap;
    text-align: center;
    justify-content: center;
    max-width: 940px;
    margin: auto;
}

/* ボタン共通 */
.site-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* 画像とテキストの間隔 */
    width: 280px;
    height: 65px;
    background: var(--color-white);
    color: var(--color-black1);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: filter .2s ease, transform .08s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.site-btn img {
    height: 24px;
    /* ← ロゴの高さ（揃える） */
    width: auto;
    object-fit: contain;
    /* 比率保持 */
    vertical-align: middle;
}

.site-btn:hover {
    filter: brightness(1.07);
}

.site-btn:active {
    transform: translateY(1px);
}

.js-float-sub {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.js-float-sub.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}




/* =======================================
   レスポンシブ対応 (Max-width: 767px)
   ======================================= */
@media (max-width: 767px) {

    .detail-page {
        padding-top: 0px;
    }

    .sales-link {
        width: 48%;
        font-size: 0.8125rem;
        height: 40px;
    }

    .btn-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        /* SPは2列 */
    }

    .book_text {
        margin: 20px 0 0 0;
    }

    .tab-content {
        border-radius: unset;
    }

    .detail-container {
        flex-direction: column;
        /* 縦並びにする */
        gap: 5px;
        padding: 10px;
    }

    /* 書影と販売エリア */

    .tmb {
        width: 35px;
        height: 35px;

    }

    .media-purchase-area {
        flex: auto;
        width: 100%;
        /* 幅を画面いっぱいに */
        order: 1;
        /* SPで上に配置 */
    }

    .book-media-viewer {
        width: 60%;
        margin: 20px auto 10px;
    }

    .main-cover {
        flex: 1;
        height: unset;
        width: 100%;
    }

    .tmb-list {
        justify-content: center;
        margin-bottom: unset;
    }

    .purchase-links-list {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .button-purchase {
        width: 47%;
        font-size: 0.825rem;
        margin: unset;
        height: 50px;
    }

    .share-text {
        font-size: 1rem;
    }

    .volume-nav-buttons {
        gap: 10px;
        width: 95%;
    }

    .button-nav {
        font-size: 0.825rem;
        padding: 8px 15px;
    }

    .social-icons {
        gap: 5px;
    }

    .share-button img {
        width: 40px;
        height: 40px;
    }

    .info-separator {
        width: 95%;
    }

    .social-share-buttons {
        text-align: center;
        display: flex;
        margin: auto;
        justify-content: center;
        gap: 10px;
    }

    .sales-links {
        padding: 0 5px;
    }

    .book-title-sab {
        font-size: 0.875rem;
    }

    .site-btn {
        width: 48%;
        height: 50px;
    }

    .spec-item {
        font-size: 0.6875rem;
        line-height: 1.25;
    }

    /* 情報・コンテンツエリア */
    .info-content-area {
        flex: auto;
        order: 2;
    }

    .book-title-main {
        font-size: 1.5rem;
    }

    .book-spec-list {
        gap: 5px 15px;
        margin: 5px auto;
    }

    .button-large {
        width: 240px;
        height: 50px;
        font-size: 1.25rem;
    }

    .to-top-button {
        width: 70px;
        height: 60px;
    }

    .book-author {
        font-size: 0.75rem;
    }

    /* タブ */
    .tab-button {
        flex: 1;
        /* タブを均等幅に */
        text-align: center;
        font-size: 0.825rem;
    }

    .acd-header img {
        width: auto;
        height: 100%;
    }


    .tab-content p,
    .tab-content li {
        font-size: 0.75rem;
    }

    .acd-body {
        padding: 0 10px;
    }

    .sales-links-sab a {
        width: 48%;
    }


}