/* ============================================================================
 * library-books-modern.css (v2) — modern illustrated hardcover look.
 * Loads AFTER library-books.css and only restyles the look of each book:
 * the 3D box, flip, spine, commerce buttons and all behaviour stay untouched.
 *
 *  FRONT  —  cover illustration (original line art, keyed to the subject)
 *            over the top ~56%, then a dark "plate" with series / title / author.
 *  BACK   —  audience, title, short summary, "Inside" bullets, price, imprint,
 *            and a faint watermark of the same illustration. Never empty.
 * ========================================================================== */

/* ---- calmer rest pose + rounder, more solid block ------------------------ */
.iis-book { --rest-x: 1deg; --rest-y: 14deg; border-radius: 3px 8px 8px 3px; }
.iis-book:nth-child(even),
.iis-book-cell:nth-child(even) .iis-book { --rest-x: 1.5deg; --rest-y: 18deg; }
.iis-book__face { border-radius: 3px 7px 7px 3px; }

/* ---- FRONT COVER ---------------------------------------------------------- */
.iis-book__front {
  background:
    linear-gradient(118deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 14%, transparent 30%, transparent 72%, rgba(0,0,0,0.22) 100%),
    radial-gradient(ellipse at 50% 30%, rgba(255,235,190,0.10) 0%, transparent 55%),
    linear-gradient(160deg, var(--book-color1, #13294b) 0%, var(--book-color2, #0b1f3a) 100%);
  box-shadow:
    0 30px 34px -16px rgba(0,0,0,0.6),
    inset 12px 0 20px -10px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    inset -1px 0 0 rgba(0,0,0,0.4);
}
/* hinge groove stays; drop the old foil frame — the illustration carries the cover now */
.iis-book__front::after { display: none; }

/* illustration area */
.iis-book__art {
  position: absolute;
  top: 0; left: 16px; right: 0;
  height: 57%;
  display: grid;
  place-items: center;
  color: #f1dca7;
  pointer-events: none;
}
.iis-book__art .iis-cover-art {
  width: 76%;
  height: 100%;
  max-height: 100%;
  filter: drop-shadow(0 0 10px rgba(243,220,156,0.22)) drop-shadow(0 1px 0 rgba(0,0,0,0.5));
}

/* title plate */
.iis-book__plate {
  position: absolute;
  left: 16px; right: 0; bottom: 0;
  height: 45%;
  padding: 13px 16px 16px 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.28) 10%, rgba(0,0,0,0.46) 100%);
  border-top: 1px solid rgba(243,220,156,0.22);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.35);
}
/* un-absolute the three text layers so they stack inside the plate */
.iis-book__series, .iis-book__title, .iis-book__author {
  position: static !important;
  top: auto; left: auto; right: auto; bottom: auto;
  transform: none !important;
  text-align: left;
  padding: 0;
}
.iis-book__series {
  font: 600 7.5px/1 "Work Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.30em;
  color: rgba(243,220,156,0.82);
  margin: 0 0 9px;
  text-shadow: none;
}
.iis-book__series::after {
  content: "";
  display: block;
  width: 22px; height: 1px;
  background: rgba(243,220,156,0.6);
  margin-top: 7px;
}
.iis-book__title {
  font: 400 23px/1.08 "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.005em;
  color: #f7eed8;
  background: none;
  -webkit-text-fill-color: #f7eed8;
  filter: none;
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
  -webkit-line-clamp: 3;
  max-height: 3.3em;
  margin: 0 0 auto;
}
.iis-book__title--long  { font-size: 19.5px; }
.iis-book__title--xlong { font-size: 17px; line-height: 1.14; }
.iis-book__author {
  font: 500 7.5px/1.3 "Work Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.22em;
  color: rgba(243,220,156,0.62);
  margin-top: 8px;
  text-shadow: none;
}
/* small square publisher mark — top right, out of the plate's way */
.iis-book__crest {
  top: 12px; right: 12px; bottom: auto;
  width: 22px; height: 22px;
  border-radius: 3px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(243,220,156,0.55);
  box-shadow: inset 0 1px 0 rgba(255,225,150,0.2);
  font: 700 9.5px/1 "Instrument Serif", Georgia, serif;
  z-index: 3;
}

