.book-index,
.book-chapter{
  --book-layout-width:860px;
  --book-text-width:760px;
  width:auto;
  max-width:none;
  min-width:0;
}

.book-index__header,
.book-chapter__header{
  max-width:none;
  margin-bottom:28px;
  padding-bottom:24px;
  border-bottom:1px solid var(--color-border-muted);
}

.book-index__eyebrow,
.book-chapter__number{
  margin:0 0 10px;
  color:var(--color-text-muted);
  font-size:14px;
  font-weight:700;
  line-height:1.3;
  text-transform:uppercase;
}

.book-index__title,
.book-chapter__title{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:0;
  max-width:var(--book-layout-width);
  line-height:1.1;
}

.book-chapter__title-text{
  min-width:0;
  overflow-wrap:anywhere;
}

.book-chapter__translation-notice{
  max-width:var(--book-text-width);
  margin:16px 0 0;
  color:var(--color-text-secondary);
  font-size:18px;
  line-height:1.55;
}

.book-index__intro,
.book-chapter__content{
  color:var(--color-text);
}

.book-index__intro{
  max-width:var(--book-text-width);
  margin-bottom:38px;
}

.book-chapter__content{
  width:100%;
  max-width:none;
}

.book-chapter__content > :not(hr):not(.wp-block-separator){
  max-width:var(--book-text-width);
}

.book-index__intro > :first-child,
.book-chapter__content > :first-child{
  margin-top:0;
}

.book-chapter__content h2,
.book-chapter__content h3,
.book-index__intro h2,
.book-index__intro h3{
  margin-top:1.8em;
  line-height:1.25;
}

.book-chapter__content figure,
.book-index__intro figure{
  margin:24px 0;
}

.book-chapter__content iframe,
.book-index__intro iframe{
  display:block;
  width:100%;
  max-width:var(--book-text-width);
  aspect-ratio:16 / 9;
  height:auto;
  border:0;
  border-radius:8px;
  background:var(--color-surface-hover);
}

.book-chapter__content figcaption,
.book-index__intro figcaption{
  margin-top:8px;
  color:var(--color-text-muted);
  font-size:14px;
  line-height:1.45;
}

.book-chapter__content hr,
.book-chapter__content .wp-block-separator{
  width:100%;
  max-width:none;
  margin:28px 0;
  border:0;
  border-top:1px solid var(--color-border-muted);
}

.book-toc{
  max-width:var(--book-layout-width);
}

.book-toc__header{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
}

.book-toc__title{
  margin:0;
  font-size:24px;
  line-height:1.2;
}

.book-toc__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:30px;
  padding:0 8px;
  border:1px solid var(--color-border);
  border-radius:999px;
  color:var(--color-text-secondary);
  font-size:13px;
  font-weight:700;
}

.book-toc__list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px 12px;
  margin:0;
  padding:0;
  list-style:none;
}

.book-toc__link{
  display:grid;
  grid-template-columns:42px minmax(0, 1fr);
  gap:10px;
  min-height:54px;
  padding:11px 12px;
  border:1px solid var(--color-border);
  border-radius:8px;
  background:var(--color-surface);
  color:var(--color-text);
  text-decoration:none;
}

.book-toc__link:hover,
.book-toc__link:focus-visible{
  border-color:var(--color-border-strong);
  background:var(--color-surface-hover);
  text-decoration:none;
}

.book-toc__number{
  color:var(--color-text-muted);
  font-variant-numeric:tabular-nums;
  font-weight:700;
}

.book-toc__label{
  min-width:0;
  overflow-wrap:anywhere;
  line-height:1.35;
}

.book-chapter-nav{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  max-width:var(--book-text-width);
  margin-top:18px;
}

.book-chapter__wide-divider{
  width:100%;
  margin:34px 0 0;
  border-top:1px solid var(--color-border-muted);
}

.book-chapter-nav__link{
  display:flex;
  min-height:82px;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:13px 14px;
  border:1px solid var(--color-border);
  border-radius:8px;
  background:var(--color-surface);
  color:var(--color-text);
  text-decoration:none;
}

.book-chapter-nav__link--next{
  text-align:right;
}

.book-chapter-nav__link:hover,
.book-chapter-nav__link:focus-visible{
  border-color:var(--color-border-strong);
  background:var(--color-surface-hover);
  text-decoration:none;
}

.book-chapter-nav__label{
  color:var(--color-text-muted);
  font-size:13px;
  font-weight:700;
}

.book-chapter-nav__title{
  overflow-wrap:anywhere;
  line-height:1.35;
}

.book-chapter__toc-return--bottom{
  margin-top:18px;
  margin-bottom:0;
}

@media (max-width: 760px){
  .book-toc__list,
  .book-chapter-nav{
    grid-template-columns:minmax(0, 1fr);
  }

  .book-chapter-nav__link--next{
    text-align:left;
  }
}
