/* Isaiah 2026-11-13: Story time is a timeless old leather storybook (Codex art in assets/book/). The closed book is a
   green leather hardcover with gold tooling: its cover picture is a tipped-in plate and its title is stamped in gold. A tap
   opens the cover (a marbled endpaper inside), turns the first page and leans into the open book, whose aged pages carry the
   words and the picture; every page turn is a page turning over (js/book.mjs openWithCover / flipTurn). Grown-up text stays
   adult green and the child's words child red. No CSS filters anywhere here: iPhones paint filtered layers blank
   (css/phone.css 2026-10-27), so every shadow is a box-shadow.
   The "doubled" .classic.classic selectors only out-rank the older cover rules in book.css (e.g. .bk-book:not(.mini) ...). */

/* the book screen never scrolls: a page or cover turning toward the reader can reach a few px past the screen's edge, and
   with overflow:hidden that made the screen a scroll box a tap or focus could shift (20-30 px, seen in testing).
   clip = no scroll box at all (browsers without clip keep book.css's hidden) */
.bk-root { overflow: clip; }

/* ------------------------------------------------------------------ closed book */
.bk-open-btn .bk-book.classic { filter: none; }
/* the page block peeking out under the cover (fore-edge lines on the right and bottom) and the back board under it */
.bk-book.classic::before { left: 8px; top: 7px; right: -11px; bottom: -11px; border-radius: 3px 7px 7px 3px;
  background: repeating-linear-gradient(90deg, #DCCCA6 0 1px, #F6EDD6 1px 3px) right top / 13px 100% no-repeat,
    repeating-linear-gradient(0deg, #DCCCA6 0 1px, #F6EDD6 1px 3px) left bottom / 100% 13px no-repeat, #EFE3C6;
  box-shadow: 4px 5px 0 #173017, 6px 8px 0 rgba(0, 0, 0, .18), 0 26px 34px rgba(20, 30, 20, .32); }
.bk-book.classic.classic .bk-cover { display: block; padding: 0; border-radius: 4px 9px 9px 4px; transform-origin: 0 50%;
  background: #1F3B1B url(../assets/book/cover-green.webp) 0 0 / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 1px 2px 0 rgba(0, 0, 0, .25); }
html.phone .bk-book.classic.classic .bk-cover, .bt-book .bk-book.classic.classic .bk-cover, .bk-book.classic.classic.mini .bk-cover {
  background-image: url(../assets/book/cover-green-s.webp); }
/* the cover picture: a plate pasted into the gold-ruled recess (cream mat, a fine ink line, a little lift) */
.bk-book.classic.classic .bk-portrait { position: absolute; left: 15.4%; top: 16.8%; width: 70.2%; height: 44.6%; margin: 0;
  border: 6px solid #F3E8CC; border-radius: 3px; background: #F3E8CC;
  box-shadow: 0 0 0 1px rgba(70, 50, 20, .55), 0 5px 9px rgba(0, 0, 0, .5); }
.bk-book.classic.classic .bk-portrait img, .bk-book.classic.classic .bk-portrait svg { border-radius: 1px; }
/* the title, stamped in gold leaf inside the gold title panel (a dark copy under it is the stamp's shadow) */
.bk-book.classic.classic .bk-title { position: absolute; left: 15.6%; top: 70.4%; width: 68.8%; height: 11.9%; margin: 0; padding: 0 6px;
  border-radius: 0; background: none; display: grid; place-items: center; text-align: center; line-height: 1.02; letter-spacing: .01em; }
.bk-title-sh, .bk-title-au { grid-area: 1 / 1; text-wrap: balance; position: relative; }
.bk-title-sh { color: rgba(0, 0, 0, .62); top: 2px; } /* (positioned, not transformed: a transformed shadow painted OVER the gold) */
.bk-title-au { z-index: 1; }
.bk-title-au { color: #F2D27A; background: linear-gradient(180deg, #FFF8D6 0%, #F8DE8E 30%, #E6B652 58%, #CC9534 74%, #FAE6A6 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* "5 pages": a small gold line under the title panel */
.bk-book.classic.classic .bk-pages { left: 0; right: 0; top: 85.2%; bottom: auto; margin: 0; padding: 0; border-radius: 0; background: none;
  text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #E2C06A;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .65); }
/* "Read together": an old paper label pasted on the corner */
.bk-book.classic.classic .bk-chip { left: 22px; top: 20px; padding: 5px 14px 6px; border-radius: 3px; rotate: -5deg; background: #F4EAD0;
  color: #2F5A2A; font-size: 22px; box-shadow: inset 0 0 0 2px #F4EAD0, inset 0 0 0 3px rgba(47, 90, 42, .55), 0 3px 5px rgba(0, 0, 0, .45); }
.bk-book.classic.classic.mini .bk-chip, .bk-book.classic.classic.mini .bk-pages { display: none; }
/* a finished book shows its back: the same leather with a cream "read again" medallion */
.bk-book.classic.classic.back .bk-cover { display: block; }
.bk-book.classic.back .bk-replay { position: absolute; left: 50%; top: 39.2%; translate: -50% -50%; margin: 0; background: #F4EAD0; box-shadow: 0 0 0 6px #C9A04A, 0 0 0 8px rgba(0, 0, 0, .35), 0 10px 16px rgba(0, 0, 0, .45); }

/* ------------------------------------------------------------------ opening the book (js/book.mjs openWithCover) */
.bk-closed.opening :is(.bk-prompt, .bk-me, .bk-howto, .bk-done, .bk-lib-x, .bk-sticker, .hint) { opacity: 0; transition: opacity .22s; pointer-events: none; }
.bk-closed.opening .bk-open-btn { pointer-events: none; transform-origin: 0 50%; }
/* the inside of the front cover: a marbled endpaper inside leather turn-ins (seen once the cover passes upright) */
.bk-book.classic .bk-inside { position: absolute; inset: 0; display: none; border-radius: 4px 9px 9px 4px; transform: scaleX(-1);
  background: #2A4A22 url(../assets/book/endpaper-green.webp) 0 0 / 100% 100% no-repeat; }
html.phone .bk-book.classic .bk-inside { background-image: url(../assets/book/endpaper-green-s.webp); }
.bk-book.classic .bk-cover.flipped { background-image: none; background-color: #2A4A22; }
.bk-book.classic .bk-cover.flipped > :not(.bk-inside) { visibility: hidden; }
.bk-book.classic .bk-cover.flipped > .bk-inside { display: block; }
/* the first page (title page) under the cover, and the page under that */
.bk-book.classic :is(.bk-first, .bk-under) { position: absolute; inset: 0; border-radius: 2px 7px 7px 2px; transform-origin: 0 50%;
  background: #F3E7CB url(../assets/book/titlepage-green.webp) 0 0 / 100% 100% no-repeat; box-shadow: inset 0 0 0 1px rgba(90, 70, 30, .2); }
html.phone .bk-book.classic :is(.bk-first, .bk-under) { background-image: url(../assets/book/titlepage-green-s.webp); }
.bk-book.classic .bk-under { background: #F3E7CB linear-gradient(90deg, rgba(90, 60, 20, .22), rgba(90, 60, 20, 0) 9%, rgba(255, 255, 255, 0) 92%, rgba(90, 60, 20, .1)); }
.bk-first-title { position: absolute; left: 12%; right: 12%; top: 22%; bottom: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center; color: #2F5A2A; font-family: var(--font-read); font-weight: 700; line-height: 1.1; text-wrap: balance; }
.bk-first-title small { font-size: 20px; letter-spacing: .18em; text-transform: uppercase; color: rgba(47, 90, 42, .7); }
.bk-first-title i { width: 46%; height: 2px; background: rgba(47, 90, 42, .45); }
.bk-book.classic .bk-first.flipped { background: #F3E7CB linear-gradient(270deg, rgba(90, 60, 20, .25), rgba(90, 60, 20, 0) 10%); }
.bk-book.classic .bk-first.flipped > * { visibility: hidden; }
/* a page's own shading while it turns (darkest as it stands upright) */
.bk-turn-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: inherit;
  background: linear-gradient(90deg, rgba(60, 40, 15, .5), rgba(60, 40, 15, .12) 55%, rgba(255, 250, 235, .18)); }

/* ------------------------------------------------------------------ the open book (two-page spread) */
.bk-spread.classic { border: 0; border-radius: 0; background: none; box-shadow: none; }
.bk-spread.classic::before { left: -70px; top: -38px; right: auto; bottom: auto; width: 1542px; height: 814px; z-index: -1; border-radius: 10px;
  background: url(../assets/book/spread-green.webp) 0 0 / 100% 100% no-repeat; box-shadow: 0 26px 44px rgba(20, 30, 20, .38); }
html.phone .bk-spread.classic::before { background-image: url(../assets/book/spread-green-s.webp); }
.bk-spread.classic .bk-count { bottom: 10px; z-index: 3; background: #2F5A2A; color: #F6EDD6; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); } /* (above a turning page) */
/* the picture: a colour plate pasted on the page (cream mat, a fine line, a soft lift) */
.bk-spread.classic .bk-panel { border-radius: 3px; box-shadow: 0 0 0 9px #F7EEDA, 0 0 0 10px rgba(90, 70, 30, .4), 0 12px 20px rgba(60, 40, 10, .28); }
.bk-spread.classic .bk-card { background: #FFFDF6; }

/* a page turning over (js/book.mjs flipTurn): the page that turns, and the page that stays until it is covered */
.bk-flip { position: absolute; top: 0; width: 700px; height: 740px; z-index: 2; pointer-events: none;
  background: url(../assets/book/spread-green.webp) 0 0 / 1542px 814px no-repeat; }
.bk-flip.l { left: 0; background-position: -70px -38px; transform-origin: 100% 50%; }
.bk-flip.r { left: 700px; background-position: -770px -38px; transform-origin: 0 50%; }
.bk-flip-back { position: absolute; inset: 0; transform: scaleX(-1); background: url(../assets/book/spread-green.webp) 0 0 / 1542px 814px no-repeat; }
.bk-flip-back.l { background-position: -70px -38px; }
.bk-flip-back.r { background-position: -770px -38px; }
html.phone :is(.bk-flip, .bk-flip-back) { background-image: url(../assets/book/spread-green-s.webp); }
.bk-flip :is(.bk-left, .bk-right) { left: 0 !important; top: 0 !important; }
.bk-flip.r .bk-turn-shade { background: linear-gradient(90deg, rgba(60, 40, 15, .5), rgba(60, 40, 15, .1) 45%, rgba(255, 250, 235, .2)); }
.bk-flip.l .bk-turn-shade { background: linear-gradient(270deg, rgba(60, 40, 15, .5), rgba(60, 40, 15, .1) 45%, rgba(255, 250, 235, .2)); }

/* ------------------------------------------------------------------ slide-to-read: a soft frame from the book's world */
.bk-reader.bkr-world { background-position: center; background-size: cover; background-repeat: no-repeat; }
