@import url('https://fonts.googleapis.com/css2?family=Toppan+Bunkyu+Mincho&display=swap');

.page.blank {
  background-color: #fff;
  min-height: 100%;
}


/* リセット・基本設定 */
*, *:before, *:after {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  margin: 0;
  background: #000000;
  -webkit-tap-highlight-color: transparent;
}
body {
}

/* ===== レイアウトに関する設定（ここから） ===== */

.book {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 1200px;
  height: auto;
  aspect-ratio: 2.8 / 1;
  z-index: 2;
}

@media (max-width: 768px) {
  .book {
    width: calc(100vw - 10px);
  }
}

.bound {
  perspective: 450vw;
}

.pages {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  border-radius: 4px;
}

.page {
  width: 50%;
  height: 100%;
  transition-timing-function: ease-in-out;
  position: absolute;
  top: 0;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5em;
  transform-origin: 0 0;
  transition: transform 1.4s, box-shadow 0.7s 0.2s;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  cursor: pointer;
  user-select: none;
}

.page.cover {
  padding: 0em;
  background-color: #000;
}

.page img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.bound .page:nth-child(odd) {
  pointer-events: all;
  transform: rotateY(0deg);
  right: 0;
  border-radius: 0 4px 4px 0;
}

/* キーボード操作中はホバーを無効化 */
.bound.is-navigating .page {
  pointer-events: none !important;
}
.bound:not(.is-navigating) .page:nth-child(odd):not(.cover):hover {
  transform: rotateY(-10deg);
}


.bound .page:nth-child(even) {
  pointer-events: none;
  transform: rotateY(180deg);
  transform-origin: 100% 0;
  left: 0;
  border-radius: 4px 0 0 4px;
}
.bound .page.grabbing {
  transition: none;
}
.bound .page.flipped:nth-child(odd) {
  pointer-events: none;
  transform: rotateY(-180deg);
}
.bound .page.flipped:nth-child(even) {
  pointer-events: all;
  transform: rotateY(0deg);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('./img/shadow.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
  pointer-events: none;
  z-index: 1;
}

.page.flipped:nth-child(odd) {
  box-shadow: inset 20px 0 50px -24px rgba(255, 255, 255, 0.6);
}

.page.flipped:nth-child(even) {
  box-shadow: inset -20px 0 50px -20px rgba(193, 193, 193, 0.6);
}

.page::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04) 0%, transparent 30%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.page:nth-child(odd):not(.flipped):not(.cover)::after {
  opacity: 1;
}

.page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

@media (max-width: 768px) {
  .page {
    padding: 1em;
  }
}

.pages::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s;
}

.pages.is-open::before {
  opacity: 1;
}

.bound .page:nth-child(even):not(.flipped) {
  transform: rotateY(179.9deg) !important;
}

.bound .page.flipped:nth-child(even) {
  transform: rotateY(0deg) !important;
}

.bound .page.flipped:nth-child(odd) {
  transform: rotateY(-179.9deg) !important;
}


/* ▼▼▼ STYLES FOR FULLSCREEN MODE ▼▼▼ */
/* ▼▼▼ フルスクリーンボタンのスタイル（画像バージョン）▼▼▼ */

/* ボタン本体の円 */
#fullscreen-button {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
}

/* クリック時の青い枠線（フォーカスリング）を非表示に */
#fullscreen-button:focus,
#fullscreen-button:focus-visible {
    outline: none;
    box-shadow: none;
}


/* ボタン本体の円 */
#fullscreen-button {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
}

/* クリック時の青い枠線（フォーカスリング）を非表示に */
#fullscreen-button:focus,
#fullscreen-button:focus-visible {
    outline: none;
    box-shadow: none;
}

/* ボタン内のアイコン共通設定 */
#fs-enter-icon,
#fs-exit-icon {
    width: 100%;
    height: 100%;
    background-size: 50%;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5; /* 少し透過させる */
}

/* 表示するアイコン画像の指定 */
#fs-enter-icon {
    background-image: url('img/full-enter-icon.png');
}

#fs-exit-icon {
    background-image: url('img/full-exit-icon.png');
}



body.fullscreen-active {
    overflow: hidden;
}

body.fullscreen-active .book {
    width: 90vw;
    height: calc(90vw / 2.8);
    max-width: none;
    z-index: 2000;
}

@media (min-aspect-ratio: 280/100) {
    body.fullscreen-active .book {
        height: 98vh;
        width: calc(98vh * 2.8);
    }
}
/* ▲▲▲ END OF FULLSCREEN STYLES ▲▲▲ */


/* ▼▼▼ テキストページ用のスタイル ▼▼▼ */
.page.text-page {
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4.5%;
}

.page.text-page-about {
  align-items: center; /* 上下中央揃えに変更 */
  justify-content: center;
}

