/* The page turn (turn.js, leaves.js): while it runs the live book waits hidden under copies of its spreads */
.tb.is-turning .tb-sheets,
.tb.is-turning .tb-items {
  visibility: hidden;
}
/* over every piece of the live book (a fold, a drawing, a piece gliding: z-index up to 7), so in the frame or two both
   show as a turn begins and lands (turn.js hideLive) the copies alone are seen: the live fold over them darkened the
   fold twice over for a frame */
.tb-turning {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  transform-origin: 0 0;
  pointer-events: none;
}
.tb-turn-under,
.tb-turn-air {
  position: absolute;
  inset: 0;
}
.tb-turn-air {
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}
.tb-turn-copy {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.tb-turn-window {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}

/* the spread turned to, while its first page is still to be uncovered by a book being opened: the cover's shape */
.tb-sheet.is-shut .tb-page-left,
.tb-sheet.is-shut .tb-edges-before {
  visibility: hidden;
}
.tb-sheet.is-shut::before {
  left: 50%;
}

/* a leaf: strips hinged on each other from the spine out, a page of paper on each face */
.tb-leaf {
  position: absolute;
  top: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.tb-leaf.is-forward {
  transform-origin: 0 50%;
}
.tb-leaf.is-backward {
  transform-origin: 100% 50%;
}
.tb-leaf-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.tb-leaf-face.is-back {
  transform: rotateY(180deg);
}
.tb-leaf-face > i {
  position: absolute;
  inset: 0;
  background: rgb(46 32 18);
  opacity: 0;
  pointer-events: none;
}

/* the shadow a lifted leaf casts on the page under it, from the spine outward */
.tb-turn-cast {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.tb-turn-cast-1 {
  left: 50%;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgb(46 32 18 / 0.34), rgb(46 32 18 / 0.1) 45%, rgb(46 32 18 / 0));
}
.tb-turn-cast-0 {
  left: 0;
  transform-origin: 100% 50%;
  background: linear-gradient(270deg, rgb(46 32 18 / 0.34), rgb(46 32 18 / 0.1) 45%, rgb(46 32 18 / 0));
}

/* the closed book turned over (leaves.js bookFlip): each side a face turning about the book's upright middle */
.tb-flip-face {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
