@charset "utf-8";

/* ==========================================================
   book.css — サイト共通レイアウト・デザインシステム

   「本を1ページずつめくる」というトップページの世界観を
   全ページで共有するための土台。

   読み込み順は必ず   common.css → book.css → 各ページ個別CSS
   （個別CSSでここの値を上書きできるようにするため）
   ========================================================== */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --shade: #d4d4d0;
  --shade-strong: #b9b9b6;
  --sidebar-width: 220px;
  --top-logo-bar-height: 78px;
  /* 栞の切り欠き（V字）の深さと、栞の先端を床から浮かせる高さ */
  --ribbon-notch: 26px;
  --ribbon-gap: 20px;
}

/* ==========================================================
   1. header — 左端に垂れ下がる「栞」に変換

   上辺は本の天から出ているので切らず、下端だけ栞特有の V字に切る。
   clip-path は box-shadow も切り落とすため、影は
   形に追従する filter: drop-shadow() で付ける。
   ========================================================== */

.header {
  top: 0;
  right: auto;
  bottom: var(--ribbon-gap);
  z-index: 14;
  width: var(--sidebar-width);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    50% calc(100% - var(--ribbon-notch)),
    0 100%
  );
  filter: drop-shadow(5px 3px 8px rgba(0, 0, 0, 0.34));
}

/* 天面のストライプ（ポスターの配色を引く） */
.header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-image: repeating-linear-gradient(
    90deg,
    #fd71bd 0 10px,
    #78cfc2 10px 20px,
    #fff45f 20px 30px
  );
}

/* 栞に刷られた破線の枠。下辺は切り欠きに掛からない位置で止める */
.header::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 9px;
  bottom: calc(var(--ribbon-notch) + 12px);
  left: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.header-inner {
  width: 100%;
  height: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 36px 26px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 44px;
}

.header-logo {
  width: 164px;
}

.header-menu,
.menu,
.menu ul {
  width: 100%;
}

.menu ul {
  flex-direction: column;
  gap: 28px;
}

.menu ul li {
  margin-left: 0;
  margin-right: 0;
}

.menu ul li a {
  display: block;
  line-height: 1.3;
}

/* 現在表示中のページを示す */
.menu ul li a[aria-current="page"] {
  padding-left: 10px;
  border-left: 4px solid var(--paper);
}

.mobile-menu-toggle {
  display: none;
}

/* ==========================================================
   1.5. site-logo-bar — ページ上部の関連ロゴ帯
   ========================================================== */

.site-logo-bar {
  height: var(--top-logo-bar-height);
  padding: 8px 28px 8px 22px;
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 8;
  background-color: #fdfcef;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.92), rgba(246, 242, 221, 0.78)),
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px, 22px 22px;
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.site-logo-bar-inner {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.site-logo {
  display: block;
  background-color: transparent;
  object-position: center;
}

.site-logo-osaka {
  width: 220px;
  height: 54px;
  padding: 6px 12px;
  object-fit: cover;
}

.site-logo-partners {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
}

.site-logo-cbi {
  width: clamp(420px, 37vw, 540px);
  height: 56px;
  padding: 4px 8px;
  object-fit: cover;
  object-position: right center;
}

.site-logo-onac {
  width: clamp(250px, 21vw, 310px);
  height: 48px;
  padding: 4px 8px;
  object-fit: cover;
  object-position: left center;
}

/* ==========================================================
   2. main — 本を置いた机の面
   ========================================================== */

.main {
  --book-width: min(760px, calc(100% - 88px));
  margin-left: var(--sidebar-width);
  padding-top: var(--top-logo-bar-height);
  padding-bottom: 56px;
  background-color: #eeeeec;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(238, 238, 236, 0.9)),
    url(../images/index/bg_index.png);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  background-attachment: fixed;
}

/* ==========================================================
   3. footer — サイドバー下部に溶け込ませる
   ========================================================== */

/* 栞の内側、V字の切り欠きより上に収める */
.footer {
  position: fixed;
  left: 0;
  bottom: var(--ribbon-gap);
  z-index: 15;
  width: var(--sidebar-width);
  margin-left: 0;
  padding: 0 26px calc(var(--ribbon-notch) + 12px);
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.78);
  background-color: transparent;
  text-align: left;
}

.footer-about-us {
  margin-top: 0;
  font-size: 9.5px;
  line-height: 1.55;
}

.copyright {
  margin-top: 12px;
  font-size: 9px;
  line-height: 1.5;
}

.footer-logo-set {
  display: none;
}

/* ==========================================================
   4. .book-page — 本の1ページを表す基本パネル
      左に背表紙、右に紙の重なり、下に影。
      縦に並べると1冊の本に見えるよう -3px で継いでいく。
   ========================================================== */

.book-page {
  width: var(--book-width);
  margin: -3px auto 0;
  padding: 78px 64px 86px 82px;
  position: relative;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, var(--ink) 0 36px, rgba(255, 255, 255, 0.82) 36px 52px, transparent 52px),
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.84)),
    url(../images/index/bg_index.png);
  background-repeat: no-repeat;
  background-position: left top, center, center;
  background-size: auto, cover, cover;
  border: 3px solid var(--ink);
  border-radius: 0 10px 10px 4px;
  box-shadow:
    12px 10px 0 var(--shade),
    28px 32px 46px rgba(0, 0, 0, 0.26);
}

