/* file: contents/themes/kawaipublishing/assets/css/page-book.css */

/* ========== Vars ========== */
:root {
  --brand: #0072ba;
  --book-label-w: 110px;
}

/* ========== Container / Page head ========== */
/* .book-page .container{ max-width:1460px; padding:0 20px; margin:0 auto; } */
.book-page {
  overflow-x: clip;
}
@supports not (overflow: clip) {
  .book-page {
    overflow-x: hidden;
  }
}
.book-page .page-head {
  text-align: center;
  margin: 22px 0 16px;
}
.book-page .page-head__title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
}
.book-page .page-head__en {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #6b7280;
  text-transform: uppercase;
}

/* ========== 2-column main (PC) ========== */
.book-page .book-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 50px;
  margin-bottom: 50px;
}

/* ========== Left column (media) ========== */
.book-media {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.book-media__cover {
  width: 388px;
  max-width: 100%;
}
.book-media__cover,
.book-media__cover img {
  border-radius: 0;
  background: transparent;
}
.book-media__cover img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Buttons under cover */
.book-media__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 60px;
  box-sizing: border-box;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.book-media__btn--withicon {
  gap: 8px;
}
.book-media__btn--withicon::before {
  content: "";
  width: 20px;
  height: 20px;
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  flex: 0 0 20px;
}
.book-media__btn--audio::before {
  background-image: url("../images/common/audio_dl_transition_icon.svg");
}

/* Note under buttons */
.book-media__note {
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
  margin: -6px 0 8px;
  font-size: 16px;
  color: #4b5563;
  text-align: left;
  border-bottom: 1px solid var(--brand);
}

/* ========== Right column (title/author) ========== */
.book-main {
  display: flex;
  flex-direction: column;
}

/* PCスタイル（指定通り brand/color/size） */
.book-main__title {
  color: var(--brand);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
}
.book-main__author {
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 30px;
}

/* ========== Spec block ========== */
.book-spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #f1f8ff;
  border: none;
  border-radius: 6px;
  padding: 20px;
}
.book-spec__col {
  display: flex;
  flex-direction: column;
}
.book-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.book-row dt {
  flex: 0 0 var(--book-label-w);
  width: var(--book-label-w);
  font-weight: 700;
  color: #374151;
  text-align: left;
  padding-top: 6px;
}
.book-row dd {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

/* PCの行整形（ラベル列=120px） */
.book-spec__col .book-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 78px;
  align-items: start;
  margin: 8px 0;
}
.book-spec__col .book-row dt {
  font-size: 18px;
  font-weight: 500;
  color: #111;
  padding-top: 0;
}
.book-spec__col .book-row dd {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  color: #333;
}

/* ========== Chips ========== */
.book-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.chip,
.book-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  padding: 6px 15px;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* ========== Buy / Price / Cart ========== */
.book-buy {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 16px;
  align-items: center;
}

/* PCの価格表示（グリッド） */
.book-price {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 16px;
  align-items: center;
  margin: 14px 0;
  border-top: none;
  padding-top: 0;
  padding-left: 14px; /* 仕様：上ボーダー削除・左インデント */
}
.book-price dt {
  font-size: 18px;
  font-weight: 500;
  color: #111;
}
.book-price dd {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: baseline;
  gap: 2px;
  justify-content: flex-start;
}
.book-price__num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.book-price__yen {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.book-cart .btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

/* Primary button (PC) */
.btn.btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 420px;
  height: 60px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  border: 0;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
}
.btn.btn--primary .btn__icon {
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  display: inline-block;
}
@media (max-width: 480px) {
  .btn.btn--primary {
    width: 100%;
    max-width: 420px;
  }
}

/* ========== Text / Divider / Headings ========== */
.book-note {
  font-size: 16px;
  font-weight: 500;
  color: #555;
  margin: 12px 0 0;
}
.book-hr {
  height: 0;
  border: 0;
  border-bottom: 2px solid #d9d9d9;
  margin: 30px 0;
}

.book-summary {
  display: inline-block;
  color: #0072ba;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 20px;
}
.book-description {
  color: #111827;
  line-height: 1.9;
}

.book__container h3 {
  font-size: 20px;
}

.book__container .kp-lead-heading {
  margin-bottom: 30px;
}

/* ========== Related / Fullbleed ========== */
.book-page .book-related.book-related--fullbleed {
  position: relative;
  z-index: 0;
  isolation: isolate;
  padding: 50px 0 100px;
}
/* ★ 100vwフルブリード帯（PC/SP共通） */
.book-page .book-related.book-related--fullbleed::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* セクション高さに追従しつつ、左右は画面端まで塗る */
  box-shadow: 0 0 0 100vmax #f1f8ff;
  clip-path: inset(0 -100vmax);
  /* 中央領域も同色にして段差が出ないように */
  background: #f1f8ff;
}
/* クリップが未サポートな超レガシーへの保険（任意） */
@supports not (clip-path: inset(0)) {
  .book-page .book-related.book-related--fullbleed::before {
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    box-shadow: none;
  }
}
.book-related--fullbleed > .container {
  max-width: 1460px;
  padding: 40px 20px;
  margin: 0 auto;
}

