/* One consistent, responsive page-turn preview for all four books. */
[data-book-preview][hidden] { display: none !important; }
.book-preview {
  --book-accent: #28685f;
  --book-paper: #edf2ef;
  max-width: 880px;
  min-width: 0;
  margin-inline: auto;
  color: #102c45;
  background: #fff;
  border: 1px solid #cbd6d7;
  border-radius: 6px;
  overflow: hidden;
}
.pages-section .book-preview { --book-accent: #866226; --book-paper: #f5f0e6; }
.book-preview :is(button, p) { font-family: Arial, sans-serif; }
.book-preview button { cursor: pointer; }
.book-preview button:focus-visible, .book-preview:focus-visible { outline: 3px solid var(--book-accent); outline-offset: 3px; }
.book-preview button[aria-disabled="true"] { cursor: default; opacity: .4; }
.book-preview-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 16px 22px;
  border-bottom: 1px solid #d8dfdc;
  font: 12px/1.5 Arial, sans-serif;
}
.book-preview-top > :first-child { color: var(--book-accent); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.book-preview-stage { padding: 24px 20px 26px; overflow: hidden; background: var(--book-paper); }
.book-preview-volume { width: 100%; max-width: 720px; min-width: 0 !important; margin: auto; filter: drop-shadow(0 9px 9px #26352f25); }
.book-preview.has-turned .book-preview-volume { transition: transform .75s cubic-bezier(.25,.7,.25,1); }
.book-preview[data-orientation="landscape"][data-position="front"] .book-preview-volume { transform: translateX(-25%); }
.book-preview[data-orientation="landscape"][data-position="back"] .book-preview-volume { transform: translateX(25%); }
.book-preview-page { overflow: hidden; background: white; border: 1px solid #d7d7cf; user-select: none; }
.book-preview-page img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.book-preview-page::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,#26352f16,transparent 7%,transparent 96%,#26352f06); }
.book-preview-page.--left::after { background: linear-gradient(90deg,#26352f06,transparent 4%,transparent 92%,#26352f1d); }
.book-preview-controls { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 14px; max-width: 620px; margin: 20px auto 0; padding-inline: 20px; }
.book-preview-controls button { min-height: 44px; padding: 0; border: 1px solid #b6c8c8; border-radius: 50%; background: #fff; color: #102c45; font-size: 24px; }
.book-preview-controls button:hover:not([aria-disabled="true"]) { color: white; background: var(--book-accent); border-color: var(--book-accent); }
.book-preview .book-preview-status { margin: 0; text-align: center; font-size: 13px; line-height: 1.5; }
.book-preview-read { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 10px 16px 0; }
.book-preview-read button { min-height: 44px; padding: 8px 0; border: 0; background: none; color: #102c45; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.book-preview-read [hidden] { display: none; }
.book-preview .book-preview-hint { margin: 2px 18px 18px; text-align: center; color: #50616a; font-size: 12px; line-height: 1.6; }
.book-preview-thumbs { display: flex; justify-content: center; gap: 10px; padding: 18px 20px; background: #f8f9f7; border-top: 1px solid #d8dfdc; overflow-x: auto; }
.book-preview-thumb { flex: 0 0 90px; min-width: 0; border: 1px solid transparent; border-radius: 4px; padding: 8px 6px; background: none; color: #52616b; text-align: center; }
.book-preview-thumb img { width: 46px; height: 65px; display: block; object-fit: contain; margin: 0 auto 8px; box-shadow: 0 2px 5px #102c451a; }
.book-preview-thumb span { display: block; font-size: 10px; line-height: 1.4; }
.book-preview-thumb[aria-pressed="true"] { border-color: var(--book-accent); background: white; color: #102c45; }
.book-preview-thumb:hover:not([aria-disabled="true"]) { background: #eaf0ed; }
.book-preview.is-reduced .book-preview-volume { pointer-events: none; transition: none; }
@media (max-width: 650px) {
  .book-preview-top { padding: 14px 16px; }
  .book-preview-stage { padding: 18px 12px 22px; }
  .book-preview-thumbs { justify-content: flex-start; gap: 6px; padding: 14px 12px; }
  .book-preview-thumb { flex-basis: 72px; }
  .book-preview-controls { padding-inline: 16px; gap: 10px; }
}

/* Hardcover depth stays behind the front board while the library turns it. */
.book-preview {
  --book-board: #16334a;
  --book-board-light: #456177;
  --book-depth: 12px;
}
.book-preview-stage {
  padding: 32px 28px 36px;
  background: radial-gradient(ellipse at 52% 88%, #293b3220, transparent 64%), var(--book-paper);
}
.book-preview-camera { transform: perspective(1600px) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
.book-preview.has-turned .book-preview-camera { transition: transform .8s cubic-bezier(.25,.7,.25,1); }
.book-preview[data-position="front"] .book-preview-camera {
  transform: perspective(1600px) rotateX(4deg) rotateY(-16deg) rotateZ(-.8deg);
}
.book-preview-volume {
  --cover-left: 0%;
  --cover-width: 100%;
  transform: translateZ(0);
  filter: drop-shadow(0 15px 13px #26352f35);
}
.book-preview[data-orientation="landscape"] .book-preview-volume { --cover-left: 50%; --cover-width: 50%; }
.book-preview-volume::before,
.book-preview-volume::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.book-preview-volume::before {
  z-index: -2;
  left: var(--cover-left);
  top: 4px;
  width: var(--cover-width);
  height: 100%;
  transform: translate(var(--book-depth), 8px);
  border: 1px solid #0c2335;
  border-radius: 3px 6px 6px 3px;
  background: linear-gradient(110deg, var(--book-board-light), var(--book-board) 40%);
  box-shadow: 2px 4px 6px #0d233524;
}
.book-preview-volume::after {
  z-index: -1;
  left: calc(var(--cover-left) + 3px);
  top: 5px;
  width: calc(var(--cover-width) - 5px);
  height: calc(100% - 2px);
  transform: translate(calc(var(--book-depth) - 2px), 4px);
  border: 1px solid #c4c1b5;
  border-radius: 1px 3px 4px 1px;
  background: repeating-linear-gradient(0deg, #e1dfd5 0px, #f9f8ef 1px, #f9f8ef 2px, #c9c7bc 3px);
  box-shadow: inset -3px 0 3px #928e7530, 1px 1px 0 #fffdf3;
}
.book-preview[data-page="0"] .book-preview-volume::before,
.book-preview[data-page="0"] .book-preview-volume::after { opacity: 1; }
.book-preview .book-preview-cover {
  overflow: visible;
  border: 1px solid #456177;
  border-radius: 3px 7px 7px 3px;
  background: var(--book-board);
  box-shadow: 1px 1px 0 #102c45, 2px 2px 0 #456177, 3px 3px 0 #102c45;
}
.book-preview-cover img {
  position: relative;
  border-radius: 2px 6px 6px 2px;
  background: white;
}
.book-preview .book-preview-cover::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  bottom: -2px;
  width: 13px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, #081c2b, var(--book-board-light) 42%, var(--book-board) 72%);
  box-shadow: inset 1px 0 0 #ffffff40, -1px 0 1px #102c4533;
}
.book-preview .book-preview-cover::after {
  border-radius: 2px 6px 6px 2px;
  background:
    linear-gradient(115deg, #ffffff26, transparent 34%, #102c4509 76%, #ffffff14),
    linear-gradient(90deg, #071e344d, #ffffff35 1.2%, #102c453d 2.4%, #ffffff40 3.8%, #102c4530 4.3%, transparent 6%, transparent 97%, #102c4529);
  box-shadow: inset 0 1px 0 #ffffff8c, inset 0 -2px 2px #102c4530;
}
.book-preview-board-edge {
  position: absolute;
  pointer-events: none;
  right: -4px;
  top: 0;
  width: 4px;
  height: 100%;
  transform-origin: left center;
  transform: rotateY(90deg);
  background: linear-gradient(90deg, #456177, #0c2335);
}
.book-preview-board-bottom {
  position: absolute;
  pointer-events: none;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 4px;
  transform-origin: center top;
  transform: rotateX(-90deg);
  background: #102c45;
}
.book-preview.is-reduced .book-preview-camera,
.book-preview.is-reduced .book-preview-volume::before,
.book-preview.is-reduced .book-preview-volume::after { transition: none; }
@media (max-width: 650px) {
  .book-preview { --book-depth: 9px; }
  .book-preview-stage { padding: 26px 18px 30px; }
  .book-preview[data-position="front"] .book-preview-camera {
    transform: perspective(1400px) rotateX(3deg) rotateY(-12deg) rotateZ(-.5deg);
  }
}

/* Matching back board, with the binding and page stack on the opposite side. */
.book-preview { --back-accent: #ff772e; }
.book-preview[data-book-kind="igcse"] { --back-accent: #e7c17b; }
.book-preview[data-book-kind="biology"] { --back-accent: #83dbd0; }
.book-preview[data-position="back"] .book-preview-camera {
  transform: perspective(1600px) rotateX(4deg) rotateY(16deg) rotateZ(.8deg);
}
.book-preview[data-closed-cover="back"] .book-preview-volume { --cover-left: 0%; }
.book-preview[data-closed-cover="back"] .book-preview-volume::before {
  opacity: 1;
  transform: translate(calc(0px - var(--book-depth)), 8px);
  border-radius: 6px 3px 3px 6px;
}
.book-preview[data-closed-cover="back"] .book-preview-volume::after {
  opacity: 1;
  transform: translate(calc(2px - var(--book-depth)), 4px);
}
.book-preview .book-preview-back-cover {
  border-radius: 7px 3px 3px 7px;
  box-shadow: -1px 1px 0 #102c45, -2px 2px 0 #456177, -3px 3px 0 #102c45;
}
.book-preview .book-preview-back-cover::before {
  left: auto;
  right: -6px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(270deg, #081c2b, var(--book-board-light) 42%, var(--book-board) 72%);
}
.book-preview .book-preview-back-cover::after {
  border-radius: 6px 2px 2px 6px;
  background:
    linear-gradient(245deg, #ffffff16, transparent 34%, #102c450d 76%, #ffffff08),
    linear-gradient(270deg, #071e344d, #ffffff35 1.2%, #102c453d 2.4%, #ffffff40 3.8%, #102c4530 4.3%, transparent 6%, transparent 97%, #102c4529);
}
.book-preview-back-cover .book-preview-board-edge {
  left: -4px;
  right: auto;
  transform-origin: right center;
  transform: rotateY(-90deg);
}
.book-preview-back-art {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10% 11%;
  overflow: hidden;
  border-radius: inherit;
  color: #f8f5ed;
  background: radial-gradient(ellipse at top left, #36576b, transparent 65%), #102b40;
  font-family: Arial, sans-serif;
}
.book-preview-back-art::before {
  content: "";
  position: absolute;
  inset: 4%;
  border: 1px solid #ffffff26;
  border-radius: 2px;
  pointer-events: none;
}
.book-preview-back-brand { font-size: clamp(15px, 1.7vw, 20px); font-weight: 700; letter-spacing: -.04em; }
.book-preview-back-brand small { display: block; margin-top: 7px; font-size: 8px; letter-spacing: .2em; font-weight: 400; color: #d2dce1; }
.book-preview-back-title { font-size: clamp(18px, 2.8vw, 29px); font-weight: 700; line-height: 1.2; max-width: 100%; }
.book-preview-back-title::before { content: ""; display: block; width: 38px; height: 3px; background: var(--back-accent); margin-bottom: 18px; }
.book-preview .book-preview-back-tagline { margin: 18px 0 0; color: #e4e8e9; font-size: clamp(11px, 1.2vw, 13px); line-height: 1.6; }
.book-preview-back-footer { font-size: 9px; line-height: 1.7; letter-spacing: .04em; }
.book-preview-back-footer span { display: block; color: var(--back-accent); margin-bottom: 7px; font-size: 9px; font-weight: 700; }
.book-preview-endpaper { background: #f3f0e7; color: #16334a; }
.book-preview-endpaper-art { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 12%; }
.book-preview-endpaper strong { display: block; font: 400 clamp(21px, 3vw, 32px)/1.2 Georgia, serif; }
.book-preview-endpaper p { margin: 18px 0 0; font-size: clamp(11px, 1.2vw, 13px); line-height: 1.7; }
.book-preview-endpaper small { margin-top: 28px; color: #667370; font: 10px/1.5 Arial, sans-serif; }
.book-preview-thumbs { justify-content: flex-start; }
.book-preview-thumb:first-child { margin-left: auto; }
.book-preview-thumb:last-child { margin-right: auto; }
.book-preview-thumb .book-preview-mini {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 46px;
  height: 65px;
  padding: 6px;
  margin: 0 auto 8px;
  box-shadow: 0 2px 5px #102c451a;
  font: 700 8px/1.4 Arial, sans-serif;
}
.book-preview-mini-back { background: #16334a; color: #f8f5ed; border: 2px solid #345267; }
.book-preview-mini-back::after { content: ""; height: 2px; width: 18px; background: var(--back-accent); margin: 5px auto 0; }
.book-preview-mini-endpaper { background: #f3f0e7; color: #52616b; border: 1px solid #d8d5cb; }
@media (max-width: 650px) {
  .book-preview[data-position="back"] .book-preview-camera {
    transform: perspective(1400px) rotateX(3deg) rotateY(12deg) rotateZ(.5deg);
  }
}
