/* Book artwork is shown in full. Uniform shelf frames intentionally use fill:
   Andre chose equal frames, complete images and no empty bands (2026-11-10).
   Do not restore contain in those fixed frames: it reintroduces the bands.
   Applies to public previews, featured books and detail covers too.
   Reading pages and category illustrations stay independent. */
.book-card>img,.public-cover>img,.detail-hero>img.detail-cover,
.compact-detail .detail-cover,.hero-book-cover{
  object-fit:fill!important;
  object-position:center!important;
  display:block;
  background:linear-gradient(145deg,#242027,#100f13);
  image-rendering:auto;
}
.book-card,.public-cover{
  aspect-ratio:var(--ui-cover-ratio,2/3);
  min-width:0;
  min-height:0;
  overflow:hidden;
  background:#151215;
}
/* Intrinsic image dimensions must never resize a card or leave a baseline gap. */
.book-card>img,.public-cover>img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
}
.detail-hero>img.detail-cover,.compact-detail .detail-cover,.hero-book-cover{
  aspect-ratio:var(--ui-cover-ratio,2/3);
  height:auto;
  max-height:none;
  align-self:start;
}

/* A featured book is an introduction to the shelves, not a full-height poster.
   Long names keep their complete text in the DOM and in the detail sheet. */
.hero{
  min-height:0;
  padding:100px 5vw 30px;
  align-items:center;
}
.hero-feature{
  display:grid;
  grid-template-columns:clamp(120px,12vw,160px) minmax(0,1fr);
  align-items:center;
  gap:clamp(18px,2.5vw,32px);
  width:min(1180px,100%);
}
.hero-book-cover{width:100%;margin:0}
.hero-feature .hero-content{
  width:auto;
  max-width:780px;
  min-width:0;
  margin:0;
  align-self:center;
}
.hero-feature>.hero-content:only-child{grid-column:1/-1}
.hero-feature .hero-content h1{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  overflow-wrap:anywhere;
  font-size:clamp(28px,3vw,40px);
  line-height:1.14;
  letter-spacing:-.028em;
  margin:10px 0;
  text-wrap:pretty;
}
.hero-feature .hero-content h1.hero-title--long{font-size:clamp(25px,2.4vw,32px)}
.hero-feature .hero-content p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  max-width:100%;
  font-size:15px;
  line-height:1.45;
  margin:0;
}
.hero .actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  width:min(380px,100%);
  gap:9px;
  margin-top:17px;
}
.hero .actions .btn{width:100%;font-size:13px;padding:0 10px}

/* The sheet exposes the full title, including subtitles; no hidden second
   title and no fixed text-box height. Extra-long titles use a quieter size. */
.compact-detail h2{
  display:block;
  -webkit-line-clamp:unset;
  overflow:visible;
  overflow-wrap:anywhere;
  font-size:clamp(21px,2.2vw,28px);
  line-height:1.16;
  letter-spacing:-.022em;
  margin:8px 0 6px;
  text-wrap:pretty;
}
.compact-detail h2.detail-title--long{font-size:clamp(18px,1.8vw,23px)}
.compact-detail .detail-cover{max-width:100%}

/* Keep cover labels sharp when hovering: their layer must not be scaled. */
.book-card:hover,.book-card:focus-visible,
.public-cover:hover,.public-cover:focus-visible{transform:none!important}
.book-card>img,.public-cover>img{transform:none!important}

