/* [erpc_catalogue] book viewer (modules/pdf-catalog.php, js/pdf-catalog-book.js). */
.erpc-book { --bk-bg: #ececec; display: grid; gap: 14px; margin: 0 auto; max-width: 1200px; }
/* Full screen (.is-full: phones without the Fullscreen API, the book covers the window): the whole spread fits the screen height (A4 spread = 1.414 × its height, one page = 0.707 ×). */
.erpc-book:fullscreen, .erpc-book.is-full { max-width: none; height: 100vh; padding: 14px 20px; background: #1d1d1d; color: #fff; grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; overflow: hidden; }
.erpc-book:fullscreen .erpc-book__count, .erpc-book.is-full .erpc-book__count { color: #bbb; }
.erpc-book:fullscreen .erpc-book__stage, .erpc-book.is-full .erpc-book__stage { align-self: center; justify-self: center; width: min(100%, calc((100vh - 240px) * 1.414 + 44px)); background: transparent; }
.erpc-book:fullscreen .erpc-book__stage.is-single, .erpc-book.is-full .erpc-book__stage.is-single { width: min(100%, calc((100vh - 240px) * 0.707 + 24px)); }
.erpc-book:fullscreen .erpc-book__thumbs, .erpc-book.is-full .erpc-book__thumbs { justify-content: center; }
.erpc-book__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.erpc-book__title { font-size: 1.05rem; }
.erpc-book__count { color: var(--erp-muted, #6b7280); font-variant-numeric: tabular-nums; }
.erpc-book__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.erpc-book__btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #d4d4d4; border-radius: 4px; background: #fff; color: #151515; font-size: 22px; line-height: 1; cursor: pointer; }
.erpc-book__btn:hover { border-color: #151515; }
.erpc-book__dl { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 4px; background: var(--erp-ink, #151515); color: #fff; font-weight: 700; text-decoration: none; }
.erpc-book__dl:hover { background: #000; color: #fff; }
.erpc-book__stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 22px; background: var(--bk-bg); perspective: 2200px; cursor: pointer; outline: none; }
.erpc-book__stage:focus-visible { box-shadow: inset 0 0 0 2px var(--erp-primary, #e2231a); }
.erpc-book__stage.is-single { grid-template-columns: 1fr; padding: 12px; }
.erpc-book__page { position: relative; aspect-ratio: 210 / 297; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.erpc-book__page img { display: block; width: 100%; height: 100%; object-fit: contain; }
.erpc-book__page.is-left { box-shadow: -6px 6px 18px rgba(0, 0, 0, .14), inset -14px 0 18px -14px rgba(0, 0, 0, .25); }
.erpc-book__page.is-right { box-shadow: 6px 6px 18px rgba(0, 0, 0, .14), inset 14px 0 18px -14px rgba(0, 0, 0, .2); }
.erpc-book__leaf { position: absolute; top: 22px; bottom: 22px; width: calc(50% - 22px); transform-style: preserve-3d; transition: transform .6s cubic-bezier(.45, .05, .25, 1); z-index: 3; }
.erpc-book__leaf.is-fwd { left: 50%; transform-origin: left center; }
.erpc-book__leaf.is-back { left: 22px; transform-origin: right center; }
.erpc-book__leaf.is-fwd.is-turning { transform: rotateY(-180deg); }
.erpc-book__leaf.is-back.is-turning { transform: rotateY(180deg); }
.erpc-book__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; aspect-ratio: auto; }
.erpc-book__face.is-back { transform: rotateY(180deg); }
.erpc-book__page.is-blank { background: transparent; box-shadow: none; } /* the empty spot left of the cover */
/* Page strip: pages on a darker track, each with its own edge, the open spread lifted in the brand red. */
.erpc-book__thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 12px; background: #d9d9d9; scrollbar-width: thin; }
.erpc-book__thumb { flex: none; width: 58px; padding: 0; border: 0; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .18); cursor: pointer; opacity: .72; transition: opacity .15s, transform .15s, box-shadow .15s; }
.erpc-book__thumb:hover { opacity: 1; }
.erpc-book__thumb img { display: block; width: 100%; aspect-ratio: 210 / 297; object-fit: cover; }
.erpc-book__thumb.is-on { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 2px var(--erp-primary, #e2231a), 0 6px 12px rgba(0, 0, 0, .25); }
.erpc-book__thumb:focus-visible { outline: 2px solid #151515; outline-offset: 2px; }
.erpc-book:fullscreen .erpc-book__thumbs, .erpc-book.is-full .erpc-book__thumbs { background: #2c2c2c; scrollbar-color: #666 #2c2c2c; }
.erpc-book__only { margin: 0; }
@media (max-width: 640px) { .erpc-book__tools { margin-left: 0; } .erpc-book__thumb { width: 42px; } }
@media (prefers-reduced-motion: reduce) { .erpc-book__leaf { transition: none; } }
.erpc-book.is-full { position: fixed; inset: 0; z-index: 100000; height: 100dvh; }
