/* File: books/books-covers.css | Version: 4.4 | Date: 2026-03-05
   Purpose: Professional front/back cover stack + consistent text layout inside book cards
*/

/* ------------------------------------------------------------
   1) HARD FIX: remove the big “text image” background in the cards
   (your HTML currently sets background-image inline; this overrides it)
------------------------------------------------------------ */
.cover.has-covers{
  background:
    radial-gradient(1200px 520px at 18% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.10)) !important;

  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

.cover.has-covers .cover-inner{
  position: relative !important;
  inset: auto !important;

  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

/* ------------------------------------------------------------
   2) Grid: text left, covers right (stretch for consistent bottoms)
------------------------------------------------------------ */
.cover-inner.book-grid{
  display: grid;
  grid-template-columns: 1fr minmax(190px, 260px);
  gap: 22px;
  align-items: stretch; /* key: makes both columns same height */
}

/* ------------------------------------------------------------
   3) Text: make both book cards visually consistent
   - fixed spacing
   - buttons + meta aligned to bottom
------------------------------------------------------------ */
.book-copy{
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-copy .kicker{
  margin: 0 0 8px !important;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .78;
}

/* ✅ smaller, tighter titles (requested) */
.book-copy .title{
  margin: 0 0 10px !important;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.12;
  text-wrap: balance;
  hyphens: auto;
}

.book-copy .desc{
  margin: 0 !important;
  line-height: 1.55;
  opacity: .88;
  max-width: 62ch;
}

/* push actions + meta to the bottom so both cards line up */
.book-copy .hero-actions{
  margin-top: auto !important;
}

/* keep meta consistent */
.book-copy .meta-row{
  margin-top: 10px !important;
  opacity: .78;
}

/* ------------------------------------------------------------
   4) Covers: “stacked” look (front big, back behind)
------------------------------------------------------------ */
.book-covers{
  --w: 210px;                 /* cover width */
  --h: calc(var(--w) * 1.5);  /* 2/3 ratio => height = width * 1.5 */
  --dx: 34px;                 /* back offset X */
  --dy: 54px;                 /* back offset Y */

  position: relative;
  width: calc(var(--w) + var(--dx));
  height: calc(var(--h) + var(--dy));
  justify-self: end;
  align-self: start;
}

.book-covers::before,
.book-covers::after{
  content: none !important;
  display: none !important;
}

.mini-cover{
  position: absolute;
  width: var(--w);
  height: var(--h);
  border-radius: 14px;
  overflow: hidden;

  background-color: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 42px rgba(0,0,0,.55);
}

.mini-cover > img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mini-cover::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.38));
}

.mini-cover.back{
  top: var(--dy);
  left: var(--dx);
  z-index: 1;
  opacity: .92;
  transform: rotate(3deg) scale(.98);
}

.mini-cover.front{
  top: 0;
  left: 0;
  z-index: 2;
  transform: rotate(-1.2deg);
}

/* ------------------------------------------------------------
   5) Responsive
------------------------------------------------------------ */
@media (max-width: 980px){
  .cover-inner.book-grid{
    grid-template-columns: 1fr;
    align-items: start;
  }

  .book-copy{
    height: auto;
  }

  .book-copy .hero-actions{
    margin-top: 14px !important; /* on mobile we don't force bottom alignment */
  }

  .book-covers{
    justify-self: start;
    --w: 200px;
    --dx: 30px;
    --dy: 48px;
  }
}

@media (max-width: 560px){
  .book-covers{
    --w: 180px;
    --dx: 26px;
    --dy: 42px;
  }

  .book-copy .title{
    font-size: 19px;
  }
}