@media(max-width:1024px) and (min-width:761px){
  .hero{padding-top:94px;padding-bottom:25px}
  .hero-feature{grid-template-columns:128px minmax(0,1fr);gap:22px}
}
@media(max-width:760px){
  .hero{padding:72px 18px 24px}
  .hero-feature{grid-template-columns:94px minmax(0,1fr);gap:13px;align-items:start}
  .hero-book-cover{margin-top:2px}
  .hero-feature .hero-content{align-self:start}
  .hero-feature .hero-content h1{
    -webkit-line-clamp:3;
    font-size:clamp(22px,5.8vw,28px);
    line-height:1.15;
    margin:7px 0 8px;
  }
  .hero-feature .hero-content h1.hero-title--long{font-size:clamp(20px,5.4vw,25px)}
  .hero-feature .hero-content p{font-size:12px;line-height:1.4}
  .hero .eyebrow{font-size:9px;line-height:1.3;letter-spacing:.09em}
  .hero .actions{gap:6px;margin-top:12px}
  .hero .actions .btn{height:40px;min-height:40px;max-height:none;font-size:clamp(10px,3.2vw,12px);padding:0 5px}
  .compact-detail{grid-template-columns:clamp(104px,29vw,132px) minmax(0,1fr)}
  .compact-detail .detail-cover{width:100%;height:auto;max-height:none}
  .compact-detail .detail-info{min-height:0}
  .compact-detail h2{font-size:20px;line-height:1.18;margin:6px 0}
  .compact-detail h2.detail-title--long{font-size:17px;line-height:1.2}
  .compact-detail .rating{margin-top:4px}
}

/* Respect the user's larger-text preference while keeping controls usable. */
html:is([data-text-size="large"],[data-text-size="xlarge"]) .hero .actions .btn{
  min-height:44px;height:auto;max-height:none;white-space:normal;padding:8px 6px;
}

/* All book surfaces share fully occupied frames without cropping source pixels.
   Overlays remain over the frame; reading pages preserve natural proportions. */
