/* The prose stays intact; original book art provides a separate right rail. */
.book-linked-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(160px, 21vw, 220px);
  gap: 28px;
  align-items: start;
  width: 100%;
  min-width: 0;
}
.book-linked-prose { min-width: 0; overflow-wrap: anywhere; }
.book-learning-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  min-width: 0;
  max-height: var(--learning-rail-height, calc(100svh - 180px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #587168 #101e23;
  padding: 4px 6px 12px 4px;
}
.book-learning-heading {
  display: block;
  color: #a6c3b5;
  font: 500 9px/1.5 var(--sans, sans-serif);
  letter-spacing: 1.8px;
}
.book-learn-link {
  display: block;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #42635c;
  border-radius: 6px;
  background: #13251f;
  color: var(--mint, #c7e1d5);
  font: 500 13px/1.5 var(--sans, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  text-align: left;
  cursor: pointer;
}
.book-learn-link:hover { background: #23443b; border-color: #7ea897; }
.book-learn-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  overflow: hidden;
  background: #08131b;
  border-bottom: 1px solid #354e47;
}
.book-learn-visual img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
  margin: 0;
}
.book-learn-copy { display: block; padding: 10px 11px 12px; }
.book-learn-title { display: block; font-size: 13px; font-weight: 500; line-height: 1.5; color: #e4ede4; }
.book-learn-action { display: block; margin-top: 6px; color: #a8c9b8; font-size: 10px; line-height: 1.6; }
.book-learn-link:focus-visible,
.book-context-back:focus-visible {
  outline: 3px solid var(--mint, #c7e1d5);
  outline-offset: 3px;
}
.book-context {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 24px;
  border-bottom: 1px solid #3b5753;
  background: #122720;
  color: #d9e7df;
  font-family: var(--sans, sans-serif);
}
.book-context[hidden],
#book-context [hidden] { display: none !important; }
.book-context-back {
  flex-shrink: 0;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #719486;
  border-radius: 4px;
  background: #203e32;
  color: #e1f1e6;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.book-context-back:hover { background: #2a503f; }
.book-context-label { font-size: 13px; line-height: 1.5; font-weight: 500; }
.book-context-caption { font-size: 11px; line-height: 1.6; color: #a9c6b6; }
.book-context-copy { flex: 1; min-width: 160px; }
.book-context-copy > * { display: block; }

@media (min-width: 1600px) {
  .book-linked-layout { gap: 36px; }
  .book-learning-heading { font-size: 11px; }
  .book-learn-title { font-size: 16px; }
  .book-learn-action { font-size: 12px; }
  .book-context { padding: 14px 34px; }
  .book-context-back { min-height: 46px; font-size: 16px; }
  .book-context-label { font-size: 17px; }
  .book-context-caption { font-size: 14px; }
}
@media (max-width: 900px) {
  .book-linked-layout { grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; }
  .book-learn-title { font-size: 12px; }
  .book-learn-copy { padding: 8px 9px 10px; }
}
@media (max-width: 600px) {
  .book-linked-layout { grid-template-columns: minmax(0, 1fr) 112px; gap: 12px; }
  .book-learning-rail { gap: 10px; padding-right: 3px; padding-left: 3px; }
  .book-learning-heading { font-size: 8px; letter-spacing: 1px; }
  .book-learn-copy { padding: 7px 7px 9px; }
  .book-learn-title { font-size: 11px; }
  .book-learn-action { font-size: 9px; }
  .book-context { gap: 8px 12px; padding: 10px 16px; }
  .book-context-back { min-height: 38px; font-size: 11px; }
  .book-context-label { font-size: 12px; }
  .book-context-caption { font-size: 10px; }
}
