/* A book page stays large on the left. Pictured links stay on the right, with
   their own scroll position, even when the viewer zooms or scrolls the page. */
.book-reader #reader-scroll {
  --book-sidebar-width: clamp(180px, 19vw, 260px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--book-sidebar-width);
  align-items: start;
  gap: clamp(14px, 2vw, 28px);
}
.book-reader #reader-content {
  min-width: 0;
  width: 100%;
  height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #587168 #101e23;
}
.book-reader #book-sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: start;
  width: var(--book-sidebar-width);
  min-height: 0;
  max-height: var(--book-sidebar-height, calc(100svh - 245px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 8px;
  padding: 8px 8px 18px 12px;
  border-left: 1px solid #344b4b;
  background: #0d1721;
}
#book-sidebar .book-learning-heading {
  margin: 0;
  padding: 2px 0 4px;
  font: 500 10px/1.5 var(--sans, sans-serif);
  letter-spacing: 1.5px;
}
#book-sidebar .book-sidebar-header {
  position: sticky;
  top: 0;
  z-index: 3;
  flex-shrink: 0;
  padding: 3px 0 10px;
  border-bottom: 1px solid #344b4b;
  background: #0d1721;
}
#book-sidebar .book-sidebar-jumps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
#book-sidebar .book-sidebar-jumps button {
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid #4b6a63;
  border-radius: 4px;
  background: #19352e;
  color: #d4e9de;
  font: 500 11px/1.4 var(--sans, sans-serif);
  white-space: nowrap;
}
#book-sidebar .book-sidebar-jumps button:hover { background: #2a4a3f; border-color: #8bac9e; }
#book-sidebar .book-sidebar-heading {
  margin: 10px 0 0;
  color: #c9dbd1;
  font: 500 13px/1.5 var(--sans, sans-serif);
  letter-spacing: .1px;
}
#book-sidebar .book-learn-copy { padding: 10px 10px 12px; }
#book-sidebar .book-learn-title { font-size: 13px; }
#book-sidebar .book-learn-summary,
#book-sidebar .book-sidebar-note {
  margin: 6px 0 0;
  color: #b2c9c4;
  font: 400 12px/1.65 var(--sans, sans-serif);
}
#book-sidebar .book-learn-action { font-size: 11px; }
#book-sidebar .book-full-art-thumb { aspect-ratio: 4 / 3; padding: 6px; }
#book-sidebar .book-full-art-thumb img {
  position: static;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
#book-sidebar .book-sidebar-place-art { display: grid; place-items: center; }
#book-sidebar .mini-planet.mini-preview {
  position: relative;
  inset: auto;
  width: 76px;
  height: 76px;
  margin: 8px auto;
}
#book-sidebar .book-learn-visual svg { display: block; width: 100%; height: auto; }

@media (min-width: 1600px) {
  .book-reader #reader-scroll { --book-sidebar-width: clamp(230px, 18vw, 300px); }
  #book-sidebar .book-learning-heading { font-size: 11px; }
  #book-sidebar .book-sidebar-jumps button { min-height: 34px; font-size: 13px; padding-inline: 8px; }
  #book-sidebar .book-sidebar-heading,
  #book-sidebar .book-learn-title { font-size: 16px; }
  #book-sidebar .book-learn-summary { font-size: 14px; }
  #book-sidebar .book-learn-action { font-size: 13px; }
  #book-sidebar .mini-planet.mini-preview { width: 96px; height: 96px; }
}
@media (max-width: 900px) {
  .book-reader #reader-scroll { --book-sidebar-width: clamp(160px, 23vw, 210px); gap: 14px; }
  .book-reader #book-sidebar { padding-left: 9px; padding-right: 5px; }
}
@media (max-width: 600px) {
  .book-reader #reader-scroll { --book-sidebar-width: 132px; grid-template-columns: minmax(0, 1fr) 132px; gap: 9px; }
  .book-reader #book-sidebar { padding: 5px 3px 12px 7px; }
  #book-sidebar .book-learning-heading { font-size: 8px; letter-spacing: .8px; }
  #book-sidebar .book-sidebar-jumps { gap: 4px; }
  #book-sidebar .book-sidebar-jumps button { min-height: 28px; padding: 4px; font-size: 10px; }
  #book-sidebar .book-sidebar-heading,
  #book-sidebar .book-learn-title { font-size: 12px; }
  #book-sidebar .book-learn-copy { padding: 7px 7px 9px; }
  #book-sidebar .book-learn-summary { font-size: 11px; line-height: 1.6; }
  #book-sidebar .book-learn-action { font-size: 10px; }
  #book-sidebar .mini-planet.mini-preview { width: 62px; height: 62px; }
}
