/* v5.5 - unified bookshelf / display case and physically legible reading spotlight.
   Images are never changed; only CSS mapping and presentation are adjusted.
   Source preparation standard: F/B 1415 x 2050, S 520 x 2050. */
:root { --ryu-cover-aspect: 1415 / 2050; }

/* Featured display: image fills the ENTIRE cover face, not the remaining area
   inside an artificial 4px binding border. No contain letterboxing. */
.shelf-grid .bookcase-featured .featured-cover {
  display: block;
  box-sizing: border-box;
  aspect-ratio: var(--ryu-cover-aspect) !important;
  border: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 2px 5px 5px 2px;
  background-clip: border-box;
}
.shelf-grid .bookcase-featured .featured-cover > img {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: inherit;
  transform: none !important;
}
.shelf-grid .bookcase-featured .featured-card {
  box-sizing: border-box;
  min-width: 0;
}

/* Bookcase slots use 205px x 52px for ALL works. Mobile --factor stays active.
   This does not rewrite archived per-work dimensions or change their 3D model ID. */
.shelf-grid .bookcase-frame .spine {
  --w: 52px !important;
  --h: 205px !important;
}
.shelf-grid .bookcase-frame .spine.has-spine-artwork .spine-artwork {
  width: 100% !important;
  height: 100% !important;
  inset: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: none !important;
}

/* Top-down reading light: a bright pool above the selected work fading down
   the shelf. No polygon clip or abrupt horizontal edge. */
.shelf-grid[data-ryu-light="subtle"] {
  --ryu-spotlight-opacity: .9;
  --ryu-spine-warmth: .46;
}
.shelf-grid[data-ryu-light="balanced"] {
  --ryu-spotlight-opacity: 1;
  --ryu-spine-warmth: .6;
}
.shelf-grid[data-ryu-light="dramatic"] {
  --ryu-spotlight-opacity: 1;
  --ryu-spine-warmth: .75;
}
.shelf-grid .bookcase-frame .book-slot::before {
  top: -12px !important;
  bottom: 0 !important;
  height: calc(100% + 12px) !important;
  left: 50% !important;
  width: clamp(160px, 23vw, 218px) !important;
  transform: translateX(-50%) !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  background:
    radial-gradient(ellipse 22% 10% at 50% 6%, rgba(255,240,196,.88) 0%, rgba(255,222,164,.33) 48%, transparent 100%),
    radial-gradient(ellipse 49% 77% at 50% 7%, rgba(255,220,151,.52) 0%, rgba(248,197,124,.22) 42%, rgba(240,174,104,.08) 72%, transparent 100%) !important;
  filter: blur(2px) !important;
  mix-blend-mode: screen;
  pointer-events: none;
}
/* Highlight the book's top edge with a soft band, not a fake glass rectangle. */
.shelf-grid .bookcase-frame .spine .ryu-spotlight-face {
  background: linear-gradient(180deg, rgba(255,240,195,.74) 0%, rgba(255,225,163,.28) 19%, rgba(255,212,145,.09) 51%, transparent 83%) !important;
}
.shelf-grid .bookcase-frame.ryu-spotlight-active .spine.pulled {
  filter: brightness(1.12) !important;
}
@media (max-width: 690px) {
  .shelf-grid .bookcase-frame .book-slot::before {width: clamp(124px, 34vw, 165px) !important; filter: blur(1.5px) !important;}
}
@media (prefers-reduced-motion: reduce) {
  .shelf-grid .bookcase-frame .book-slot::before,
  .shelf-grid .bookcase-frame .spine .ryu-spotlight-face {transition: none !important;}
}
