@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template:   cocoon-master
Version:    1.1.3
*/

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  /*必要ならばここにコードを書く*/
}

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}
/* 1. オーバーレイ（画面全体を覆う黒い背景） */
#book-opening-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #111; z-index: 9999; overflow: hidden;
    transition: opacity 0.8s ease-out;
    perspective: 1000px; -webkit-perspective: 1000px;
}

/* 【新規追加】本の中へ飛び込む錯覚を作る「ホワイトアウト」レイヤー */
#book-opening-overlay::after {
    content: "";
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #fffdf9; /* 白紙ページと同じ色 */
    opacity: 0; pointer-events: none; z-index: 10;
    /* 全体4.5秒のアニメーション */
    animation: flashToWhite 4.5s forwards; 
}

/* ホワイトアウトのタイムライン */
@keyframes flashToWhite {
    0%, 55% { opacity: 0; } /* 0〜2.5秒までは透明なまま */
    88% { opacity: 1; }     /* 2.5〜4.0秒（1.5秒間）で徐々に完全に真っ白に染まる */
    100% { opacity: 1; }    /* 4.0〜4.5秒（0.5秒間）真っ白な画面をキープ */
}

/* 2. 本のシーン（4.5秒間のズームアニメーション） */
.book-scene {
    position: absolute; top: 50%; left: 50%; 
    width: 140px; height: 210px; margin-top: -105px; 
    transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
    transform-origin: left center; -webkit-transform-origin: left center;
    /* 【修正】全体の時間を 4.5秒 に変更 */
    animation: zoomIntoBook 4.5s forwards; 
}

/* 3. 本の全体をまとめる枠 */
.book-wrapper {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
    transform: rotateX(5deg); opacity: 0; 
    animation: fadeInBook 0.4s ease-out forwards; 
}

@keyframes fadeInBook {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* 4. 右側の土台 */
.book-cover-back {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #9eca66; border-radius: 2px 8px 8px 2px;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.6); z-index: 1;
}

/* 5. 右側の白紙ページ */
.page-right-blank {
    position: absolute; top: 2%; left: 0; width: 97%; height: 96%;
    background-color: #fffdf9; border-radius: 0 6px 6px 0;
    box-shadow: inset 8px 0 10px -5px rgba(0,0,0,0.05);
}

/* 6. パタンと開く左側の束 */
.book-left-flip {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    transform-origin: left center; -webkit-transform-origin: left center;
    transform-style: preserve-3d; -webkit-transform-style: preserve-3d; z-index: 2;
    animation: openToMiddle 1s cubic-bezier(0.3, 0.8, 0.3, 1) 0.5s forwards; 
}

@keyframes openToMiddle {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-180deg); } 
}

/* 7. 若草色の表紙（外側） */
.cover-outside {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #9eca66; border-radius: 2px 8px 8px 2px;
    backface-visibility: hidden; -webkit-backface-visibility: hidden; z-index: 2;
}

/* 8. 左側のページ（内側） */
.page-left-inside {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #9eca66; border-radius: 8px 2px 2px 8px; 
    transform: rotateY(180deg); 
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
}

.page-left-inside::after {
    content: ""; position: absolute; top: 2%; left: 3%; width: 97%; height: 96%;
    background-color: #fffdf9; border-radius: 6px 0 0 6px; 
    box-shadow: inset -8px 0 10px -5px rgba(0,0,0,0.05); 
}

/* 9. 全体のカメラワーク（ズームイン）の新しいタイムライン */
@keyframes zoomIntoBook {
    /* 0.0〜0.5秒：フワッと現れて停止（約11%） */
    0%  { transform: scale(0.8); } 
    11% { transform: scale(0.8); animation-timing-function: ease-out; } 
    
    /* 0.5〜1.5秒：1秒かけて表紙が開く（約33%） */
    33% { transform: scale(1.0); animation-timing-function: linear; } 
    
    /* 1.5〜2.5秒：開いた本を1秒間見せる。ズーム停止（約55%） */
    55% { transform: scale(1.0); animation-timing-function: cubic-bezier(0.7, 0, 0.2, 1); } 
    
    /* 2.5〜4.0秒：白紙の中へ1.5秒かけてダイブ（約88%）。過剰なズームを抑えてホワイトアウトと同期させる */
    88% { transform: scale(10); }   
    
    /* 4.0〜4.5秒：真っ白な画面を0.5秒キープ（100%） */
    100%{ transform: scale(10); }  
}