/* Booklet pages (cover, contents, notes, back) and print imposition. Loaded after card.css. */

/* Handwritten fonts for the child's name (see name-fonts.js). Files load only when used. */
@import url('/fonts/pacifico/400.css');
@import url('/fonts/great-vibes/400.css');
@import url('/fonts/lobster/400.css');
@import url('/fonts/caveat/700.css');
@import url('/fonts/bad-script/400.css');

.cover-title {
  font-family: 'PT Serif', serif;
  font-weight: 700;
  font-size: 2.4em;
  line-height: 1.15;
  color: var(--title);
}
.cover-name {
  font-family: var(--name-font, 'Marck Script'), 'Noto Naskh Arabic', cursive;
  font-weight: var(--name-weight, 400);
  font-size: calc(4.4em * var(--name-scale, 1));
  line-height: 1.25;
  color: var(--name, var(--title));
}

.toc-title {
  font-family: 'PT Serif', serif;
  font-weight: 700;
  font-size: 1.8em;
  color: var(--title);
}
.toc-list {
  font-family: 'PT Serif', serif;
  font-size: 1.05em;
  line-height: 1.45;
  text-align: start;
  padding-inline-start: 1.6em !important;
}
.toc-list.two-columns { column-count: 2; column-gap: 1.6em; }
.toc-list li { break-inside: avoid; }
.toc-list li::marker { color: var(--label); font-weight: 700; }

.back-text {
  font-family: 'PT Serif', serif;
  font-weight: 700;
  font-size: 1.5em;
  color: var(--title);
}
.back-name {
  font-family: var(--name-font, 'Marck Script'), 'Noto Naskh Arabic', cursive;
  font-weight: var(--name-weight, 400);
  font-size: calc(2.2em * var(--name-scale, 1));
  color: var(--name, var(--title));
}

/* Notes page: title + ruled lines filling the rest of the zone. */
.content.notes { height: 100%; display: flex; flex-direction: column; }
.notes .lines {
  flex: 1;
  margin-top: 0.6em !important;
  background: repeating-linear-gradient(to bottom, transparent 0 2.2em, var(--divider) 2.2em calc(2.2em + 1.5px));
  opacity: .7;
}

/* Reading PDF: one page per card. */
.book-read .card { break-after: page; }
.book-read .card:last-child { break-after: auto; }

/* Print PDF: A4 landscape sheets, two 148 mm pages each, saddle-stitch order. */
.sheet {
  position: relative;
  width: 297mm;
  height: 210mm;
  overflow: hidden;
  background: #fff;
  break-after: page;
}
.sheet:last-child { break-after: auto; }
.sheet .slot { position: absolute; top: 31mm; width: 148mm; height: 148mm; }
.sheet .slot.left { left: 0.5mm; }
.sheet .slot.right { left: 148.5mm; }
.sheet .mark { position: absolute; width: 0; height: 6mm; border-left: 0.2mm solid #999; }
.sheet .mark.fold { border-left-style: dashed; }

/* Builder preview: pages laid out at full size, scaled down to thumbnails. */
.thumb { position: relative; overflow: hidden; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.thumb > .card { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
