/**
 * book-single.css — 書籍詳細
 */

/* 絞り込み */

/* 一覧 */
.books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 52px 32px;
}
.bk {
  display: block;
  transition: transform 0.3s;
}
.bk:hover {
  transform: translateY(-4px);
}
.bk .cover {
  aspect-ratio: 1 / 1.45; /* 書籍の比率（四六判・A5判の中間） */
  border-radius: 2px;
  margin-bottom: 16px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.09);
  position: relative;
  overflow: hidden;
}
.bk .cat {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0 8px;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.bk h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 4px;
}
.bk .author {
  font-size: 14px;
  color: var(--text-light);
}
.bk .date {
  font-size: 13px;
  color: var(--muted);
}
.bk[hidden] {
  display: none;
}

/* ページ送り */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 72px;
}

/* ===== 書籍詳細 ===== */
.detail {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 40px 0;
}
/* 上段：書影＋基本情報 */
.d-top {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 72px;
  align-items: start;
}
.d-cover {
  position: sticky;
  top: 110px;
}
.d-cover .img {
  aspect-ratio: 1 / 1.45; /* 書籍の比率（四六判・A5判の中間） */
  border-radius: 2px;
  background: transparent; /* 画像の読み込み中に色が見えないように */
  box-shadow:
    0 14px 40px rgba(35, 24, 21, 0.16),
    0 3px 10px rgba(35, 24, 21, 0.08);
}
.d-info .cat {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 1px 10px;
  margin-bottom: 16px;
}
/* シリーズ名（タイトルの上） */
.d-info .series {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-light);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.d-info .series a {
  border-bottom: 1px solid var(--border);
  transition:
    color 0.3s,
    border-color 0.3s;
}
.d-info .series a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.d-info h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.55;
  letter-spacing: 0.06em;
}
.d-info .sub {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text-light);
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.d-info .author {
  margin-top: 22px;
  font-size: 16px;
}
.d-info .author strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  margin-left: 6px;
  letter-spacing: 0.06em;
}
.d-catch {
  margin-top: 32px;
  padding: 26px 0;
  border-top: 1px solid var(--border-l);
  border-bottom: 1px solid var(--border-l);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.03em;
}
.spec {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
}
.spec th,
.spec td {
  text-align: left;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-l);
  font-size: 15px;
  vertical-align: top;
}
.spec th {
  width: 120px;
  color: var(--muted);
  font-weight: 400;
}
.buy {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.buy a {
  flex: 1 1 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 24px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s;
}
.buy .main {
  background: var(--accent);
  color: #fff;
}
.buy .main:hover {
  background: var(--accent-hover);
}
.buy a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 12px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* 下段：本文ブロック */
.d-body {
  max-width: 860px;
  margin: 96px auto 0;
}
.d-sec {
  padding: 0 0 72px;
}
.d-sec h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.d-sec .section-sub {
  text-align: left;
  margin-bottom: 28px;
}
.d-sec p {
  line-height: 2.1;
  color: var(--text);
}
.d-sec p + p {
  margin-top: 1.2em;
}
.prof {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 36px;
  align-items: start;
  background: var(--bg-warm);
  border-radius: 6px;
  padding: 36px;
}
.prof .ph {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8e5e3, #d6d1ce);
}
.prof h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.prof .role {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}
.prof p {
  font-size: 15px;
  line-height: 2;
  color: var(--text-light);
}

/* 同じジャンルの本 */
.related {
  border-top: 1px solid var(--border-l);
  padding: 88px 0 0;
  margin-top: 16px;
}
.related .books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 32px;
}
.related .bk {
  display: block;
  transition: transform 0.3s;
}
.related .bk:hover {
  transform: translateY(-4px);
}
.related .bk .cover {
  aspect-ratio: 1 / 1.45; /* 書籍の比率（四六判・A5判の中間） */
  border-radius: 2px;
  margin-bottom: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.09);
}
.related .bk h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}
.related .bk p {
  font-size: 13px;
  color: var(--muted);
}
.back {
  text-align: center;
  padding: 64px 0 96px;
}
.back a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 320px;
  padding: 18px 48px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-size: 16px;
  background: #fff;
  transition: all 0.3s;
}
.back a:hover {
  background: var(--accent);
  color: #fff;
}
.back a::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 14px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(45deg);
}

@media (max-width: 1100px) {
  .d-top {
    grid-template-columns: 320px 1fr;
    gap: 48px;
  }
  .related .books {
    grid-template-columns: repeat(3, 1fr);
  }
  .related .bk:nth-child(4) {
    display: none;
  }
}
@media (max-width: 760px) {
  .detail {
    padding: 24px 20px 0;
  }
  .d-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .d-cover {
    position: static;
    max-width: 240px;
    margin: 0 auto;
  }
  .d-info h1 {
    font-size: 24px;
  }
  .d-info .sub {
    font-size: 16px;
  }
  .d-catch {
    font-size: 16px;
  }
  .spec th {
    width: 96px;
  }
  .buy a {
    flex-basis: 100%;
  }
  .d-body {
    margin-top: 64px;
  }
  .d-sec {
    padding-bottom: 56px;
  }
  .d-sec h2 {
    font-size: 21px;
  }
  .prof {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 28px 22px;
    text-align: center;
  }
  .prof .ph {
    width: 110px;
    height: 110px;
    margin: 0 auto;
  }
  .prof p {
    text-align: left;
  }
  .related {
    padding-top: 60px;
  }
  .related .books {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
  }
  .related .bk:nth-child(4) {
    display: block;
  }
  .back a {
    min-width: 0;
    width: 100%;
  }
}
/* SP修正：書影の幅を確保／目次ラベルの折り返し防止／英字小見出しをオレンジに */
.d-cover {
  width: 100%;
}
.d-sec .section-sub {
  color: var(--accent);
}
@media (max-width: 760px) {
  .d-cover {
    width: min(240px, 70%);
  }
}
/* 英字小見出しを削除したぶん、見出し下の余白を確保 */
.d-sec h2 {
  margin-bottom: 24px;
}
/* 購入ボタンは1つなので幅を固定 */
.buy a {
  flex: 0 1 320px;
}
@media (max-width: 760px) {
  .buy a {
    flex-basis: 100%;
  }
}
.d-info .author strong {
  margin-left: 2px;
}
