@charset "utf-8";

main {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #56524f;
}

p{
  padding-top: 20px; 
}
.pRight{
  text-align: right;
  padding: 20px; 
}
.pMedia{
  padding-top: 60px;
}

.pTop{
  font-weight: bold;
  padding-top: 20px; 
}
.aRight{
  text-align: right;
  padding: 20px; 
}
.book {
  display: flex;
  /*position: relative;*/
  width: 80%; /* スマホ画面に合わせてサイズを調整 */
  max-width: none;/*940px; /* デスクトップでの最大幅 */
  height: calc(80vw * 1.25); /* アスペクト比を維持 */
  max-height: 750px;
  perspective: 1500px;
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgb(249, 234, 216);
  border: 1px solid #ddd;
  border-radius: 5px; /* ページの角を少し丸くする */
  /*box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);*/
  box-shadow: 
  0 4px 6px rgba(0, 0, 0, 0.2),   /* 基本の影 */
  0 1px 3px rgba(0, 0, 0, 0.1),   /* 薄い影を追加 */
  inset 0 0 10px rgba(255, 255, 255, 0.3); /* 内側の光沢を表現 */
  backface-visibility: hidden;
  transform-origin: left;/* 左側を基準に回転 */
  transform: rotateY(0);/* 初期状態 */
  backface-visibility: hidden; /* 裏面を隠す */
  transition: transform 0.6s ease;
  padding: 20px;   /* 内容が端に詰まらないように余白を追加 */
  box-sizing: border-box; /* パディング込みでサイズを計算 */
  line-height: 1.6; /* 行間を広くして可読性を向上 */
}
.page::before {/*中央に薄い線を追加して、ページが開いているようなデザインに*/
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
  transform: translateX(-50%);
  z-index: -1; /* 背面に配置 */
  pointer-events: none; /* 折り目がクリックされないように設定 */
}
.page:hover {/*ホバーしたときに浮き上がるような効果*/
  transform: scale(1.02); /* 少し拡大 */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* 影を強調 */
  transition: all 0.3s ease; /* なめらかな変化 */
}
/* ページの裏面 */
.page.back {
  background-color: #ebdbd2; /* 裏面の色 */
  transform: rotateY(-180deg); /* 裏側の回転設定 */
  box-shadow: 
    inset 0 0 10px rgba(0, 0, 0, 0.1); /* 内側の影を付ける */
}
.page-content {
  /*position: relative;
  z-index: 2;
  margin: 30px, 0px; /* 折り目のスペースを作る */
  overflow-y: auto; /* 縦方向のスクロールを有効にする */
  display: flex;
  flex-direction: row;
  height: 100%;
  width: 100%;
}
/* 左カラム */
.column.left {
  flex: 1;
  padding-right: 20px;
  /*border-right: 2px solid transparent; /* 折り目に沿うデザイン */
  text-align: justify;
}

/* 右カラム */
.column.right {
  flex: 1;
  padding-left: 20px;
  text-align: justify;
}
.column.rightEnd{
  flex: 1;
  padding-left: 20px;
  text-align: center;
}
.page:not(:first-child) {
  display: none;
}

button {
  position: absolute;
  bottom: 2px;
  padding: 5px 20px;
  background: #72572b;
  color: white;
  border: none;
  cursor: pointer;
  opacity: 0.7; /* ボタンを70%表示 (30%透過) */
  transition: opacity 0.3s ease; /* マウスオーバー時の滑らかな変化 */
  border-radius: 5px;
  z-index: 2;
}
button:hover {
  opacity: 1; /* ホバー時に不透過 (100%表示) */
}
.prev {
  left: 10px;
}

.next {
  right: 10px;
}
/* フェードインのアニメーション定義 */
@keyframes fadeIn {
  from {
    opacity: 0; /* アニメーション開始時は透明 */
  }
  to {
    opacity: 1; /* アニメーション終了時は完全に表示 */
  }
}

/* フェードインを適用する要素のスタイル */
.element-1 {
  animation: fadeIn 2s ease-in; /* 2秒かけてゆっくりフェードインする */
}

/* スマホ向けレスポンシブ対応 */
@media (max-width: 768px) {
  .book {
    width: 95%; /* 画面幅に収まるよう調整 */
    height: calc(95vw * 1.25); /* アスペクト比を維持 */
  }
  .page {
    font-size: 87.5%;
  }
  .page::before {
    display: none; /* 折り目を非表示にする */
  }
  .page-content {
    flex-direction: column;
  }
  .column.left {
    padding: 0;
    border: none;
  }
  .column.right {
    padding: 0;
  }
  .pMedia{
    padding: 0;
  }
  .column.column.rightEnd{
    padding: 0;
  }
  button {
    font-size: 14px; /* ボタンサイズを調整 */
    padding: 8px 16px;
  }
}