/* book.css — rules used only by Raku++ Internals.
   Everything shared with the rest of raku.online lives in base.css;
   this file is loaded after it, on /book/ pages only. */

/* ---- reading measure -------------------------------------------------- */
/* A book is read in long runs, so the column is narrower than the site's
   default and the leading is looser. Code keeps the full width, because the
   excerpts are wrapped to 80 columns and must not re-wrap. */
.content.book p,
.content.book ul,
.content.book ol,
.content.book blockquote { max-width: 40rem; }
.content.book p { line-height: 1.65; }
.content.book li { line-height: 1.6; margin-bottom: .35rem; }

.content.book h1 { margin-bottom: .2rem; }
.content.book h2 { margin-top: 2.2rem; }
.content.book h3 { margin-top: 1.6rem; }

/* ---- chapter head ----------------------------------------------------- */
.ch-label {
  margin: 0 0 .1rem;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- on this page ----------------------------------------------------- */
.ch-toc {
  margin: 1.4rem 0 2rem;
  padding: .8rem 1rem;
  border-left: 3px solid var(--rule, #d8d5cf);
  background: var(--surface-2, rgba(128, 128, 128, .06));
  border-radius: 0 4px 4px 0;
  max-width: 40rem;
}
.ch-toc p {
  margin: 0 0 .4rem;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ch-toc ul { margin: 0; padding-left: 1.1rem; }
.ch-toc li { margin: 0; line-height: 1.45; font-size: .93rem; }

/* ---- previous / next -------------------------------------------------- */
.ch-nav {
  display: flex;
  gap: 1rem;
  margin: 3rem 0 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule, #d8d5cf);
}
.ch-nav a {
  flex: 1 1 0;
  display: block;
  padding: .7rem .9rem;
  border: 1px solid var(--rule, #d8d5cf);
  border-radius: 5px;
  text-decoration: none;
  line-height: 1.35;
}
.ch-nav a:hover { border-color: var(--accent, #2a78d6); }
.ch-nav a span {
  display: block;
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .15rem;
}
.ch-nav .next { text-align: right; }
.ch-nav .prev + .next { margin-left: auto; }
.ch-nav a:only-child.next { margin-left: auto; flex: 0 1 auto; }

/* ---- the contents page ------------------------------------------------ */
.dl { margin: 1.4rem 0 2.4rem; }
.dl-note { color: var(--muted); font-size: .9rem; margin-left: .6rem; }

.book-toc { max-width: 46rem; }
.book-toc h2.part {
  margin: 2.2rem 0 .6rem;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule, #d8d5cf);
  padding-bottom: .3rem;
}
.book-toc ol.chapters { list-style: none; margin: 0; padding: 0; }
.book-toc ol.chapters li {
  margin: 0;
  padding: .45rem 0;
  border-bottom: 1px solid var(--rule-soft, rgba(128, 128, 128, .18));
}
.book-toc ol.chapters li:last-child { border-bottom: 0; }
.book-toc a { text-decoration: none; display: block; }
.book-toc a:hover .t { text-decoration: underline; }
.book-toc .n {
  display: inline-block;
  min-width: 6.5rem;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.book-toc .t { font-weight: 600; }
.book-toc .b {
  display: block;
  margin-left: 6.5rem;
  color: var(--muted);
  font-size: .92rem;
}

@media (max-width: 34rem) {
  .book-toc .n { display: block; min-width: 0; }
  .book-toc .b { margin-left: 0; }
  .ch-nav { flex-direction: column; }
  .ch-nav .next { text-align: left; }
}
