/* The Study Book as a real hardback (index.html viewPlaybookPage, opened by extras/book-reader.js).
   The cover face is designed artwork (extras/books/covers/{toefl,ielts,step,delf,dele,hsk,csca}.jpg, made in Figma: an engraved
   pearl-foil illustration on cloth with a typeset title band). Around it: a rounded spine with raised bands, the
   page block on the fore-edge, a ribbon marker, the language toggle and a paper band (obi) holding the buttons.
   Each book keeps its section colour as the cloth behind the art; colours are fixed in both themes. */
.book-cover{
  --cloth:#1B2D4F;--cloth-2:#22396A;--cloth-dk:#0E1A30;--foil:#E7EDF0;--foil-2:#AFC0CA;--band:#F3EFE6;--band-ink:#1B2D4F;
  position:relative;isolation:isolate;display:block!important;color:var(--foil)!important;overflow:visible!important;
  padding:0!important;min-height:0!important;border-radius:4px 10px 10px 4px!important;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 1px,transparent 1px 3px),
    repeating-linear-gradient(90deg,rgba(0,0,0,.06) 0 1px,transparent 1px 3px),
    radial-gradient(130% 90% at 30% 0%,var(--cloth-2),var(--cloth) 55%,var(--cloth-dk))!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),inset 0 -40px 60px -40px rgba(0,0,0,.45),
    0 1px 0 rgba(255,255,255,.08),0 26px 40px -22px rgba(6,10,18,.65),0 10px 16px -10px rgba(6,10,18,.4)!important;
  aspect-ratio:3/4.15;width:min(100%,400px);margin:0 auto 18px;font-family:var(--serif)}