/* newbooks（関連） */
.newbooks.newbooks--related {
  background: #f1f8ff;
  padding: 20px 0 200px;
}
.newbooks.newbooks--related > .container {
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ========== Diff dots ========== */
.diff {
  --dot: 14px;
  --gap: 14px;
  --edge-font: 16px;
  --halo-border: 1px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
  font-size: var(--edge-font);
  vertical-align: bottom;
  white-space: nowrap;
  padding: 8px 0;
}
.diff__edge {
  color: #333;
  line-height: 1;
}
.diff__dots {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: var(--gap);
}
.diff__dot {
  inline-size: var(--dot);
  block-size: var(--dot);
  border-radius: 50%;
  background: var(--c, #9cc8ff);
  position: relative;
}
/* 置き換え：選択中のドットだけ */
.diff__dot.is-current {
  /* 基準ドットは .diff__dot の --dot:14px を使用 */
  /* 内側14px（本体の塗り）→ 白リング外径22px → 青ハロー外径26px */
  box-shadow:
    /* 白リング：14px → 22px に広げる => spread 4px */ 0 0 0 4px #fff, /* 青ハロー：14px → 26px に広げる => spread 6px */ 0 0 0 6px #d9e3f0, /* 狭く強いドロップシャドウ（ネガティブspreadでタイトに） */ 0 2px 6px -3px rgba(0, 0, 0, 0.48), 0 1px 3px -2px rgba(0, 0, 0, 0.38);
  z-index: 1;
}

/* ========== Responsive (≤879px) ========== */
@media (max-width: 879px) {
  /* fullbleedのブレークアウト無効化（::beforeで帯表現済み） */
  .book-page .book-related.book-related--fullbleed {
    left: auto;
    right: auto;
    margin: 0;
    width: auto;
    padding: 40px 0;
  }

  /* 縦積みレイアウト＋ギャップ */
  .book-page .book-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 50px;
  }

  /* 重要：タイトル→著者だけ書影より上に来る。他はDOM順のまま。 */
  .book-page .book-main {
    display: contents;
  }
  .book-page .book-main__title {
    order: -2;
    margin: 0 0 4px;
    font-size: 18px;
    overflow-wrap: anywhere;
  }
  .book-page .book-main__author {
    order: -1;
    margin: 0;
    font-size: 12px;
  }

  /* 書影（中央・幅200px） */
  .book-media {
    align-items: center;
  }
  .book-media__cover {
    width: 200px;
    max-width: 100%;
    margin: 20px auto;
  }
  .book-media__cover img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* 書影下ボタン／ノート幅 */
  .book-media__btn {
    width: 100%;
    max-width: 330px;
    height: 60px;
    font-size: 16px;
    border-radius: 6px;
    margin-left: auto;
    margin-right: auto;
  }
  .book-media__note {
    max-width: 330px;
    margin: -6px auto 8px;
  }

  /* .book-buy はSPで縦並び */
  .book-buy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .book-buy > * {
    width: 100%;
  }

  /* 価格：SPは横並びの両端寄せ（ボタン幅に合わせる） */
  .book-buy > .book-price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding-left: 0;
    margin: 8px auto 0;
    border-top: none;
    width: 100%;
    max-width: 330px;
    text-align: left;
  }
  .book-buy > .book-price dt {
    font-size: 14px;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    text-align: left;
  }
  .book-buy > .book-price dd {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
    text-align: right;
  }
  .book-price__num {
    font-size: 24px;
  }
  .book-price__yen {
    font-size: 14px;
  }

  /* Spec：1カラム/14px */
  .book-spec {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .book-row {
    display: grid;
    grid-template-columns: minmax(84px, 34%) 1fr;
    gap: 6px 12px;
    margin: 6px 0;
  }
  .book-row dt {
    font-size: 14px;
    padding-top: 4px;
  }
  .book-row dd {
    font-size: 14px;
  }

  /* Chips */
  .book-chips .chip {
    font-size: 12px;
    padding: 5px 10px;
  }

  /* 見出し・要約・本文 */
  .book-summary {
    font-size: 16px;
  }
  .book-description {
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
  }

  /* 注意書きもボタン幅に合わせる */
  .book-page .book-note {
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
  }

  /* diff dots（SPサイズ） */
  .book-page .diff {
    --dot: 8px;
    --gap: 10px;
    --edge-font: 13px;
    gap: 8px;
    padding: 8px 0;
    font-size: var(--edge-font);
    line-height: 1;
  }
  .book-page .diff__dots {
    gap: var(--gap);
  }

  .book-spec__col .book-row {
    gap: 36px;
  }
  .book-spec {
    gap: 0;
  }
}

/* ========== Minor alignments ========== */
@media (min-width: 880px) {
  .book-page .book-note {
    text-align: right;
  }
}

/* Narrow but >879px scale downs already covered above for SP sizes */