/* ---- BACK COVER ----------------------------------------------------------- */
.iis-book__back {
  padding: 20px 26px 16px 18px;
  background:
    linear-gradient(242deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 14%, transparent 30%, transparent 72%, rgba(0,0,0,0.22) 100%),
    linear-gradient(160deg, var(--book-color1, #13294b) 0%, var(--book-color2, #0b1f3a) 100%);
  box-shadow:
    0 30px 34px -16px rgba(0,0,0,0.6),
    inset -12px 0 20px -10px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    inset 1px 0 0 rgba(0,0,0,0.4);
}
.iis-book__back::after { display: none; }
.iis-book__markwrap {
  position: absolute;
  right: 22px; bottom: 36px;
  width: 46%;
  color: #f1dca7;
  opacity: 0.11;
  pointer-events: none;
}
.iis-book__markwrap .iis-cover-mark { width: 100%; height: auto; display: block; }
.iis-book__audience {
  font-size: 7.5px;
  padding: 4px 9px;
  margin-bottom: 9px;
  background: rgba(0,0,0,0.28) !important;
  border-color: rgba(243,220,156,0.5);
  color: #f3dc9c;
}
.iis-book__back-title {
  font: 400 16px/1.12 "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  color: #f7eed8;
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
  margin: 0 0 7px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.iis-book__summary {
  font: 400 10.5px/1.5 "Work Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  color: rgba(247,238,216,0.80);
  flex: 0 0 auto;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
  position: relative; z-index: 1;
}
.iis-book__inside {
  list-style: none;
  margin: 9px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid rgba(243,220,156,0.22);
  font: 400 9.5px/1.4 "Work Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  color: rgba(247,238,216,0.72);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative; z-index: 1;
}
.iis-book__inside li {
  position: relative;
  padding-left: 13px;
  margin: 0 0 4px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.iis-book__inside li::before {
  content: "";
  position: absolute; left: 0; top: 5px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #f3dc9c;
  box-shadow: 0 0 6px rgba(243,220,156,0.6);
}
.iis-book__inside--author {
  font-style: italic;
  color: rgba(247,238,216,0.7);
  font-size: 10.5px;
}
.iis-book__meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(243,220,156,0.22);
  position: relative; z-index: 1;
}
.iis-book__price { font: 400 17px/1 "Instrument Serif", Georgia, serif; color: #f3dc9c; }
.iis-book__imprint {
  font: 600 7px/1 "Work Sans", "Inter", sans-serif;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(243,220,156,0.5);
}

/* ---- SPINE — clean, two hairlines, serif title ---------------------------- */
.iis-book__spine {
  background:
    linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.08) 60%, rgba(255,255,255,0.05) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--book-color1, #13294b) 85%, black), color-mix(in srgb, var(--book-color2, #0b1f3a) 85%, black));
  box-shadow: inset 0 10px 14px -10px rgba(0,0,0,0.7), inset 0 -10px 14px -10px rgba(0,0,0,0.7), inset 1px 0 0 rgba(0,0,0,0.35);
}
.iis-book__spine::before, .iis-book__spine::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 1px;
  background: rgba(243,220,156,0.5);
}
.iis-book__spine::before { top: 12px; }
.iis-book__spine::after  { bottom: 12px; }
.iis-book__spine-text {
  font: 400 9px/1 "Instrument Serif", Georgia, serif;
  letter-spacing: 0.16em;
  text-transform: none;
  color: rgba(243,220,156,0.85);
}

/* ---- captions + commerce under the book ---------------------------------- */
.iis-book-cap { font-size: 8.5px; letter-spacing: 0.26em; color: rgba(243,220,156,0.6); }
.iis-book-buy .iis-book__price { font-size: 17px; }
.iis-book__open, .iis-book__peek { border-radius: 999px; padding: 9px 14px; }
.iis-book__peek { background: rgba(243,220,156,0.06); }

/* locked / coming-soon: keep the illustration readable, just dim it */
.iis-book.is-locked .iis-book__front { filter: grayscale(0.35) brightness(0.9); }
.iis-book.is-locked .iis-book__art { opacity: 0.75; }

/* ---- slightly richer palette so neighbours don't blur together ---------- */
.iis-book.theme-navy    { --book-color1: #17305a; --book-color2: #0a1a33; }
.iis-book.theme-emerald { --book-color1: #1c5542; --book-color2: #0b271e; }
.iis-book.theme-wine    { --book-color1: #66203a; --book-color2: #330f1b; }
.iis-book.theme-ink     { --book-color1: #26201a; --book-color2: #0d0a06; }
.iis-book.theme-rust    { --book-color1: #7a3618; --book-color2: #3d190a; }
.iis-book.theme-forest  { --book-color1: #244430; --book-color2: #0f1f17; }
.iis-book.theme-cobalt  { --book-color1: #173c6b; --book-color2: #081d3a; }
.iis-book.theme-amber   { --book-color1: #7a4c14; --book-color2: #3a2306; }
.iis-book.theme-slate   { --book-color1: #33404f; --book-color2: #141b25; }
.iis-book.theme-plum    { --book-color1: #482052; --book-color2: #1e0c25; }
