/* The book on the web — same design language as the PDF (class names shared
   with functions/bookTemplate.js; theme CSS in /shared/themes/ is applied on
   top via .book.theme-<id>). Used by the public share page, the in-app page
   previews, the style picker, the export preview and the landing showcase.
   Everything is scoped under .book so it can't leak into app chrome. */

.book {
  font-family: Fraunces, Georgia, serif; color: #2c2420; background: #fff;
  text-align: left; line-height: 1.4;
}
.book * { box-sizing: border-box; margin: 0; padding: 0; }
.book > section { padding: 56px 56px; }
@media (max-width: 640px) { .book:not(.fixed) > section { padding: 36px 22px; } }

/* cover */
.book .book-cover { min-height: 74vh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.book .book-title { font-weight: 900; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.06; margin-bottom: 18px; }
.book .book-subtitle { font-style: italic; font-size: 1.05rem; }
.book .cover-ornament { font-size: 1.3rem; margin: 22px 0; }

.book .book-dedication { text-align: center; font-style: italic; font-size: 1.1rem; line-height: 1.8;
  border-top: 1px solid rgba(0,0,0,0.08); border-bottom: 1px solid rgba(0,0,0,0.08); }

/* chapter opener */
.book .chapter-open { padding-top: 72px; }
.book .chapter-num { font-weight: 900; font-size: 5.2rem; line-height: 1; opacity: 0.16; }
.book .chapter-title { font-weight: 900; font-size: 2.1rem; line-height: 1.1; }
.book .chapter-rule { width: 90px; margin: 18px 0 0; border: 0; border-top: 2px solid #2c2420; }

/* recipe */
.book .recipe { border-top: 1px solid rgba(0,0,0,0.06); }
.book .recipe-kicker { font-family: Inter, Helvetica, sans-serif; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.22em; margin-bottom: 10px; }
.book .recipe-title { font-weight: 900; font-size: 1.9rem; line-height: 1.1; margin-bottom: 6px; }
.book .recipe-attribution { font-style: italic; font-size: 0.98rem; margin-bottom: 14px; }
.book .recipe-headnote { font-style: italic; font-size: 1.05rem; line-height: 1.65; margin-bottom: 22px; max-width: 92%; }
.book .recipe-head { display: flex; gap: 26px; align-items: flex-start; }
.book .recipe-head .head-text { flex: 1; min-width: 0; }
.book .dish-art { flex: 0 0 168px; width: 168px; height: 168px; object-fit: cover;
  border-radius: 6px; box-shadow: 3px 4px 14px rgba(44,36,32,0.2); }
@media (max-width: 640px) { .book:not(.fixed) .dish-art { flex-basis: 118px; width: 118px; height: 118px; } }
.book .method-note { font-family: Caveat, cursive; font-size: 1.2rem; line-height: 1.3; margin: -4px 0 10px; opacity: 0.75; }
.book .recipe.no-steps .recipe-columns { display: block; }
.book .recipe.no-steps .ingredients { columns: 2; column-gap: 34px; }
.book .recipe.no-steps .ingredients li { break-inside: avoid; }
@media (max-width: 640px) { .book:not(.fixed) .recipe.no-steps .ingredients { columns: 1; } }
.book .recipe-ornament { text-align: center; font-size: 0.8rem; letter-spacing: 0.7em; text-indent: 0.7em;
  margin-top: 24px; opacity: 0.5; }
.book .recipe-columns { display: flex; gap: 34px; }
@media (max-width: 640px) { .book:not(.fixed) .recipe-columns { flex-direction: column; gap: 20px; } }
.book .ingredients { flex: 0 0 37%; }
.book .steps { flex: 1; }
.book .recipe h4 { font-family: Inter, Helvetica, sans-serif; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 10px; }
.book .ingredients ul { list-style: none; font-size: 0.95rem; line-height: 1.5; }
.book .ingredients li { padding: 5px 0; border-bottom: 1px dotted #d8cdbb; }
.book .steps ol { list-style: none; counter-reset: step; font-size: 1rem; }
.book .steps li { counter-increment: step; margin-bottom: 12px; display: flex; gap: 12px; line-height: 1.6; }
.book .steps li::before { content: counter(step); font-weight: 900; font-size: 1.15rem; min-width: 22px; }
.book .recipe-photo { margin-top: 26px; text-align: center; }
.book .recipe-photo .polaroid { display: inline-block; background: #fffdf8; padding: 12px 12px 6px;
  border: 1px solid #e4dac8; box-shadow: 3px 4px 14px rgba(44,36,32,0.18); transform: rotate(-0.8deg); }
.book .recipe-photo img { max-width: min(420px, 100%); display: block; }
.book .recipe-photo figcaption { font-family: Caveat, cursive; font-size: 1.25rem; margin-top: 4px; }
.book .unclear { background: none; color: inherit; }
.show-unclear .unclear { background: #fde3bd; border-radius: 3px; padding: 0 3px; outline: 1px solid #e8b878; }

.book .book-footer { text-align: center; font-family: Inter, Helvetica, sans-serif; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: #8a7c6b; }

/* ---- mini pages: a real page, drawn at 600px wide and zoomed to fit ----
   (fitMiniPages() in bookRender.js sets --mini-zoom from the box width) */
.mini-page { min-width: 0;
  position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #fff;
  border-radius: 4px; box-shadow: 0 2px 12px rgba(44, 36, 32, 0.14);
}
.mini-page > .book {
  width: 600px; zoom: var(--mini-zoom, 0.3); pointer-events: none;
  min-height: 900px; /* = 600 × 3/2, so the theme's paper colour fills the box */
}
.mini-page > .book > section { padding: 48px 46px; border-top: 0; }
.mini-page > .book .book-cover { min-height: 900px; }
.mini-page > .book .book-dedication { min-height: 900px; display: flex; align-items: center; justify-content: center; border: 0; font-size: 1.7rem; padding: 0 70px; }
.mini-page > .book .chapter-open { min-height: 900px; padding-top: 300px; }
.mini-page.cover-page { box-shadow: 2px 3px 16px rgba(44, 36, 32, 0.25); }
