/* Final approved series-book realism refinement — 16 Aug 2026.
   Keeps every original cover image untouched and changes only the physical 3D presentation. */

.series-books .book3d:nth-child(n){
  position:relative;
  transform-style:preserve-3d;
  transform-origin:center bottom;
  --book-lift:0px!important;
  --book-ry:-3.8deg!important;
  --book-depth:13px;
  transform:perspective(1450px) translateY(0) rotateY(-3.8deg) rotateX(.35deg)!important;
  filter:drop-shadow(0 17px 14px rgba(28,24,19,.24));
}

/* Untouched front cover. */
.series-books .book3d:nth-child(n) img{
  position:relative;
  z-index:4;
  border-radius:1px 3px 3px 1px;
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,.12),
    inset -1px 0 0 rgba(0,0,0,.20),
    0 2px 3px rgba(0,0,0,.18),
    0 12px 22px rgba(0,0,0,.18)!important;
}

/* Visible page block on the right edge, like a real standing paperback/hardback. */
.series-books .book3d:nth-child(n)::before{
  content:"";
  position:absolute;
  z-index:2;
  left:auto!important;
  right:calc(-1 * var(--book-depth));
  top:4px;
  bottom:5px;
  width:var(--book-depth);
  background:
    repeating-linear-gradient(90deg,
      #d9d0c1 0,
      #f5eee2 1px,
      #e8dfd1 2px,
      #c9bfaf 3px);
  clip-path:polygon(0 0,100% 3%,100% 97%,0 100%);
  box-shadow:
    inset 2px 0 2px rgba(255,255,255,.55),
    inset -2px 0 3px rgba(71,59,45,.20),
    4px 8px 9px rgba(0,0,0,.13);
  transform:translateZ(-1px);
}

/* Bottom page edge and contact shadow. */
.series-books .book3d:nth-child(n)::after{
  content:"";
  position:absolute;
  z-index:1;
  left:5px;
  right:calc(-1 * var(--book-depth) + 2px);
  bottom:-7px;
  height:8px;
  background:linear-gradient(180deg,#f0e8da 0%,#d5cab9 45%,#958a7b 100%);
  clip-path:polygon(0 0,100% 0,96% 100%,4% 100%);
  box-shadow:0 8px 12px rgba(0,0,0,.24);
}

.series-books .book3d:nth-child(n):hover{
  transform:perspective(1450px) translateY(-5px) rotateY(-2deg) rotateX(.12deg)!important;
  filter:drop-shadow(0 20px 17px rgba(28,24,19,.28));
}

/* Six-book series: slightly subtler angle so every title remains readable. */
.series-books.six .book3d:nth-child(n){
  --book-depth:10px;
  --book-ry:-3deg!important;
  transform:perspective(1450px) translateY(0) rotateY(-3deg) rotateX(.28deg)!important;
}
.series-books.six .book3d:nth-child(n):hover{
  transform:perspective(1450px) translateY(-5px) rotateY(-1.5deg) rotateX(.1deg)!important;
}

/* Three-book series can carry a little more physical depth. */
.series-books.three .book3d:nth-child(n){
  --book-depth:16px;
  --book-ry:-4.2deg!important;
  transform:perspective(1500px) translateY(0) rotateY(-4.2deg) rotateX(.35deg)!important;
}

@media(max-width:960px){
  .series-books .book3d:nth-child(n),
  .series-books.six .book3d:nth-child(n),
  .series-books.three .book3d:nth-child(n){
    --book-depth:10px;
    --book-ry:-2.6deg!important;
    transform:perspective(1250px) translateY(0) rotateY(-2.6deg) rotateX(.25deg)!important;
  }
}

@media(max-width:640px){
  .series-books .book3d:nth-child(n),
  .series-books.six .book3d:nth-child(n),
  .series-books.three .book3d:nth-child(n){
    --book-depth:8px;
    --book-ry:-2deg!important;
    transform:perspective(1050px) translateY(0) rotateY(-2deg) rotateX(.2deg)!important;
    filter:drop-shadow(0 11px 10px rgba(28,24,19,.20));
  }
}