/* A book page. Shared by the editor, thumbnails, preview and print view. */
.pg {
  position: relative;
  aspect-ratio: 1;
  container-type: inline-size;
  overflow: hidden;
  background: var(--pg-bg, #fff8ea);
}
.pg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
/* Picture window: the whole picture, uncropped, with the words on the page colour underneath. */
.pg.layout-band .pg-art,
.pg.layout-band .pg-empty {
  inset: 4.5% auto auto 16%;
  width: 68%;
  height: 68%;
  border-radius: 3.5cqw;
}
.pg.layout-band .pg-art { box-shadow: 0 .5cqw 2cqw rgba(20, 24, 40, .16); }
/* On a cover the title sits above the window and the subtitle below it. */
.pg.kind-cover.layout-band .pg-art,
.pg.kind-cover.layout-band .pg-empty {
  inset: 22% auto auto 17%;
  width: 66%;
  height: 66%;
}
.pg-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 4cqw 'Nunito', sans-serif;
  color: #8a8f9c;
  background: repeating-linear-gradient(135deg, #f4eee2 0 3cqw, #efe7d8 3cqw 6cqw);
}
.pg-empty.working { animation: pg-pulse 1.4s ease-in-out infinite; }
@keyframes pg-pulse { 50% { opacity: .55; } }

.tb {
  position: absolute;
  box-sizing: border-box;
  font-size: calc(var(--fs, 5.6) * 1cqw);
  line-height: 1.22;
  padding: .38em .62em;
  border-radius: .45em;
}
.tb-text {
  text-wrap: balance; /* even line lengths: no single word stranded on the last line */
  white-space: pre-wrap;
  overflow-wrap: break-word;
  outline: none;
  min-height: 1.22em;
}
.tb.plate-soft {
  background: color-mix(in srgb, var(--plate, #fff) 86%, transparent);
  box-shadow: 0 .04em .35em rgba(20, 24, 40, .14);
}
.tb.plate-solid { background: var(--plate, #fff); }
.tb.plate-none {
  text-shadow: 0 0 .12em var(--halo, #fff), 0 0 .3em var(--halo, #fff), 0 0 .55em var(--halo, #fff);
}
@media (prefers-reduced-motion: reduce) {
  .pg-empty.working { animation: none; }
}

/* Drawing pages added to fill a printed board book: a framed space to draw in. */
.pg-frame { position: absolute; left: 9%; right: 9%; top: 24%; bottom: 8%; border: 0.6cqw dashed rgba(31, 42, 68, .35);
  border-radius: 3cqw; background: rgba(255, 255, 255, .7); }
