/* Book detail page hero cover (.book-summary-cover*) and edition-list
   cover treatment (.work-edition-cover) - NOT the catalog card grid, see
   book-card.css for that (.unified-book-card etc. used to live here too,
   moved out 2026-07-22 during the CSS consolidation). */

/* The hero cover previously used a fixed 270x390 box with its own fill
   color - for a narrower-than-average cover this showed as a big empty
   colored rectangle around a much smaller image. No fixed height, no
   background: the image just renders at its own aspect ratio within the
   width cap, so the box is never bigger than the cover actually is. */
.book-summary-cover {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  background: none !important;
  padding: 0 !important;
}
.book-summary-cover img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  object-fit: contain !important;
  object-position: center;
  margin: 0 auto !important;
}

/* Cover + goodreads badge stacked as one column, sized to the cover's own
   width (see .book-summary-cover above) - the badge previously sat
   absolutely over the top-right corner of the whole summary block, which
   overlapped long two-line titles. Normal flow under the cover instead. */
.book-summary-cover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 270px;
  flex: 0 0 auto;
}
@media (max-width: 760px) {
  .book-summary-cover-wrap {
    width: 180px;
  }
}
@media (max-width: 520px) {
  .book-summary-cover-wrap {
    width: 160px;
  }
}

/* Placeholder for the hero cover specifically (book-card.css has its own
   copy of the shared .book-cover-placeholder/.placeholder-icon rules for
   catalog cards - duplicated on purpose rather than shared across files,
   so neither depends on the other still existing). */
.book-summary-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 14px;
  color: #a8937d;
  text-align: center;
}
.book-summary-placeholder .placeholder-icon {
  width: 34%;
  max-width: 46px;
  height: auto;
  opacity: 0.5;
}
.book-summary-placeholder.small .placeholder-icon {
  max-width: 30px;
}
.book-summary-placeholder small {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}
.book-summary-placeholder[hidden] {
  display: none !important;
}

/* .work-edition and .offer-row-modern both set display:grid
   unconditionally (postgres-ui.css/style.css), which - being an author
   stylesheet - beats the browser's own default [hidden]{display:none}
   (a user-agent stylesheet rule, always overridden by any author rule
   regardless of specificity/order). That silently broke the offer-filter
   buttons on the book detail page: their JS toggles the `hidden` property
   correctly, but the row/edition stayed visually rendered anyway. */
.work-edition[hidden],
.offer-row-modern[hidden] {
  display: none !important;
}

.goodreads-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff6da;
  color: #6b5420;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.goodreads-badge b {
  font-family: "Literata", Georgia, serif;
}
.goodreads-badge img {
  width: 14px;
  height: 14px;
}

/* Same never-crop rule as book-card.css's cover image, for the per-edition
   cover thumbnails in the book detail page's edition list. */
.work-edition-cover img {
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain !important;
  object-position: center;
}

.edition-heading-meta {
  overflow-wrap: anywhere;
}

/* Wishlist page's own goodreads-rating chip (app/templates/user/wishlist.html)
   - a different, simpler layout than the catalog card's .card-rating-hero
   overlay, not part of the shared book-card component. */
.card-goodreads {
  margin-top: 3px;
  color: #8a6d1f;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
