/* Static app cover finish.
 * Sources: Theme.swift BookCoverFinish/bookShadow, CoverLighting.swift .fixed,
 * and the five original Book* plate assets in NowReading/Assets.xcassets.
 * At the selected resting lamp, relitPlate leaves the painted lighting in
 * place; its contrast dial is the only coverage adjustment used here.
 */
.book-cover {
  --cover-corner-radius: 3px;
  --cover-finish-contrast: .9980276897549629;
  display: block;
  isolation: isolate;
  overflow: visible;
}

.book-cover:not(.flow-cover) { position: relative; }

/* The app's shadow plate replaces the landing's synthetic cover shadows.
 * Keep the outer wrapper unclipped so the plate can extend past the board.
 */
.hero .flow-cover.book-cover {
  --cover-corner-radius: 5px;
  border-radius: 0;
  box-shadow: none;
}

.book-cover::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -10.9%;
  top: -4.7%;
  width: 121.8%;
  height: 116.6%;
  background: url("assets/cover-finish/cover-shadow.png") center / 100% 100% no-repeat;
  opacity: .6;
  pointer-events: none;
}

.book-cover-surface {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--cover-corner-radius);
  isolation: isolate;
}

.book-cover-art {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.book-cover-plate {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: var(--cover-finish-contrast);
  pointer-events: none;
}

/* Dynamic plates already include the app's contrast in relitPlate. */
.hero[data-cover-lighting="dynamic"] .book-cover-plate { opacity: 1; }

/* The order matches SimulatedCoverLighting's fixed cover composition. */
.book-cover-normal {
  z-index: 1;
  background-image: url("assets/cover-finish/spine-normal.png");
}

.book-cover-softlight {
  z-index: 2;
  background-image: url("assets/cover-finish/spine-softlight.png");
  mix-blend-mode: soft-light;
}

.book-cover-burn {
  z-index: 3;
  background-image: url("assets/cover-finish/spine-burn.png");
  mix-blend-mode: multiply;
}

.book-cover-edges {
  z-index: 4;
  background-image: url("assets/cover-finish/cover-edges.png");
}

/* Responsive art keeps the exact board dimensions and native finish layers. */
.book-cover-surface > picture { display: block; width: 100%; height: 100%; }
