/* Canonical reading base lives in /book-base.css (home/book-base.css). */
@import url("/book-base.css");

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.15;
}
h2 { margin: 1.5rem 0 0.45rem; font-size: 1.2rem; line-height: 1.35; }
h2 .speakers { font-weight: 550; }
h2.verse { font-weight: 650; }
p { margin: 0 0 0.85rem; }
.title-line { font-size: 1.25rem; }
.side-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.side-open,
.side-shade { display: none; }
.book-index {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 4;
  width: 18rem;
  overflow: auto;
  padding: 0.4rem 0 2rem;
  background: #f6edd9;
  border-right: 1px solid rgba(44, 34, 26, 0.18);
}
.book-index > a {
  display: block;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(44, 34, 26, 0.12);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
}
.book-index > a.here {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.book-index details { border-bottom: 1px solid rgba(44, 34, 26, 0.12); }
.book-index summary {
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
}
.book-index summary::-webkit-details-marker { display: none; }
.book-index summary::before {
  content: "▸";
  display: inline-block;
  width: 1.1rem;
  color: #b5451d;
}
.book-index details[open] > summary::before { content: "▾"; }
.book-index summary.here { text-decoration: underline; text-underline-offset: 0.18em; }
.book-index .drawer a {
  display: block;
  padding: 0.38rem 1rem 0.38rem 1.7rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-index .drawer a.here {
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.book-index .num {
  display: inline-block;
  min-width: 2.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
@media (max-width: 800px) {
  .book-index {
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }
  .side-toggle:checked ~ .book-index { transform: none; }
  .side-open {
    display: block;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0;
    padding: 0.75rem 1rem;
    background: #f6edd9;
    border-bottom: 1px solid rgba(44, 34, 26, 0.18);
    color: #b5451d;
    font-weight: 700;
  }
  .side-toggle:checked ~ .side-shade {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 3;
    background: rgba(44, 34, 26, 0.35);
  }
  main { margin: 0 auto; padding: 1rem 1rem 3rem; }
}
.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.7rem;
  margin: 0.4rem 0 1.2rem;
}
.entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(44, 34, 26, 0.18);
  border-top: 3px solid #b5451d;
  background: #fffaf3;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.entry:hover, .entry:focus-visible { border-color: #b5451d; background: #fff; }
.entry strong { color: #b5451d; font-size: 1.02rem; }
.entry span, .entry em { color: #2c221a; font-weight: 500; }
.entry .count { color: rgba(44, 34, 26, 0.62); font-size: 0.88rem; }
.turn { font-size: 1rem; }
table.wide { min-width: 40rem; }
th, td { padding: 0.4rem 0.55rem; }
main details.answer {
  margin: 0 0 1.1rem;
  border: 1px solid rgba(44, 34, 26, 0.18);
  border-top: 3px solid #b5451d;
  background: #fffaf3;
}
main details.answer summary {
  cursor: pointer;
  padding: 0.55rem 0.8rem;
  font-weight: 700;
}
main details.answer .answer-body { padding: 0 0.8rem 0.2rem; }

/* Dark mode theme adaptations */
html[data-theme="dark"] .book-index,
html[data-theme="dark"] .side-open {
  background: #241c16;
  border-color: rgba(243, 230, 212, 0.16);
  color: #f0a070;
}
html[data-theme="dark"] .book-index > a,
html[data-theme="dark"] .book-index details { border-bottom-color: rgba(243, 230, 212, 0.12); }
html[data-theme="dark"] .book-index summary::before { color: #f0a070; }
html[data-theme="dark"] .entry {
  background: #241d17;
  border-color: rgba(243, 230, 212, 0.16);
  border-top-color: #e07043;
  color: #f3e6d4;
}
html[data-theme="dark"] .entry:hover,
html[data-theme="dark"] .entry:focus-visible {
  border-color: #f0a070;
  background: #2d241c;
}
html[data-theme="dark"] .entry strong { color: #f0a070; }
html[data-theme="dark"] .entry span,
html[data-theme="dark"] .entry em { color: #f3e6d4; }
html[data-theme="dark"] .entry .count { color: #c9b7a4; }
html[data-theme="dark"] main details.answer {
  background: #241d17;
  border-color: rgba(243, 230, 212, 0.16);
  border-top-color: #e07043;
  color: #f3e6d4;
}