.book-card.cover-layout,.public-cover.cover-layout{
  display:flex;flex-direction:column;gap:0;aspect-ratio:auto;position:relative;
  padding:0;border:0;border-radius:0;overflow:visible;background:transparent;
  box-shadow:none;box-sizing:border-box;isolation:isolate;
}
.cover-layout .book-art{
  display:flex;position:relative;align-items:center;justify-content:center;
  flex:none;aspect-ratio:var(--ui-cover-ratio,2/3);width:100%;min-width:0;overflow:visible;
  inset:auto;padding:0;background:none;box-sizing:border-box;
}
.book-card.cover-layout .book-art,.public-cover.cover-layout .book-art{overflow:hidden;border:var(--ui-cover-border);border-radius:var(--ui-cover-radius);background:#151215}
/* Andre requires the entire image to fill the same fixed frame (27/11/2026).
   fill retains every source pixel while removing the empty contain bands. */
.book-card.cover-layout .book-art>img,.public-cover.cover-layout .book-art>img{display:block;position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;box-sizing:border-box;box-shadow:none;aspect-ratio:auto;background:transparent;transform:none!important;object-fit:fill!important;object-position:center!important}
.book-card.cover-layout:hover,.book-card.cover-layout:focus-visible,.book-card.cover-layout.peek,
.public-cover.cover-layout:hover,.public-cover.cover-layout:focus-visible{box-shadow:none;transform:none!important;outline:none}
.public-cover.cover-layout:hover .book-art,.public-cover.cover-layout:focus-visible .book-art{border-color:#ff647b;box-shadow:0 0 0 1px #ff647b55,0 7px 18px #0008}
.book-card.cover-layout:hover .book-art,.book-card.cover-layout:focus-visible .book-art{border-color:#ff647b}
.book-card.cover-layout:focus-visible .book-art,.public-cover.cover-layout:focus-visible .book-art{outline:2px solid #ffacbd;outline-offset:3px;border-radius:8px}
.book-row{--book-row-art-height:clamp(189px,19.5vw,267px);align-items:flex-start}
.book-row .book-card.cover-layout{
  flex:0 0 auto;width:calc(var(--book-row-art-height) * 2 / 3);
  max-width:calc(100vw - 48px);height:auto;max-height:none;
}
.book-row .book-card.cover-layout .book-art{width:100%;height:var(--book-row-art-height);aspect-ratio:var(--ui-cover-ratio,2/3)}
.book-row .book-card.cover-layout:hover .book-art,.book-row .book-card.cover-layout:focus-visible .book-art{border-color:#ff647b}
.book-grid:not(.book-row):has(>.book-card.cover-layout){
  --grid-art-height:clamp(175px,18vw,240px);display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;
}
.book-grid:not(.book-row)>.book-card.cover-layout{
  flex:0 0 auto;align-self:start;min-width:0;height:auto;max-height:none;
  width:calc(var(--grid-art-height) * 2 / 3);
  max-width:calc(100vw - 48px);
}
.book-grid:not(.book-row)>.book-card.cover-layout .book-art{height:var(--grid-art-height);aspect-ratio:var(--ui-cover-ratio,2/3)}
.related-grid.book-grid:not(.book-row):has(>.book-card.cover-layout){--grid-art-height:clamp(132px,14vw,190px)}
.public-cover-rail{--public-art-height:190px;align-items:flex-start}
.public-cover-rail .public-cover.cover-layout{flex:0 0 auto;width:calc(var(--public-art-height) * 2 / 3);max-width:none}
.public-cover.cover-layout .book-art{height:var(--public-art-height,190px);aspect-ratio:var(--ui-cover-ratio,2/3)}
.public-cover.cover-layout .public-cover-category{position:static;inset:auto;padding:5px 1px 0;background:none;height:28px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:18px;text-align:left}
.detail-hero>img.detail-cover,.compact-detail .detail-cover,.hero-book-cover{
  aspect-ratio:var(--ui-cover-ratio,2/3);height:auto;object-fit:fill!important;background:#151215;
}
.hero-book-cover{width:100%;max-width:160px;max-height:none;justify-self:center}
.compact-detail .detail-cover{width:100%;max-width:200px;max-height:none;justify-self:center}
@media(max-width:760px){
 .book-row{--book-row-art-height:clamp(180px,51vw,225px)}
 .public-cover-rail{--public-art-height:165px}
 .hero-book-cover,.compact-detail .detail-cover{max-height:none}
 .book-grid:not(.book-row):has(>.book-card.cover-layout){--grid-art-height:clamp(110px,35vw,166px)}
 .related-grid.book-grid:not(.book-row):has(>.book-card.cover-layout){--grid-art-height:clamp(110px,32vw,150px)}

}

/* Give the newest book more presence on phones without oversized copy.
   Both actions sit below the cover and description, using the full row. */
@media(max-width:760px){
 .hero-feature:has(>.hero-book-cover){grid-template-columns:clamp(108px,32vw,140px) minmax(0,1fr);grid-template-rows:auto auto 1fr auto;gap:0 13px;align-items:start}
 .hero-feature:has(>.hero-book-cover) .hero-book-cover{grid-column:1;grid-row:1/4;width:100%;max-width:100%;max-height:none;margin:0;align-self:start;justify-self:center}
 .hero-feature:has(>.hero-book-cover) .hero-content{display:contents}
 .hero-feature:has(>.hero-book-cover) .eyebrow{grid-column:2;grid-row:1;font-size:9px;line-height:1.35;align-self:start}
 .hero-feature:has(>.hero-book-cover) .hero-content h1{grid-column:2;grid-row:2;font-size:clamp(18px,5.1vw,22px);line-height:1.18;margin:6px 0 8px;-webkit-line-clamp:3;align-self:start}
 .hero-feature:has(>.hero-book-cover) .hero-content p{grid-column:2;grid-row:3;font-size:12px;line-height:1.4;margin:0;-webkit-line-clamp:3;align-self:start}
 .hero-feature:has(>.hero-book-cover) .actions{grid-column:1/-1;grid-row:4;width:100%;max-width:none;margin-top:14px;gap:8px}
 .hero-feature:has(>.hero-book-cover) .actions .btn{font-size:12px;height:40px;min-height:40px}
}