/* 背表紙側の折り目 */
.book-page::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 58px;
  width: 1px;
  background-color: rgba(0, 0, 0, 0.34);
  box-shadow: 7px 0 0 rgba(0, 0, 0, 0.12);
}

/* 小口（右端の紙の重なり） */
.book-page::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 8px;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 7px
  );
}

/* 中身を背表紙・小口より前面に */
.book-page > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================
   5. .book-spread — 開いた本の見開き
      1ページは表紙と同じ幅・高さの基準にし、見開き全体は2ページ分。
   ========================================================== */

@media (min-width: 901px) {
  .main.has-open-book {
    --book-width: min(760px, calc((100vw - var(--sidebar-width) - 72px) / 2));
  }
}

.open-book-sequence {
  padding: 28px 24px 118px;
  display: grid;
  gap: 132px;
  perspective: 1800px;
}

.book-spread {
  width: fit-content;
  min-height: max(640px, calc(100svh - 28px));
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: var(--book-width) var(--book-width);
  transform-style: preserve-3d;
}

/* 綴じ目 */
.book-spread::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  z-index: 3;
  width: 34px;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent 46%),
    linear-gradient(to left, rgba(0, 0, 0, 0.16), transparent 46%),
    linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent 50%);
  transform: translateX(-50%);
}

/* 本全体の落ち影 */
.book-spread::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -28px;
  left: 22px;
  z-index: -1;
  height: 34px;
  background-color: rgba(0, 0, 0, 0.28);
  filter: blur(22px);
  transform: scaleX(0.94);
}

