/* Shared cover based on the user's peach book and supplied CSS/SVG source.
   Titles are live text; the spine, paper and decorative frame are reusable. */
.book-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease;
}
.book-button:hover { transform: translateY(-4px); }
.book-button:focus-visible { outline: 3px solid #438951; outline-offset: 7px; }
.sv-book {
  --cover: #f7c6a3;
  --ink: #4b2515;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid color-mix(in srgb, var(--cover), #8b6347 24%);
  border-radius: 4% 5% 5% 4%;
  background:
    linear-gradient(105deg, #ffffff36, transparent 48%, #8b63470e),
    repeating-linear-gradient(28deg, #fff1 0 1px, transparent 1px 3px),
    var(--cover);
  color: var(--ink);
  box-shadow: 2px 5px 8px #60432b2b, inset -2px -2px 3px #8b634726, inset 2px 2px 2px #fff7;
  font-family: ui-rounded, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  container-type: inline-size;
  isolation: isolate;
}
.sv-book::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 8%;
  border-radius: 40% 0 0 40% / 4% 0 0 4%;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--cover), #87451e 16%),
    var(--cover) 72%,
    color-mix(in srgb, var(--cover), #87451e 24%));
  border-right: 1px solid #fff8;
  box-shadow: inset 1px 1px 2px #fff9, 1px 0 2px #87451e33;
  filter: saturate(1.2);
}
.sv-book::after {
  content: '';
  position: absolute;
  inset: 0 0 0 8.3%;
  border-radius: 1% 5% 5% 1%;
  box-shadow: inset 1px 1px 2px #fff9, inset -1px -1px 3px #87451e24;
  pointer-events: none;
}
.sv-book__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: color-mix(in srgb, var(--cover), #aa5025 32%);
  stroke-width: 1.25;
  filter: drop-shadow(.5px .5px 0 #fff8);
  pointer-events: none;
}
.sv-book__content {
  position: absolute;
  top: 53%;
  left: 15%;
  right: 8%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sv-book__title {
  display: block;
  width: 100%;
  margin: 0;
  font-size: var(--book-title-size, 16cqw);
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -.04em;
  text-align: center;
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.sv-book__rule {
  display: block;
  width: 30%;
  height: 1px;
  margin-top: 6cqw;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cover), #b86334 40%), transparent);
}
.sv-book__subtitle {
  display: block;
  width: 100%;
  margin-top: 4.5cqw;
  font-size: 6.7cqw;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.sv-book.is-selected { outline: 2px solid #438951; outline-offset: 4px; }
.book-check {
  position: absolute;
  z-index: 2;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff9ea;
  border-radius: 50%;
  background: #438951;
  box-shadow: 0 2px 5px #35543226;
  color: white;
  pointer-events: none;
  opacity: 0;
  transform: scale(.7);
  transition: opacity 160ms ease, transform 160ms ease;
}
.book-button.is-selected .book-check { opacity: 1; transform: scale(1); }
.book-check svg { display: block; width: 19px; height: 19px; }
.book-button.is-compact .book-check { width: 23px; height: 23px; }

/* The live collection has a calm cloth-like face and a thin cover edge.
   All gradients below belong to the book itself, never the shelf or room. */
.sv-book[data-variant='signature-detail'] {
  border-color: color-mix(in srgb, var(--cover), var(--spine, #5d574c) 22%);
  background:
    linear-gradient(115deg, #ffffff32, #ffffff0b 30%, transparent 58%, #00000007),
    var(--cover);
  box-shadow:
    0 4px 7px #2b241919,
    1px 2px 0 color-mix(in srgb, var(--spine, #5d574c), var(--cover) 30%),
    inset 0 1px 0 #ffffff73,
    inset -1px -1px 1px #00000021;
}
@media (prefers-reduced-motion: reduce) {
  .book-button, .book-check { transition: none; }
}