.text-content {
  text-align: center;
  color: #333;
  line-height: 1.6;
  font-size: clamp(8px, 0.9vw, 14px);
}

/* aboutページ用の大きいテキストスタイル */
.page.text-page-about .text-content {
  font-size: clamp(10px, 1.1vw, 16px); /* 通常より少し大きくする */
}

.text-content .ja {
  font-family: 'Toppan Bunkyu Mincho', serif;
  margin: 0;
  letter-spacing: 0.1em;
}

.text-content .en {
  font-family: Helvetica, sans-serif;
  font-size: 0.8em;
  opacity: 0.9;
  margin: 0;
  letter-spacing: 0.04em;
}

/* ロゴ表示 */
:root {
  --logo-size: 100px;
  --logo-gap: 16px;
}

/* ▼▼▼ ヘッダーのスタイルを変更 ▼▼▼ */
.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  /* Flexboxで上下に配置 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* 元の配置に合わせた余白 */
  padding: var(--logo-gap);
  /* コンテナ自体のクリックは無効化 */
  pointer-events: none;
}

/* ヘッダー内のリンク要素だけクリックできるようにする */
.site-header > * {
  pointer-events: auto;
}

/* style.css 内 */
.about-link {
  color: #434343;
  font-family: Helvetica, sans-serif;
  font-size: 14px;
  text-decoration: none;
}
.about-link:hover {
  text-decoration: underline;
}

/* ▼▼▼ コピーライト用のスタイル ▼▼▼ */
.copyright-notice {
  display: block; /* リンクの下に改行して表示 */
  margin-top: 10px; /* 上のリンクとの間隔 */
  color: #434343;
  font-family: Helvetica, sans-serif;
  font-size: 12px; /* 少し小さくする */
}


.site-header .brand {
  display: inline-block;
  line-height: 0;
}

.site-header img {
  height: var(--logo-size);
  width: auto;
  display: block;
}

body {
  padding-top: calc(var(--logo-size) + (var(--logo-gap) * 2));
}

.cover-gallery {
  display: flex;
  justify-content: center;
  gap: 100px;
  margin-top: 60px;
  flex-wrap: wrap;
}

.cover-gallery .cover img {
  max-width: 500px;
  height: auto;
  border: 1px solid #545454;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.cover-gallery .cover img:hover {
  transform: scale(1.05);
}

/* 表紙の専用スタイル */
.page.cover {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #545454;
}

.page.cover::before,
.page.cover::after {
  content: none !important;
}

/* ▼▼▼ 全画面表示ページ用のスタイル ▼▼▼ */
.page.full-image-page {
  padding: 0;
}
.page.full-image-page img {
  object-fit: contain; /* はみ出さずに全体を表示 */
}

/* ▼▼▼ 定義文用のテキストページスタイルを追加 ▼▼▼ */
.page.text-page-definition {
  align-items: flex-end; /* 下揃えに変更 */
  justify-content: center;
  padding-bottom: 4.5%; /* 下部に余白を追加 */
}

.page.text-page-definition .text-content {
  font-size: clamp(8px, 0.8vw, 11px); /* aboutページより小さいフォントサイズ */
  max-width: 95%; /* 横幅を少し狭めて読みやすくする */
  text-align: left; /* 左揃えにする */
}

.page.text-page-definition .text-content .ja {
  font-size: 0.9em; /* 英語テキスト基準で少し小さくする */
  line-height: 1.8; /* 行間を少し広げる */
}

.page.text-page-definition .text-content .en {
  font-size: 0.9em; /* 日本語より少し大きくする */
  line-height: 1.8; /* 行間を少し広げる */
}

/* ▼▼▼ Aboutリンク用のスタイルを調整 ▼▼▼ */
.about-link {
  color: #434343;
  font-family: Helvetica, sans-serif;
  font-size: 14px;
  text-decoration: none;
}
.about-link:hover {
  text-decoration: underline;
}


/* ▼▼▼ この部分を追加 ▼▼▼ */
/* 裏表紙のスタイル調整 */
.page.full-image-page img[src="img/back-cover.jpg"] {
  object-fit: cover;
  border-radius: 4px 0 0 4px; /* 親要素の角丸に合わせて白い線を解消 */
  box-shadow: 0 0 0 1px #545454;
}

/* ▼▼▼ フルスクリーン時のテキストサイズ調整 ▼▼▼ */
body.fullscreen-active .page.text-page .text-content {
  font-size: clamp(12px, 1.2vw, 18px); /* 通常より大きく */
}

body.fullscreen-active .page.text-page-about .text-content {
  font-size: clamp(14px, 1.4vw, 20px); /* 通常より大きく */
}

body.fullscreen-active .page.text-page-definition .text-content {
    font-size: clamp(10px, 1.0vw, 14px); /* 通常より大きく */
}
