/* Book preview drawing styles for pages built by bookPreview.js.
   Shared by the website designer (print/index.html) and the app's offline
   proof renderer, so both draw the same pages. Page layout, navigation and
   editor controls stay in each surface's own stylesheet. Loads after
   bookFonts.css and before the page's own <style>. */

.proof-spread, .design-mini, .style-type-sample {
  --paper: #fffdf7;
  --ink: #2e2119;
  --cocoa: #5a4233;
  --gold-deep: #966817;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.proof-spread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  overflow: hidden;
  background: #cfc5b4;
  border: 1px solid rgba(46, 33, 25, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(46, 33, 25, 0.22);
}
.proof-spread::after {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 5.5%;
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(27, 20, 15, 0.31) 44%, rgba(255, 255, 255, 0.16) 52%, transparent);
  mix-blend-mode: multiply;
}
.proof-spread.single { grid-template-columns: minmax(0, 0.5fr); justify-content: center; }
.proof-spread.single::after { display: none; }
.proof-spread.gutter-warning::after { background: linear-gradient(90deg, transparent, rgba(143, 47, 36, 0.45) 45%, rgba(255, 226, 202, 0.28) 52%, transparent); }
.proof-page { position: relative; min-width: 0; aspect-ratio: 148 / 210; overflow: hidden; background: var(--paper); }
.proof-page.left { box-shadow: inset -18px 0 26px -22px rgba(0, 0, 0, 0.8); }
.proof-page.right { box-shadow: inset 18px 0 26px -22px rgba(0, 0, 0, 0.8); }
.proof-page.blank { display: grid; place-items: center; color: #8b806f; font-size: 13px; }
.proof-page-content { position: relative; z-index: 1; height: 100%; }
.proof-page-artwork { position: relative; overflow: hidden; background: #eee7da; }
.proof-page-artwork img { position: absolute; top: 0; width: 200%; max-width: none; height: 100%; object-fit: cover; user-select: none; }
.proof-page-artwork img.source-left { left: 0; }
.proof-page-artwork img.source-right { left: -100%; }
.proof-page-copy { display: grid; align-content: start; overflow: hidden; color: var(--bk-intInk, var(--ink)); background: transparent; }
.proof-page-copy p { margin: 0; white-space: pre-line; font-family: var(--bk-story-body, "Storybee Ysabeau Infant", "Storybee Noto Sans", sans-serif); font-size: calc(3.6cqw * var(--ts-scale, 1)); line-height: 1.35; }
.proof-page-number { position: absolute; right: 4cqw; bottom: 1.2cqw; color: var(--bk-intInk, var(--ink)); font-family: "Storybee Nunito", "Storybee Noto Sans", sans-serif; font-size: 1.79cqw; opacity: 0.62; }
.proof-page-summary { display: grid; align-content: center; height: 100%; padding: 44px 34px; text-align: center; }
.proof-page-summary span { color: var(--gold-deep); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.proof-page-summary p { color: var(--ink); font-family: "Storybee Fraunces", "Storybee Noto Sans", sans-serif; font-size: 20px; }
.proof-page-summary small { display: block; margin-top: 12px; color: var(--cocoa); }
.page-review-flag { position: absolute; z-index: 4; top: 10px; right: 10px; padding: 5px 8px; color: var(--danger); background: var(--danger-bg); border-radius: 999px; font-size: 11px; font-weight: 900; }

/* Default title lettering sits in :where() (zero specificity) so the chosen
   .typeface-* class from bookFonts.css always wins. */
:where(.proof-spread) {
  --bk-display: "Storybee Fraunces", "Storybee Noto Sans", sans-serif;
}
.proof-spread {
  font-family: var(--bk-support);
}

/* ── Design pages (generated decor + dynamic text slots) ─────── */
.proof-page { container-type: inline-size; }
.design-page { position: absolute; inset: 0; overflow: hidden; }
.design-cover { background: var(--bk-cover); }
.design-interior { background: var(--paper); }
.design-page [data-slot] { overflow: hidden; pointer-events: none; }
.design-page [data-slot][data-edit-key] { pointer-events: auto; }

.design-mini {
  position: relative;
  display: block;
  overflow: hidden;
  width: 44px;
  aspect-ratio: 264 / 375;
  container-type: inline-size;
  border-radius: 2px 4px 4px 2px;
  box-shadow: inset 2px 0 4px -2px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(46, 33, 25, 0.25);
}
.design-page { position: absolute; z-index: 0; inset: 0; overflow: hidden; container-type: inline-size; }
.design-mini .design-page { position: absolute; inset: 0; }

@media (max-width: 620px) {
  .proof-page-summary { padding: 9cqw 7cqw; }
  .proof-page-summary span { font-size: 3.2cqw; }
  .proof-page-summary p { font-size: 5cqw; }
  .proof-page-summary small { font-size: 3.2cqw; }
  .page-review-flag { top: 3cqw; right: 3cqw; padding: 3px 7px; font-size: 2.7cqw; }
}