.book-cover.bk-ielts{--cloth:#5A1424;--cloth-2:#74203A;--cloth-dk:#320A14;--foil:#F2E9EA;--foil-2:#CDB3B8;--band-ink:#5A1424}
.book-cover.bk-step{--cloth:#143A2C;--cloth-2:#1C4F3B;--cloth-dk:#0A2219;--foil:#E8F1EC;--foil-2:#B2CABF;--band-ink:#143A2C}
.book-cover.bk-delf{--cloth:#1C283D;--cloth-2:#26364F;--cloth-dk:#0E1522;--foil:#E8ECF2;--foil-2:#B3BDCB;--band-ink:#17264A}
.book-cover.bk-dele{--cloth:#7A4A0C;--cloth-2:#A8650F;--cloth-dk:#4A2A05;--foil:#F4F1EC;--foil-2:#D9C8B0;--band-ink:#4A2A05}
.book-cover.bk-hsk{--cloth:#103138;--cloth-2:#18434C;--cloth-dk:#081B1F;--foil:#E6F0F1;--foil-2:#AFC6C9;--band-ink:#0E3A40}
.book-cover.bk-csca{--cloth:#362D35;--cloth-2:#483C47;--cloth-dk:#1E191E;--foil:#EFEAEE;--foil-2:#C2B6C0;--band-ink:#3A2C3D}
/* no artwork (the image failed to load): the cloth with a typeset foil title */
.book-cover .bc-fb{display:none}
.book-cover:not(.bc-has-art) .bc-fb{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px 34px;text-align:center;color:var(--foil);font-family:var(--serif)}
.book-cover:not(.bc-has-art) .bc-fb span{font:700 .72rem/1.2 var(--sans,system-ui);letter-spacing:.16em;text-transform:uppercase;color:var(--foil-2)}
.book-cover:not(.bc-has-art) .bc-fb b{font-size:clamp(1.5rem,6vw,2.1rem);line-height:1.15;letter-spacing:.04em;padding:14px 0;border-top:1px solid var(--foil-2);border-bottom:1px solid var(--foil-2)}
.book-cover::before{content:none!important}
/* spine: rounded, darker, with four raised bands */
.book-cover .bc-spine{position:absolute;inset:0 auto 0 0;width:22px;border-radius:4px 0 0 4px;pointer-events:none;z-index:2;
  background:linear-gradient(90deg,rgba(0,0,0,.45),rgba(0,0,0,.12) 45%,rgba(255,255,255,.12) 62%,rgba(0,0,0,.28) 100%);display:flex;flex-direction:column;justify-content:space-evenly}
.book-cover .bc-spine i{display:block;height:5px;margin:0 2px;border-radius:3px;background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(0,0,0,.35));box-shadow:0 1px 0 rgba(255,255,255,.08)}
/* page block on the fore-edge and the top */
.book-cover .bc-pages{position:absolute;top:6px;bottom:6px;right:-7px;width:8px;border-radius:0 3px 3px 0;z-index:-1;
  background:repeating-linear-gradient(90deg,#F4F0E6 0 1px,#DCD5C5 1px 2px);box-shadow:2px 0 3px rgba(0,0,0,.25)}
/* ribbon marker */
.book-cover .bc-ribbon{position:absolute;bottom:-26px;left:62%;width:12px;height:42px;z-index:-1;background:linear-gradient(90deg,#5FA7AB,#7FC3C6 45%,#4E9296);
  clip-path:polygon(0 0,100% 0,100% 100%,50% 82%,0 100%);box-shadow:0 2px 4px rgba(0,0,0,.25)}
/* the cover artwork fills the face; the spine shading sits on top of it */
.book-cover .bc-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit;z-index:0;user-select:none;-webkit-user-drag:none}
.book-cover.bc-has-art{background-color:var(--cloth)!important}
.book-cover.bc-has-art::after{content:""!important;position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:1;
  background:linear-gradient(105deg,rgba(255,255,255,.10),transparent 28%,transparent 72%,rgba(0,0,0,.14));box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.book-cover[dir="rtl"] .bc-spine{inset:0 0 0 auto;border-radius:0 4px 4px 0;transform:scaleX(-1)}
.book-cover[dir="rtl"] .bc-pages{right:auto;left:-7px;border-radius:3px 0 0 3px}
.book-cover .bc-top{position:absolute;top:10px;right:10px;z-index:3;display:flex}
.book-cover[dir="rtl"] .bc-top{right:auto;left:10px}
/* paper band (obi) around the bottom with the buttons */
.book-cover .bc-actions{position:absolute;left:-1px;right:-1px;bottom:10px;margin:0!important;display:flex;justify-content:center;gap:8px;padding:6px 12px;z-index:3;
  background:linear-gradient(180deg,#FBF8F1,var(--band));box-shadow:0 2px 6px rgba(0,0,0,.25),inset 0 1px 0 #fff;border-top:1px solid rgba(0,0,0,.06)}
.book-cover .bc-actions .btn{min-height:44px;padding:8px 16px!important;border-radius:999px!important;background:transparent!important;color:var(--band-ink)!important;border:1.5px solid var(--band-ink)!important;font:700 .82rem/1 var(--sans,system-ui)!important;backdrop-filter:none!important}
.book-cover .bc-actions .btn:hover{background:var(--band-ink)!important;color:#fff!important}
.book-cover .hero-theme{position:static!important;padding:2px!important;background:color-mix(in srgb,var(--cloth-dk) 78%,transparent)!important;backdrop-filter:blur(2px);border:1px solid color-mix(in srgb,var(--foil) 40%,transparent)!important}
.book-cover .hthemebtn{color:var(--foil)!important;background:transparent!important;min-width:34px;min-height:28px;border-radius:14px;font:700 .7rem/1 var(--sans,system-ui)}
.book-cover .hthemebtn[aria-pressed="true"]{background:var(--foil)!important;color:var(--cloth-dk)!important}
/* the closed book in the reader: shown on a desk, slightly turned, and it turns a little more under the pointer */
.bkr-cover{width:min(400px,calc(100vw - 48px))!important;max-width:100%;min-height:0!important;aspect-ratio:auto!important;background:none!important;box-shadow:none!important;overflow:visible!important;perspective:1400px}
.bkr .bkr-cover .book-cover{width:100%!important;flex:none!important;aspect-ratio:3/4.15!important;border-radius:4px 10px 10px 4px!important;padding:0!important;margin:0 auto!important}
.bkr-cover .book-cover{transform:rotateY(-7deg) rotateX(1.5deg);transform-origin:left center;transition:transform .5s cubic-bezier(.2,.8,.2,1),box-shadow .5s ease}
.bkr-cover:hover .book-cover{transform:rotateY(-13deg) rotateX(2deg) translateY(-4px)}
[dir="rtl"] .bkr-cover .book-cover{transform:rotateY(7deg) rotateX(1.5deg);transform-origin:right center}
.bkr-cover-foot{background:none!important;color:var(--ink)!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;justify-content:center!important;gap:10px 16px!important;padding:0 0 22px!important;width:100%}
.bkr-cover-main,.bkr-cover-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}
.bkr-cover-foot .btn{min-height:44px}
.bkr-cover-main .btn:not(.bkr-openbtn){background:transparent!important;color:var(--ink)!important;border:1.5px solid var(--brand,#2A6F74)!important;box-shadow:none!important}
.bkr-cover-main .btn:not(.bkr-openbtn):hover{border-color:currentColor!important}
.bkr-cover-foot{--tbw:min(640px,calc(100vw - 32px));width:var(--tbw)!important;margin-inline:calc((100% - var(--tbw)) / 2)!important}
.bkr-cover-main,.bkr-cover-tools{flex-wrap:nowrap!important}
.bkr-cover-tools .hero-theme{position:static;background:var(--card,transparent);border:1px solid var(--line,rgba(0,0,0,.15))}
.bkr-cover-tools .hthemebtn{width:auto;min-width:44px;height:44px;border-radius:22px;padding:0 10px;font:700 .8rem/1 var(--sans,system-ui);color:var(--ink-2)}
.bkr-cover-tools .hthemebtn[aria-pressed="true"]{background:var(--brand,#2A6F74)!important;color:var(--brand-ink,#fff)!important}
.bkr-cover-foot .bkr-openbtn{background:var(--brand,#2A6F74)!important;color:var(--brand-ink,#fff)!important;border:0!important;min-height:44px}
.bkr-cover-foot .bkr-resume{color:var(--ink-2)!important;opacity:1!important}
@media (max-width:480px){.book-cover .bc-actions{padding:5px 10px;bottom:8px}.book-cover .bc-actions .btn{padding:8px 12px!important}}
@media (prefers-reduced-motion:reduce){.bkr-cover .book-cover{transition:none}.bkr-cover:hover .book-cover{transform:rotateY(-7deg) rotateX(1.5deg)}}



@media (max-width:600px){.bkr-cover-foot{justify-content:center!important}}
.bkr-cover-foot .btn{white-space:nowrap}
@media (max-width:600px){.bkr-cover-main{gap:8px!important}.bkr-cover-foot .btn{padding:0 12px!important;font-size:.86rem!important}}
/* the closed book is big, and the book itself is the way in (no Open / Contents / PDF buttons) */
.bkr-cover{width:min(620px,calc(100vw - 32px),calc((100vh - 150px) / 1.383))!important}
.bkr-cover .book-cover[data-bkr-open]{cursor:pointer;transition:transform .35s cubic-bezier(.22,1,.36,1),box-shadow .35s ease}
@media (hover:hover){.bkr-cover .book-cover[data-bkr-open]:hover{transform:translateY(-4px) rotate(-.4deg)}}
.bkr-cover .book-cover[data-bkr-open]:focus-visible{outline:3px solid var(--brand,#2A6F74);outline-offset:6px}
.bkr-hint{font-size:.88rem;color:var(--ink-3)}
/* pages turn by a tap, a drag or a swipe: no arrow buttons */
.bkr-nav{display:none!important}
.bkr-book{touch-action:pan-y pinch-zoom}