.spread-page {
  min-height: max(640px, calc(100svh - 28px));
  padding: 76px 62px 82px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--spread-paper, #fdfcef);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.8), rgba(253, 252, 239, 0.86)),
    linear-gradient(to right, var(--spread-grid, #f1eac6) 1px, transparent 1px),
    linear-gradient(to bottom, var(--spread-grid, #f1eac6) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  border: 3px solid var(--ink);
  box-shadow:
    0 10px 0 var(--shade),
    0 30px 46px rgba(0, 0, 0, 0.18);
}

.spread-page > * {
  position: relative;
  z-index: 1;
}

.spread-page-left {
  border-right-width: 1px;
  border-radius: 10px 2px 2px 10px;
  transform-origin: right center;
  transform: rotateY(2deg);
}

.spread-page-right {
  border-left-width: 1px;
  border-radius: 2px 10px 10px 2px;
  transform-origin: left center;
  transform: rotateY(-2deg);
}

.spread-page-left::after,
.spread-page-right::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  z-index: 0;
  width: 10px;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0,
    rgba(0, 0, 0, 0.14) 1px,
    transparent 1px,
    transparent 8px
  );
}

.spread-page-left::after {
  left: 12px;
  border-left: 1px solid rgba(0, 0, 0, 0.22);
}

.spread-page-right::after {
  right: 12px;
  border-right: 1px solid rgba(0, 0, 0, 0.22);
}

@media (max-width: 1100px) {
  .book-spread {
    width: fit-content;
  }

  .spread-page {
    padding: 54px 38px 62px;
  }
}

@media (max-width: 900px) {
  .open-book-sequence {
    padding-top: 72px;
    gap: 88px;
  }

  .book-spread {
    width: var(--book-width);
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .book-spread::before {
    display: none;
  }

  .spread-page {
    min-height: auto;
    padding: 44px 28px 54px;
    transform: none;
  }

  .spread-page-left {
    border-right-width: 3px;
    border-bottom-width: 1px;
    border-radius: 10px 10px 2px 2px;
  }

  .spread-page-right {
    border-top-width: 1px;
    border-left-width: 3px;
    border-radius: 2px 2px 10px 10px;
  }

  .spread-page-left::after,
  .spread-page-right::after {
    display: none;
  }
}

@media (max-width: 700px) {
  .open-book-sequence {
    padding: 58px 10px 76px;
    gap: 62px;
  }

  .book-spread {
    width: calc(100% - 20px);
  }

  .spread-page {
    padding: 46px 24px 52px 32px;
    box-shadow:
      8px 8px 0 var(--shade),
      18px 24px 34px rgba(0, 0, 0, 0.22);
  }
}

@media (max-width: 520px) {
  .open-book-sequence {
    padding-right: 6px;
    padding-left: 6px;
  }

  .book-spread {
    width: calc(100% - 10px);
  }

  .spread-page {
    padding: 42px 18px 48px 24px;
  }
}

/* ==========================================================
   6. ページ内で使い回す部品
   ========================================================== */

/* 黒帯の小ラベル（ENTRY 02 / CONCEPT など） */
.page-label {
  width: fit-content;
  margin-bottom: 18px;
  padding: 7px 12px;
  color: var(--paper);
  background-color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1;
}

/* 二重罫線の大見出し */
.book-heading {
  padding-bottom: 18px;
  font-size: 32px;
  line-height: 1.45;
  border-bottom: 4px double var(--ink);
}

/* 中見出し */
.book-subheading {
  margin-top: 38px;
  padding-left: 14px;
  font-size: 20px;
  line-height: 1.6;
  border-left: 6px solid var(--ink);
}

/* 本文 */
.book-text {
  margin-top: 18px;
  line-height: 2;
}

/* 図鑑の「標本カード」風の白パネル。data-tag で見出しタグを付けられる */
.book-card {
  padding: 30px 30px 28px;
  position: relative;
  background-color: rgba(255, 255, 255, 0.82);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.14);
}

.book-card[data-tag]::before {
  content: attr(data-tag);
  position: absolute;
  top: -14px;
  left: 22px;
  padding: 5px 10px;
  color: var(--paper);
  background-color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  line-height: 1;
}

/* 本文中のリンク */
.text-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: opacity 200ms ease;
}

.text-link:hover {
  opacity: 0.6;
}

/* 引用（図鑑の余白に書き添えた一節のイメージ） */
.book-quote {
  margin-top: 32px;
  padding: 26px 28px 24px 34px;
  background-color: rgba(255, 255, 255, 0.72);
  border-left: 6px solid var(--ink);
}

.book-quote p {
  font-size: 19px;
  line-height: 1.9;
  font-weight: bold;
}

.book-quote cite {
  margin-top: 14px;
  display: block;
  font-size: 13px;
  font-style: normal;
  color: rgba(0, 0, 0, 0.62);
}

/* 黒地のリンクボタン（ハードシャドウ付き） */
.stamp-link {
  width: 100%;
  margin: 48px 0 0;
  padding: 22px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  color: var(--paper);
  background-color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 8px 8px 0 var(--shade-strong);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.stamp-link span {
  font-family: 'Montserrat', sans-serif;
  font-weight: bold;
  flex-shrink: 0;
}

.stamp-link strong {
  min-width: 0;
  line-height: 1.5;
}

.stamp-link strong::after {
  content: ' →';
}

.stamp-link:hover {
  transform: translateY(-6px);
  box-shadow: 12px 14px 0 var(--shade-strong);
}

/* 黒ラベル + 値 の定義リスト（日時・会場など） */
.spec-list {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

/* minmax(0, 1fr) にしないと、URL のような分割できない長い文字列で
   列が min-content まで広がり、画面から溢れる */
.spec-list div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: baseline;
  border-bottom: 1px solid rgba(0, 0, 0, 0.28);
}

/* 「モノレール」のようにラベルが長い場合の幅広版 */
.spec-list-wide div {
  grid-template-columns: 138px minmax(0, 1fr);
}

.spec-list dt {
  padding: 9px 10px;
  color: var(--paper);
  background-color: var(--ink);
  font-weight: bold;
  text-align: center;
}

.spec-list dd {
  padding: 9px 0 9px 16px;
  font-size: 20px;
  line-height: 1.6;
  font-weight: bold;
  overflow-wrap: break-word;
}

.date-label {
  display: inline-block;
  white-space: nowrap;
}

.date-time {
  display: inline-block;
  margin-left: 0.35em;
  white-space: nowrap;
}

/* ==========================================================
   6. レスポンシブ
      index.css と同じ 900 → 520 → 700 の順で記述する。
      （700 が最後にあるため、520 以下では 700 の値が優先される）
   ========================================================== */

@media (max-width: 900px) {
  .main {
    --book-width: min(640px, calc(100% - 48px));
  }

  .book-page {
    padding: 70px 46px 76px 68px;
  }

  .stamp-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px 24px;
  }
}

@media (max-width: 520px) {
  .main {
    --book-width: calc(100% - 32px);
  }

  .book-page {
    padding: 52px 24px 60px 54px;
  }

  .book-heading {
    font-size: 22px;
  }

  .book-subheading {
    margin-top: 30px;
    font-size: 17px;
  }

  .book-text {
    font-size: 15px;
  }

  .book-card {
    padding: 24px 20px 22px;
  }

  .book-quote {
    margin-top: 24px;
    padding: 20px 18px 18px 22px;
  }

  .book-quote p {
    font-size: 16px;
    line-height: 1.8;
  }

  .stamp-link {
    box-shadow: 6px 6px 0 var(--shade);
  }

  .spec-list div {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .spec-list-wide div {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .spec-list dt,
  .spec-list dd {
    font-size: 14px;
  }

  .spec-list dd {
    padding-left: 10px;
  }
}

@media (max-width: 700px) {
  :root {
    --sidebar-width: 0px;
    --top-logo-bar-height: 0px;
  }

  .site-logo-bar {
    display: none;
  }

  .header {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 30;
    width: auto;
    height: 0;
    overflow: visible;
    clip-path: none;
    filter: none;
    color: var(--ink);
    background-color: transparent;
    pointer-events: none;
  }

  .header::after,
  .header::before {
    display: none;
  }

  .header-inner {
    max-width: none;
    width: auto;
    height: auto;
    padding: 0;
    display: block;
    gap: 0;
    pointer-events: none;
  }

  .header-logo {
    display: none;
  }

  .header-menu {
    width: min(300px, calc(100vw - 36px));
    padding: 18px;
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 31;
    max-height: calc(100dvh - 122px);
    overflow-y: auto;
    color: var(--ink);
    background-color: #fdfcef;
    background-image:
      linear-gradient(115deg, rgba(255, 255, 255, 0.95), rgba(246, 242, 221, 0.9)),
      linear-gradient(to right, rgba(241, 220, 92, 0.24) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(241, 220, 92, 0.24) 1px, transparent 1px);
    background-size: 100% 100%, 18px 18px, 18px 18px;
    border: 3px solid var(--ink);
    box-shadow:
      7px 7px 0 #f9509f,
      20px 22px 34px rgba(0, 0, 0, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
      opacity 160ms ease,
      transform 160ms ease,
      visibility 160ms ease;
    pointer-events: none;
  }

  body.is-menu-open .header-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    width: 60px;
    height: 60px;
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 32;
    display: grid;
    place-content: center;
    gap: 5px;
    background-color: #ffe94f;
    border: 3px solid var(--ink);
    border-radius: 50%;
    box-shadow: 5px 5px 0 #f9509f;
    cursor: pointer;
    pointer-events: auto;
  }

  .mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    display: block;
    background-color: var(--ink);
    transition:
      transform 160ms ease,
      opacity 160ms ease;
  }

  body.is-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  body.is-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.is-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .menu ul {
    display: grid;
    gap: 10px;
  }

  .menu ul li a {
    padding: 12px 14px;
    display: block;
    color: var(--paper);
    background-color: var(--ink);
    font-size: 13px;
    line-height: 1.2;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.16);
  }

  .menu ul li a[aria-current="page"] {
    padding-left: 14px;
    border-left: 5px solid #f9509f;
  }

  .main {
    --book-width: calc(100% - 20px);
    margin-left: 0;
    padding-top: 0;
  }

  .footer {
    width: auto;
    margin-left: 0;
    padding: 42px 22px 34px;
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    color: var(--ink);
    background-color: #fdfcef;
    background-image:
      linear-gradient(115deg, rgba(255, 255, 255, 0.95), rgba(246, 242, 221, 0.9)),
      linear-gradient(to right, rgba(241, 220, 92, 0.24) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(241, 220, 92, 0.24) 1px, transparent 1px);
    background-size: 100% 100%, 18px 18px, 18px 18px;
    border-top: 3px solid var(--ink);
    text-align: left;
  }

  .footer-logo-set {
    display: grid;
    gap: 14px;
  }

  .footer-logo {
    display: block;
    height: auto;
  }

  .footer-logo-osaka {
    width: min(220px, 68vw);
  }

  .footer-logo-partners {
    display: grid;
    gap: 12px;
  }

  .footer-logo-cbi {
    width: min(340px, 100%);
    height: 88px;
    object-fit: cover;
    object-position: right center;
  }

  .footer-logo-onac {
    width: min(320px, 100%);
  }

  .footer-about-us {
    display: block;
    margin-top: 0;
    font-size: 12px;
    line-height: 1.8;
    color: rgba(0, 0, 0, 0.78);
  }

  .copyright {
    margin-top: 0;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.66);
  }

  .copyright small {
    display: inline;
  }

  .copyright::before {
    content: none;
  }

  .book-page {
    padding: 48px 18px 56px 38px;
    border-left-width: 3px;
  }

  .book-page::before {
    left: 30px;
  }

  .book-heading {
    font-size: 20px;
  }

  .page-label {
    font-size: 12px;
  }

  .spec-list {
    gap: 10px;
  }
}

/* 幅は広いが縦が短いビューポート（小型ノートなど）では、
   栞の中でナビと footer が重なるので中身を詰める。
   サイドバーが 82px に細くなる 700px 以下には適用しない。 */
@media (min-width: 701px) and (max-height: 640px) {
  .header-inner {
    padding: 22px 26px;
    gap: 22px;
  }

  .header-logo {
    width: 122px;
  }

  .menu ul {
    gap: 17px;
  }

  .menu ul li a {
    font-size: 14px;
  }

  .footer-about-us {
    font-size: 8px;
    line-height: 1.35;
  }

  .copyright {
    margin-top: 8px;
    font-size: 8px;
    line-height: 1.35;
  }
}
