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

h2 > span.deva {
  display: block;
  line-height: 1.55;
}
h2 > span.deva + em {
  display: block;
  margin-top: 0.45rem;
  line-height: 1.45;
}
.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.4rem;
  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;
  }
}
/* 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; }
