/* Keep historical scans in their original proportions, without letterboxed frames.
 * Custom uploaded artwork keeps the app's original cover treatment. */
html :is(.landing, .library-view, .starter-books) .book-cover.uploaded-cover:has(> img[src^="/covers/"]) {
  --scan-ratio: 427 / 640;
  width: auto;
  max-width: 100%;
  aspect-ratio: var(--scan-ratio);
  overflow: hidden;
  background: transparent;
}
html :is(.landing, .library-view, .starter-books) .book-cover.uploaded-cover:has(> img[src="/covers/alice-1865-20261111.jpg"]) {
  --scan-ratio: 413 / 640;
}
html .book-cover.uploaded-cover > img[src^="/covers/"] {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Match each scan's binding, independent of its position in the shelf. */
.book-display:has(img[src="/covers/alice-1865-20261111.jpg"]) {
  background: var(--color-display-rose);
}
.book-display:has(img[src="/covers/pride-1894-20261111.jpg"]) {
  background: var(--color-display-green);
}
.book-display:has(img[src="/covers/sherlock-1892-20261111.jpg"]) {
  background: var(--color-display-blue);
}
