/* A linen cover, visible page edges and a hinged sheet. No bitmap book UI. */
.book-view { perspective: 1400px; padding-block: 16px 32px; }
.book-cover {
  position: relative; overflow: visible; isolation: isolate;
  min-height: 430px; max-width: 430px; margin-inline: auto;
  border: 1px solid #263b2f; border-left: 14px solid #22372b;
  border-radius: 3px 8px 8px 3px;
  background: linear-gradient(90deg, #21372c, #3b5442 8%, #324c3b 55%, #2d4334);
  transform: rotateY(-10deg) rotateZ(-2deg);
  box-shadow: 7px 5px 0 #eee9dc, 10px 7px 0 #beb8a7, 13px 9px 0 #354a3a, 10px 28px 36px #22352530;
  transition: transform 600ms ease, box-shadow 600ms ease;
}
.book-cover::before { content: ""; position: absolute; inset: 11px; border: 1px solid #d6bd7d50; pointer-events: none; z-index: 2; }
.book-cover::after { content: ""; position: absolute; inset: 0 auto 0 5px; width: 2px; background: #ffffff12; pointer-events: none; }
.book-cover:hover { transform: rotateY(-3deg) rotateZ(-1deg) translateY(-4px); box-shadow: 7px 5px 0 #eee9dc, 10px 7px 0 #beb8a7, 13px 9px 0 #354a3a, 10px 35px 42px #22352536; }
.book-cover img { border-radius: 0 7px 7px 0; filter: saturate(.6); }
.book-cover-copy { padding: 38px 24px; }
.book-cover-copy small { color: #d1bf93; letter-spacing: .16em; font-size: 8px; }
.book-cover-copy strong { color: #f3ead5; font-size: clamp(32px,3vw,42px); letter-spacing: .03em; margin-block: 45px 30px; }
.book-cover-copy > span { color: #dddccd; }
.book-cover-copy .book-cover-action { color: #e3d5ac; font-size: 11px; }

dialog.book-dialog {
  width: min(1120px, calc(100vw - 40px)); padding: 8px 18px 0;
  background: #e9e8df; color: #374237; border: 1px solid #ffffff70;
  border-radius: 7px; box-shadow: 0 30px 100px #0006;
}
.book-dialog::backdrop { background: #111c16e6; backdrop-filter: blur(8px); }
.book-dialog .dialog-toolbar { padding-inline: 10px; border: 0; color: #59634f; font-size: 12px; }
.book-dialog .reader-spread {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  width: calc(100% - 24px); margin: 14px 12px 24px; min-height: 500px;
  background: #fbf8ed; border: 1px solid #d8d1bb; border-radius: 2px 7px 7px 2px;
  box-shadow: 0 3px 0 #ded8c5, 0 5px 0 #faf6e9, 0 7px 0 #cfc8b4, 0 9px 0 #f8f3e5, 0 12px 0 #3d5141, 0 20px 30px #17271a30;
  perspective: 2000px; isolation: isolate; touch-action: pan-y;
}
.book-dialog .reader-spread::after {
  content: ""; position: absolute; z-index: 1; inset: 0 auto 0 50%; width: 30px;
  transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, #554d2e0f 30%, #4c442b25 49%, #fff8 52%, #554d2e09 70%, transparent);
}
.book-dialog .reader-picture, .book-dialog .reader-copy {
  position: relative; min-width: 0; min-height: 500px; height: auto;
  margin: 0; padding: 34px 38px 48px; border: 0; align-self: stretch;
}
.book-dialog .reader-picture { display: flex; flex-direction: column; align-items: stretch; gap: 28px; background: linear-gradient(90deg, #f6f1e4, #fcf9ef 90%, #eee8d8); }
.book-running-title { margin: 0; font-family: var(--serif); color: #8a8779; font-size: 10px; letter-spacing: .08em; }
.book-visual { display: grid; place-items: center; width: 100%; min-height: 0; flex: 1; }
.book-dialog .reader-picture .book-visual img { width: 100%; height: 340px; object-fit: cover; object-position: center 30%; box-shadow: 0 2px 7px #5b55331a; border: 7px solid #fffdf7; }
.book-visual-year { align-content: center; gap: 15px; color: #71806a; }
.book-visual-year > span:not(.book-year-stem) { font-family: var(--serif); font-size: clamp(56px,7vw,86px); line-height: 1.2; font-weight: 400; }
.book-visual-year > small { font-size: 9px; letter-spacing: .16em; }
.book-year-stem { display: block; height: 56px; width: 1px; background: #bca779; transform: rotate(20deg); margin-block: 12px; }
.book-year-stem::before, .book-year-stem::after { content: ""; display: block; width: 14px; height: 24px; border: 1px solid #9ca586; border-radius: 0 100% 0 100%; position: absolute; }
.book-year-stem::before { top: 9px; left: -14px; }
.book-year-stem::after { top: 22px; left: 0; transform: scaleX(-1); }
.book-dialog .reader-copy { display: flex; flex-direction: column; padding-top: 48px; background: linear-gradient(90deg,#eee9da,#fdfaf1 8%,#fcf8ec); }
.book-dialog .reader-copy .eyebrow { color: #8b8061; font-size: 10px; letter-spacing: .12em; margin-bottom: 28px; }
.book-dialog .reader-copy h2 { font-family: var(--serif); font-size: clamp(23px,2.5vw,31px); font-weight: 400; line-height: 1.5; margin-bottom: 28px; letter-spacing: -.05em; }
.book-dialog .reader-copy .book-body-text { font-family: var(--serif); color: #535b4c; font-size: 15px; line-height: 2.15; word-break: keep-all; }
.book-dialog .reader-picture > .book-folio,
.book-dialog .reader-copy > .book-folio { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-family: Georgia,serif; color: #9a937f; font-size: 11px; font-weight: 400; line-height: 1; letter-spacing: .12em; }
.book-dialog .reader-controls { border: 0; padding: 12px 10px 18px; background: #e9e8df; }
.book-dialog .reader-controls button { min-width: 80px; padding: 10px 16px; border: 1px solid #bcc1b0; border-radius: 3px; color: #435740; background: #ffffff80; }
.book-dialog .reader-controls select { background: #f7f6ee; border-color: #ccd0bf; color: #5d6553; }
.book-dialog .reader-controls button:hover:enabled { background: #fffdf5; border-color: #87947a; }
.book-turn-leaf { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; pointer-events: none; transform-style: preserve-3d; }
.book-turn-leaf.turn-forward { left: 50%; transform-origin: left center; animation: memorial-page-forward 680ms cubic-bezier(.35,.06,.3,1) both; }
.book-turn-leaf.turn-backward { left: 0; transform-origin: right center; animation: memorial-page-backward 680ms cubic-bezier(.35,.06,.3,1) both; }
.book-leaf-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fcf8ec; box-shadow: 0 2px 20px #524a2333; }
.book-leaf-front { transform: rotateY(0deg); }
.book-leaf-back { transform: rotateY(180deg); }
.book-leaf-face .reader-picture, .book-leaf-face .reader-copy { width: 100%; height: 100%; }
.book-leaf-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #4c442b08, transparent 25%, #615a2b12); pointer-events: none; }
@keyframes memorial-page-forward { from { transform: rotateY(0deg); } to { transform: rotateY(-180deg); } }
@keyframes memorial-page-backward { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
@media (max-width: 900px) {
  .book-cover { min-height: 390px; grid-template-columns: 1fr 36%; }
  .book-cover-copy { padding: 30px 22px; }
  .book-dialog .reader-picture, .book-dialog .reader-copy { padding-inline: 26px; }
  .book-dialog .reader-copy .book-body-text { font-size: 14px; line-height: 2.05; }
  .book-dialog .reader-copy h2 { font-size: 25px; }
}
@media (max-width: 640px) {
  .book-cover { max-width: 310px; min-height: 390px; grid-template-columns: 1fr 38%; transform: rotateY(-8deg) rotateZ(-2deg); }
  .book-cover-copy { padding: 32px 20px; }
  .book-cover-copy strong { font-size: 34px; margin-block: 38px 25px; }
  dialog.book-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 0 8px; }
  .book-dialog .dialog-toolbar { padding: 7px 4px; font-size: 10px; }
  .book-dialog .reader-spread { display: block; min-height: 0; width: calc(100% - 12px); margin: 6px 6px 20px; }
  .book-dialog .reader-spread::after { inset: 0 auto 0 0; transform: none; width: 14px; background: linear-gradient(90deg,#796b3330,transparent); }
  .book-dialog .reader-picture { display: flex; min-height: 0; gap: 15px; padding: 22px 24px 8px; background: #fcf8ec; }
  .book-dialog .reader-picture .book-visual img { height: 190px; border-width: 5px; }
  .book-dialog .reader-picture > .book-folio { display: none; }
  .book-visual-year { min-height: 130px; gap: 6px; }
  .book-visual-year > span:not(.book-year-stem) { font-size: 54px; }
  .book-visual-year > small { font-size: 8px; }
  .book-year-stem { display: none; }
  .book-running-title { font-size: 8px; }
  .book-dialog .reader-copy { min-height: 0; padding: 26px 24px 48px; background: #fcf8ec; }
  .book-dialog .reader-copy .eyebrow { margin-bottom: 16px; font-size: 9px; }
  .book-dialog .reader-copy h2 { font-size: 24px; margin-bottom: 20px; }
  .book-dialog .reader-copy .book-body-text { font-size: 14px; line-height: 1.95; }
  .book-dialog .reader-controls { position: sticky; bottom: 0; z-index: 8; gap: 5px; padding: 10px 0; }
  .book-dialog .reader-controls button { min-width: 54px; padding: 8px 5px; font-size: 12px; }
  .book-dialog .reader-controls label { min-width: 0; max-width: 58%; }
  .book-dialog .reader-controls select { width: 100%; font-size: 11px; padding-inline: 6px; }
  .book-turn-leaf.turn-forward, .book-turn-leaf.turn-backward { left: 0; width: 100%; }
  .book-mobile-leaf { width: 100%; min-height: 100%; background: #fcf8ec; }
  .book-leaf-face .reader-picture, .book-leaf-face .reader-copy { height: auto; }
  .book-leaf-back { background: #e9e1cd; }
}
@media (prefers-reduced-motion: reduce) {
  .book-cover, .book-cover:hover { transform: none; }
  .book-turn-leaf { animation: none !important; }
}
