/* "📖 הספר של רוכל'ה" (public/js/book.js) — the old book on the home page and the open tome. */
@property --t { syntax: '<number>'; inherits: true; initial-value: 0; }

/* ---- the closed book above the 🎰 button ---- */
.bk-fab {
  position: fixed; z-index: 60; inset-inline-start: 12px; bottom: calc(80px + var(--bottom-nav, 0px) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: 700 13px 'Frank Ruhl Libre', Rubik, serif; color: #fff4d6; transition: opacity .3s, transform .35s;
}
.bk-fab img { width: 78px; height: 78px; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); transition: transform .3s; }
.bk-fab .bk-fl {
  margin-top: -6px; padding: 2px 8px; border-radius: 3px; white-space: nowrap;
  background: linear-gradient(180deg, #6e2a12, #3a1207); box-shadow: 0 0 0 1px #c99a3c, 0 3px 8px rgba(0, 0, 0, .35);
}
.bk-fab:hover img, .bk-fab:focus-visible img { transform: translateY(-3px) rotate(-4deg) scale(1.06); }
.bk-fab:focus-visible { outline: 3px solid var(--focus, #b8336a); outline-offset: 3px; border-radius: 6px; }
.bk-fab.inhead { position: absolute; z-index: 6; bottom: auto; inset-inline-start: auto; right: 12px; }
.bk-fab.away { opacity: 0; transform: scale(.6); pointer-events: none; }
.bk-fab.home img { animation: bkHome 1.1s ease-out; }
@keyframes bkHome { 30% { transform: scale(1.18) rotate(-6deg); filter: drop-shadow(0 0 16px #ffd36e); } }
.bk-fab:not(.away) img { animation: bkIdle 5s ease-in-out infinite; }
@keyframes bkIdle { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-5deg); } 94% { transform: rotate(4deg); } }
@media (max-width: 600px) {
  .bk-fab img { width: 58px; height: 58px; }
  .bk-fab .bk-fl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
}

/* ---- the room ---- */
.bk-lock { overflow: hidden; }
.bk-back {
  position: fixed; inset: 0; z-index: 210; opacity: 0; transition: opacity .6s ease;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #4a2611 0%, #1f0d04 55%, #070200 100%);
}
.bk-back.in { opacity: 1; }
.bk-back.out { transition-delay: .55s; transition-duration: .5s; opacity: 0; }
.bk-candle {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 190, 90, .22), transparent 55%);
  animation: bkFlicker 3.2s ease-in-out infinite;
}
@keyframes bkFlicker { 0%, 100% { opacity: 1; } 20% { opacity: .82; } 45% { opacity: .95; } 60% { opacity: .78; } 80% { opacity: .92; } }
.bk-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bk-spark { position: fixed; z-index: 230; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff7d1, #f2c14e 50%, transparent 70%); box-shadow: 0 0 10px 3px rgba(255, 200, 80, .7); }

.bk-dlg { position: absolute; inset: 0; display: flex; flex-direction: column; }
.bk-stage { flex: 1; display: flex; align-items: center; justify-content: center; perspective: 2400px; min-height: 0; }
.bk-fly { transform-style: preserve-3d; }

/* ---- the book ---- */
.bk-book {
  --lip: 14px;
  position: relative; width: calc(2 * var(--P, 400px)); height: var(--H, 540px);
  perspective: 2600px; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  transition: transform 1.3s cubic-bezier(.45, .05, .25, 1);
}
.bk-book.closed { transform: translateX(calc(var(--P) / 2)); }
.bk-book.closed .bk-stack { opacity: 0; }

/* a leaf turns around the spine (the book's middle); 0deg = on the left, 180deg = on the right */
.bk-leaf {
  position: absolute; top: 0; left: 0; width: var(--P); height: 100%;
  transform-origin: right center; transform: rotateY(var(--a, 0deg)); transform-style: preserve-3d;
}
.bk-face {
  position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: #efdfbb url(/img/book-page.webp) center / cover;
  color: #2a1406; font-size: var(--fs, 16px);
}
.bk-face.back { transform: rotateY(180deg); background-position: 30% 60%; }
/* the gutter's shadow at the spine, the outer edge a little worn */
.bk-face:not(.board)::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to left, rgba(70, 35, 8, .38), rgba(70, 35, 8, .1) 7%, transparent 16%, transparent 94%, rgba(90, 50, 15, .18));
}
.bk-face.back:not(.board)::after {
  background: linear-gradient(to right, rgba(70, 35, 8, .38), rgba(70, 35, 8, .1) 7%, transparent 16%, transparent 94%, rgba(90, 50, 15, .18));
}
/* the light on a turning page */
.bk-shade { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.front > .bk-shade { background: linear-gradient(to left, rgba(0, 0, 0, .55), rgba(0, 0, 0, .15) 60%, rgba(255, 240, 200, .15)); opacity: calc(var(--t) * 1.6 - var(--t) * var(--t) * 1.2); }
.back > .bk-shade { background: linear-gradient(to right, rgba(0, 0, 0, .55), rgba(0, 0, 0, .15) 60%, rgba(255, 240, 200, .15)); opacity: calc((1 - var(--t)) * 1.6 - (1 - var(--t)) * (1 - var(--t)) * 1.2); }

/* the boards: the covers stick out a little around the pages */
.bk-face.board { inset: calc(-1 * var(--lip)) 0 calc(-1 * var(--lip)) calc(-1 * var(--lip)); background: radial-gradient(ellipse at 40% 35%, #6e2a12, #45160a 60%, #250a03); }
.bk-leaf.first .front { border-radius: 6px 0 0 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.bk-leaf.first .back, .bk-leaf.lastl .back { border-radius: 0 6px 6px 0; }
.bk-leaf.lastl .front { border-radius: 6px 0 0 6px; box-shadow: -2px 4px 16px rgba(0, 0, 0, .55); }
.bk-leaf.first .back { box-shadow: 2px 4px 16px rgba(0, 0, 0, .55); }
.bk-book.closed .bk-leaf.first .front {
  box-shadow: -3px 3px 0 #efe0bd, -5px 5px 0 #d8c39a, -7px 7px 0 #e8d7b0, -9px 9px 0 #cdb486, -12px 12px 0 #2c0c04, -14px 22px 40px rgba(0, 0, 0, .7);
}

/* the page block on each side (thinner / thicker as you read) */
.bk-stack { position: absolute; top: 2px; bottom: 2px; z-index: 5; transition: width .4s, opacity .4s; background: repeating-linear-gradient(90deg, #f3e6c6 0 1px, #c4a874 1px 2px); }
.bk-stack.l { left: calc(-1 * var(--sl, 4px)); width: var(--sl, 4px); border-radius: 3px 0 0 3px; }
.bk-stack.r { right: calc(-1 * var(--sr, 4px)); width: var(--sr, 4px); z-index: 3; border-radius: 0 3px 3px 0; }
.bk-glow { position: absolute; inset: -30%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1s;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 214, 120, .55), rgba(255, 170, 60, .12) 40%, transparent 65%); }
.bk-book.opening .bk-glow { opacity: 1; }
.bk-book:not(.closed) .bk-glow { opacity: .35; }

/* the dog-ear at a page's outer bottom corner: a tap turns the page */
.bk-curl {
  position: absolute; bottom: 0; width: 38px; height: 38px; z-index: 4; cursor: pointer; transition: width .25s, height .25s;
}
.front > .bk-curl { left: 0; background: linear-gradient(to top right, #fbf3df 0%, #e3cc9a 46%, rgba(60, 30, 5, .35) 50%, transparent 57%); }
.back > .bk-curl { right: 0; background: linear-gradient(to top left, #fbf3df 0%, #e3cc9a 46%, rgba(60, 30, 5, .35) 50%, transparent 57%); }
.bk-curl:hover { width: 60px; height: 60px; }
.board > .bk-curl, .bk-leaf.lastl .bk-curl, .bk-book.atend .bk-leaf:nth-last-child(2) .front > .bk-curl { display: none; }
.bk-book.dragging, .bk-book.dragging * { cursor: grabbing; }

/* ---- the cover ---- */
.bk-cover { position: absolute; inset: 0; background: #4a1c0e url(/img/book-cover.webp) center / 100% 100%; overflow: hidden; container-type: inline-size; }
.bk-cover.back { transform: scaleX(-1); }
.bk-ctitle, .bk-csub { position: absolute; left: 12%; right: 12%; text-align: center; font-family: 'Frank Ruhl Libre', 'David Libre', serif; line-height: 1; }
.bk-ctitle { top: 7.5%; height: 13%; display: flex; align-items: center; justify-content: center; gap: .25em; font-weight: 900; font-size: 11.5cqi; }
.bk-ctitle span, .bk-csub span {
  background: linear-gradient(180deg, #fff3b8 0%, #e9c262 30%, #a8741a 55%, #f0cf73 75%, #8a5a10 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 .06em 0 #1d0701) drop-shadow(0 0 .02em #000);
}
.bk-ctitle .bk-cs { font-size: .62em; font-weight: 500; }
.bk-cring {
  position: absolute; left: 50%; top: 46.67%; width: 51%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden;
  background: #3a1207; box-shadow: inset 0 0 0 3px #2a0b03, inset 0 6px 18px rgba(0, 0, 0, .8);
}
.bk-clogo { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.9) saturate(.75) contrast(1.15) brightness(.78); }
.bk-cring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: multiply;
  background: radial-gradient(circle, transparent 50%, rgba(70, 30, 5, .55) 100%), url(/img/book-page.webp) center / cover; opacity: .9; }
.bk-csub { top: 78.5%; display: flex; flex-direction: column; align-items: center; gap: .35em; font-size: 6.2cqi; font-weight: 900; }
.bk-csub small { font: 500 3.1cqi 'Frank Ruhl Libre', serif; color: #e5c47a; opacity: .85; letter-spacing: .04em; }
.bk-gleam { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 210, .55) 48%, rgba(255, 230, 160, .15) 55%, transparent 62%); background-size: 260% 100%; }
.bk-book.gleam .bk-gleam { animation: bkGleam 1.1s ease-in-out; }
@keyframes bkGleam { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 1; background-position: -60% 0; } }

/* ---- the endpapers (marbled) ---- */
.bk-endpaper {
  position: absolute; inset: var(--lip) var(--lip) var(--lip) 0; display: flex; align-items: center; justify-content: center;
  background: #3c1420 url(/img/book-endpaper.webp) center / cover;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .55);
}
.bk-leaf.lastl .front .bk-endpaper { inset: var(--lip) 0 var(--lip) var(--lip); }
.bk-plate {
  width: 62%; padding: 7% 6%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4em;
  background: #f3e6c6 url(/img/book-page.webp) center / cover; color: #3a1a06; border: 3px double #6b3a12; box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
  font-family: 'Frank Ruhl Libre', serif;
}
.bk-plate img { width: 46%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; filter: sepia(.7) contrast(1.05); }
.bk-plate small { font-size: .85em; font-style: italic; }
.bk-plate strong { font-size: 1.15em; font-weight: 900; }

/* ---- inside a page ---- */
.bk-in { position: absolute; inset: 0; padding: 7% 9% 9%; display: flex; flex-direction: column; align-items: center; text-align: center; }
.back > .bk-in { padding-inline: 9% 11%; }
.front > .bk-in { padding-inline: 11% 9%; }
.bk-orn { font-family: serif; color: #6b2d0b; font-size: 1.35em; line-height: 1; margin: .2em 0 .35em; }
.bk-kick { margin: 0; font: italic 500 1em 'Frank Ruhl Libre', serif; color: #6b3a12; }
.bk-big { margin: .1em 0 .2em; font: 900 2em/1.15 'Frank Ruhl Libre', serif; color: #4a1505; }
.bk-ink { margin: 0 0 .7em; font-family: 'Gveret Levin', 'Frank Ruhl Libre', serif; font-size: 1.32em; line-height: 1.55; color: #24140a; text-align: start; text-shadow: 0 0 .5px rgba(30, 15, 5, .5); }
.bk-ink.small { font-size: 1.12em; text-align: center; }
.bk-drop {
  float: right; font: 900 2.7em/.9 'Frank Ruhl Libre', serif; margin: .06em 0 0 .12em; padding: .08em .14em; color: #8e1b12;
  background: linear-gradient(135deg, #f8e7b5, #e1b85a); border: 2px solid #8a5a10; box-shadow: inset 0 0 0 2px #fff3c6, 1px 2px 4px rgba(0, 0, 0, .3);
  text-shadow: 0 1px 0 #fff6d8;
}
.bk-count { margin: auto 0 .3em; font: 700 1em 'Frank Ruhl Libre', serif; color: #6b3a12; }
.bk-flipme { margin: 0; font-size: .85em; color: #6b4a2a; }
.bk-hand { display: inline-block; animation: bkHand 1.8s ease-in-out infinite; }
@keyframes bkHand { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px) rotate(10deg); } }

.bk-date { margin: 0 0 .5em; font: italic 500 .9em 'Frank Ruhl Libre', serif; color: #6b3a12; letter-spacing: .02em; }
.bk-photolink { display: block; width: 100%; flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; }
.bk-photo {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center;
  margin: .2em 0 .5em; transform: rotate(-1.2deg);
}
.bk-photolink .bk-photo { margin: .2em 0 .5em; }
.bk-photo img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block; background: #fff8e8;
  padding: 3.5%; border: 1px solid #b89a66; box-shadow: 0 3px 10px rgba(50, 25, 5, .45);
  filter: sepia(.12) contrast(1.02);
}
.bk-photo .pc { position: absolute; width: 9%; aspect-ratio: 1; background: #2c1a0c; opacity: .82; pointer-events: none; display: none; }
.bk-photolink:hover .bk-photo img, .bk-photolink:focus-visible .bk-photo img { box-shadow: 0 0 0 3px #c99a3c, 0 6px 18px rgba(50, 25, 5, .5); }
.bk-photo.sold img, .bk-photo.gone img { filter: sepia(.45) grayscale(.25) contrast(.95); }
.bk-stamp {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  padding: .1em .55em; font: 900 2.1em 'Frank Ruhl Libre', serif; color: #a3140f; border: .12em double #a3140f; border-radius: 6px;
  background: rgba(255, 240, 220, .35); opacity: .88; mix-blend-mode: multiply; letter-spacing: .05em; white-space: nowrap;
}
.bk-stamp.gone { color: #4a3a2a; border-color: #4a3a2a; font-size: 1.5em; }
.bk-ptitle { margin: .1em 0 .15em; font: 900 1.3em/1.2 'Frank Ruhl Libre', serif; color: #3a1205; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bk-shop { margin: 0 0 .35em; font: 500 .92em 'Frank Ruhl Libre', serif; color: #5a3a1a; }
.bk-shop a, .bk-go { color: #7a1a0a; }
.bk-buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3em .8em; }
.bk-price { font: 900 1.2em 'Frank Ruhl Libre', serif; color: #2a1406; }
.bk-go {
  display: inline-flex; align-items: center; gap: .3em; min-height: 40px; padding: .2em .9em; border-radius: 4px; text-decoration: none;
  font: 700 .92em Rubik, sans-serif; color: #fff7e2; background: linear-gradient(180deg, #8e2a12, #5a1708); box-shadow: 0 0 0 1px #c99a3c, 0 2px 6px rgba(0, 0, 0, .3);
}
.bk-go:hover, .bk-go:focus-visible { background: linear-gradient(180deg, #a8341a, #6e1d0a); }
.bk-gone { margin: 0; font: italic 500 .95em 'Frank Ruhl Libre', serif; color: #5a3a1a; }
.bk-folio { position: absolute; bottom: 3.2%; left: 0; right: 0; text-align: center; font: 500 .85em 'Frank Ruhl Libre', serif; color: #7a5532; pointer-events: none; }

.bk-storyp { padding-bottom: 8%; }
.bk-scroll { width: 100%; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 0 .2em .5em;
  scrollbar-width: thin; scrollbar-color: #b08a55 transparent; mask-image: linear-gradient(to bottom, #000 92%, transparent); }
.bk-scroll:focus-visible { outline: 3px solid #6b2d0b; outline-offset: 2px; }
.bk-stitle { margin: .2em 0 0; font: 900 1.55em/1.2 'Frank Ruhl Libre', serif; color: #4a1505; }
.bk-ai { margin: .6em 0 0; font: italic .72em/1.4 Rubik, sans-serif; color: #6b5034; }

.bk-endp { justify-content: center; }
.bk-quill { margin: 0; font-size: 3em; line-height: 1; animation: bkQuill 3s ease-in-out infinite; }
@keyframes bkQuill { 50% { transform: rotate(-12deg) translateY(-4px); } }
.bk-tomorrow { margin: .3em 0; font-family: 'Gveret Levin', 'Frank Ruhl Libre', serif; font-size: 2.3em; line-height: 1.25; color: #4a1505; }
.bk-closebig {
  margin-top: .6em; min-height: 44px; padding: .3em 1.2em; border: 0; border-radius: 4px; cursor: pointer;
  font: 700 1em Rubik, sans-serif; color: #fff7e2; background: linear-gradient(180deg, #6e2a12, #3a1207); box-shadow: 0 0 0 2px #c99a3c, 0 3px 8px rgba(0, 0, 0, .35);
}

/* "Aa": print letters instead of the handwriting (also the accessibility menu's readable font) */
.bk-dlg.plain .bk-ink, .bk-dlg.plain .bk-tomorrow, html.a11y-font .bk-ink, html.a11y-font .bk-tomorrow { font-family: Rubik, Arial, sans-serif; font-size: 1em; line-height: 1.7; text-shadow: none; }
.bk-dlg.plain .bk-tomorrow, html.a11y-font .bk-tomorrow { font-size: 1.6em; }

/* ---- the bar under the book ---- */
.bk-bar {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  position: relative; z-index: 2;
}
.bk-bar button {
  min-height: 44px; min-width: 44px; padding: 6px 14px; border-radius: 4px; cursor: pointer; border: 0;
  font: 700 15px Rubik, sans-serif; color: #fff1cf; background: linear-gradient(180deg, #5a2410, #2e0f04); box-shadow: 0 0 0 1px #b8862b, 0 3px 10px rgba(0, 0, 0, .5);
}
.bk-bar button:disabled { opacity: .4; cursor: default; }
.bk-bar button:focus-visible, .bk-closebig:focus-visible, .bk-go:focus-visible { outline: 3px solid #ffd36e; outline-offset: 2px; }
.bk-bar .bk-nav { font-size: 20px; padding: 4px 16px; }
.bk-bar .bk-shut { background: linear-gradient(180deg, #8e2a12, #4a1207); }
.bk-bar .bk-tool[aria-pressed="true"] { background: #f3e6c6; color: #3a1a06; }
.bk-count2 { min-width: 9em; text-align: center; font: 600 15px 'Frank Ruhl Libre', Rubik, serif; color: #f3dca6; }
@media (max-width: 600px) {
  .bk-bar { gap: 6px; padding-inline: 6px; }
  .bk-bar button { padding: 6px 10px; font-size: 14px; }
  .bk-count2 { min-width: 0; font-size: 12px; max-width: 5.5em; line-height: 1.2; }
  .bk-tl { display: none; }
  .bk-bar { flex-wrap: nowrap; }
  .bk-drop { font-size: 2.1em; }
  .bk-curl { width: 28px; height: 28px; }
}

/* reduced motion / "עצירת אנימציות": nothing flies, flickers or bobs */
@media (prefers-reduced-motion: reduce) {
  .bk-book, .bk-back, .bk-stack { transition: none; }
  .bk-candle, .bk-hand, .bk-quill, .bk-fab img, .bk-gleam { animation: none !important; }
}
html.a11y-still .bk-book, html.a11y-still .bk-back, html.a11y-still .bk-stack { transition: none; }
html.a11y-still .bk-candle, html.a11y-still .bk-hand, html.a11y-still .bk-quill, html.a11y-still .bk-fab img, html.a11y-still .bk-gleam { animation: none !important; }

/* the newest page, written today */
.bk-ribbon {
  position: absolute; top: 0; inset-inline-start: 7%; z-index: 2; padding: .5em .7em 1em; font: 700 .78em Rubik, sans-serif; color: #fff4d6;
  background: linear-gradient(180deg, #a8341a, #6e1d0a); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

/* an upright phone: the whole book turned 90° clockwise, like a film — the reader turns the phone
   (book.js sets width / height to the screen's height / width) */
.bk-dlg.sideways { inset: auto; top: 0; left: 0; transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
.bk-dlg.sideways .bk-book, .bk-dlg.sideways .bk-scroll { touch-action: pan-x; }
.bk-dlg.sideways .bk-bar { padding-bottom: 10px; }
.bk-dlg.sideways .bk-tl { display: inline; }
.bk-dlg.sideways .bk-count2 { max-width: none; font-size: 14px; }
.bk-turn .bk-tl2 { font-size: 13px; }
.bk-dlg.sideways .bk-bar { padding-top: 4px; padding-bottom: 6px; }
.bk-dlg.sideways .bk-bar button { min-height: 40px; }

/* ---- the bar slides down out of the way; a small handle brings it up (owner, 2026-10-31) ---- */
.bk-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding-top: 18px; background: linear-gradient(180deg, transparent, rgba(12, 4, 0, .88) 38%);
  transition: transform .35s cubic-bezier(.3, .8, .3, 1), opacity .35s;
}
.bk-bar.hide { transform: translateY(110%); opacity: 0; }
.bk-handle {
  position: absolute; z-index: 6; left: 50%; bottom: calc(4px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 14px; border: 0; border-radius: 14px 14px 4px 4px; cursor: pointer;
  font: 600 12px Rubik, sans-serif; color: #f3dca6; background: rgba(46, 15, 4, .78); box-shadow: 0 0 0 1px rgba(184, 134, 43, .7);
  transition: bottom .35s cubic-bezier(.3, .8, .3, 1), opacity .3s; opacity: .75;
}
.bk-handle .hv { font-size: 16px; line-height: 1; }
.bk-handle:hover, .bk-handle:focus-visible { opacity: 1; }
.bk-handle:focus-visible { outline: 3px solid #ffd36e; outline-offset: 2px; }
.bk-handle.up { bottom: calc(66px + env(safe-area-inset-bottom)); }
.bk-dlg:not(.sideways) .bk-handle:not(.up) { animation: bkNudge 2.4s ease-in-out 1.5s 2; }
@keyframes bkNudge { 50% { transform: translateX(-50%) translateY(-5px); opacity: 1; } }
@media (max-width: 600px) { .bk-handle.up { bottom: calc(60px + env(safe-area-inset-bottom)); } }
.bk-dlg.sideways .bk-handle.up { bottom: 56px; }

/* ---- the folding page: strips of a copy of the leaf, each bending a little more (book.js curler) ---- */
.bk-curlr { position: absolute; top: 0; left: 0; width: var(--P); height: 100%; z-index: 6000; transform-style: preserve-3d; pointer-events: none; }
.bk-strip { position: absolute; top: 0; height: 100%; transform-origin: right center; transform-style: preserve-3d; will-change: transform; }
.bk-sf { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bk-sf.b { transform: rotateY(180deg); }
.bk-ss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(40, 20, 4, .9), rgba(20, 8, 0, .75)); opacity: 0; }

/* ---- "❤️ ריגש אותי" + "📤 שיתוף הסיפור" under each story ---- */
.bk-react { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: .3em 0 .2em; }
.bk-react button {
  min-height: 40px; padding: .25em .9em; border-radius: 999px; cursor: pointer; border: 1px solid #b08a55;
  font: 600 .8em Rubik, sans-serif; color: #4a1505; background: rgba(255, 248, 230, .7);
}
.bk-react button:hover, .bk-react button:focus-visible { background: #fff6e0; }
.bk-react button:focus-visible { outline: 3px solid #6b2d0b; outline-offset: 2px; }
.bk-heart[aria-pressed="true"] { border-color: #b8336a; color: #8e1b4a; background: #fde6ef; }
.bk-heart .hn { font-weight: 800; }
.bk-heart.pop .hi { display: inline-block; animation: bkHeart .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bkHeart { 40% { transform: scale(1.7); } }
.bk-react button:disabled { opacity: .6; cursor: progress; }

/* ---- ribbons: the story of the month, a holiday chapter ---- */
.bk-ribbon.gold { color: #3a2200; background: linear-gradient(180deg, #ffe08a, #d9a630); }
.bk-ribbon.hol { background: var(--hol, #6e1d0a); }

/* ---- "פרקים לחגים": the chapter's opening spread ---- */
.bk-chap { justify-content: center; }
.bk-chap::before { content: ''; position: absolute; inset: 5% 7%; border: 3px double var(--hol, #6b3a12); opacity: .55; pointer-events: none; }
.bk-chemoji { margin: 0; font-size: 4.2em; line-height: 1.1; filter: drop-shadow(0 3px 4px rgba(60, 30, 5, .3)); }
.bk-chemoji.small { font-size: 1.8em; letter-spacing: .2em; }
.bk-chap .bk-big { color: var(--hol, #4a1505); font-size: 2.4em; }
.bk-chap.left .bk-ink { text-align: center; }
@media (prefers-reduced-motion: reduce) { .bk-handle, .bk-heart.pop .hi { animation: none !important; } }
html.a11y-still .bk-handle, html.a11y-still .bk-heart.pop .hi { animation: none !important; }

/* ---- the item's picture enlarged over the spread (book.js zoomPhoto) ---- */
button.bk-photolink { padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
button.bk-photolink:focus-visible { outline: 3px solid #6b2d0b; outline-offset: 3px; }
.bk-zback { position: absolute; inset: calc(-1 * var(--lip)); z-index: 6900; background: rgba(20, 8, 2, .72); opacity: 0; transition: opacity .4s; cursor: zoom-out; }
.bk-zback.in { opacity: 1; }
.bk-zoom {
  position: absolute; z-index: 7000; box-sizing: content-box; margin: -8px; border: 8px solid #fff8e8; border-radius: 3px;
  background: #fff8e8; box-shadow: 0 20px 60px rgba(0, 0, 0, .65), 0 0 0 1px #b89a66; transform-origin: center;
}
.bk-zoom img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-out; }
.bk-zx {
  position: absolute; top: 8px; inset-inline-end: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  font: 700 20px Rubik, sans-serif; color: #fff; background: rgba(30, 12, 4, .7); box-shadow: 0 0 0 2px rgba(255, 240, 200, .7);
}
.bk-zcap {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px;
  padding: 26px 12px 12px; text-align: center; color: #fff; background: linear-gradient(180deg, transparent, rgba(20, 8, 2, .85) 45%);
  font: 600 15px Rubik, sans-serif;
}
.bk-zcap strong { flex: 1 1 100%; font: 900 18px 'Frank Ruhl Libre', serif; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.bk-zprice { font-weight: 800; font-size: 17px; }
.bk-zsold { opacity: .9; font-style: italic; }
.bk-zgo {
  display: inline-flex; align-items: center; gap: .3em; min-height: 44px; padding: 0 18px; border-radius: 4px; text-decoration: none;
  font: 700 15px Rubik, sans-serif; color: #fff7e2; background: linear-gradient(180deg, #a8341a, #6e1d0a); box-shadow: 0 0 0 2px #e9c262, 0 4px 12px rgba(0, 0, 0, .4);
}
.bk-zx:focus-visible, .bk-zgo:focus-visible { outline: 3px solid #ffd36e; outline-offset: 2px; }
.bk-zoom .bk-zx, .bk-zoom .bk-zcap { opacity: 0; transition: opacity .3s; }
.bk-zoom.shown .bk-zx, .bk-zoom.shown .bk-zcap { opacity: 1; }
html.a11y-still .bk-zoom .bk-zx, html.a11y-still .bk-zoom .bk-zcap { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .bk-zoom .bk-zx, .bk-zoom .bk-zcap { opacity: 1; } }

/* ---- "אהבת את הסיפור?": the heart that pops once at the end of a story ---- */
.bk-askheart {
  position: absolute; z-index: 5; left: 8%; right: 8%; bottom: 9%; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 12px 12px; border-radius: 14px; text-align: center; color: #4a1505;
  background: rgba(255, 248, 232, .96); box-shadow: 0 0 0 2px #e9a3bf, 0 14px 36px rgba(60, 20, 5, .35);
  animation: ahIn .55s cubic-bezier(.3, 1.6, .5, 1) both;
}
.bk-askheart.out { animation: ahOut .35s ease both; }
.ah-big { font-size: 2.6em; line-height: 1; animation: ahBeat 1.1s ease-in-out .5s infinite; }
.ah-q { margin: 0; font: 900 1.25em 'Frank Ruhl Libre', serif; }
.ah-s { margin: 0; font: italic .78em Rubik, sans-serif; color: #6b4a2a; }
.ah-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.ah-row button { min-height: 42px; padding: 0 16px; border-radius: 999px; cursor: pointer; font: 700 .9em Rubik, sans-serif; }
.ah-yes { border: 0; color: #fff; background: linear-gradient(180deg, #d0457f, #9c2f6b); box-shadow: 0 4px 12px rgba(156, 47, 107, .4); }
.ah-no { border: 1px solid #b08a55; color: #4a1505; background: transparent; }
.ah-row button:focus-visible { outline: 3px solid #6b2d0b; outline-offset: 2px; }
.bk-askheart.thanks .ah-big { animation: ahPop .6s cubic-bezier(.3, 1.6, .5, 1); }
.ah-fly { position: absolute; left: 50%; top: 20%; font-style: normal; font-size: 1.3em; pointer-events: none; animation: ahFly 1.3s ease-out var(--d, 0s) both; }
@keyframes ahIn { from { opacity: 0; transform: translateY(30px) scale(.6); } }
@keyframes ahOut { to { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes ahBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }
@keyframes ahPop { 50% { transform: scale(1.8); } }
@keyframes ahFly { from { opacity: 1; transform: translate(-50%, 0) scale(.6); } to { opacity: 0; transform: translate(calc(-50% + var(--x)), -160px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .bk-askheart, .ah-big, .ah-fly { animation: none !important; } }
html.a11y-still .bk-askheart, html.a11y-still .ah-big, html.a11y-still .ah-fly { animation: none !important; }

/* "אהבת את הסיפור?" — two big round answers: ❤️ כן (marks the story) / ✕ לא (closes) */
.bk-askheart .ah-row { gap: 22px; margin-top: 8px; }
.bk-askheart .ah-row button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; min-height: 76px; padding: 8px 10px; border-radius: 18px;
}
.bk-askheart .ah-yes { color: #fff; }
.bk-askheart .ah-no .ah-big { font-size: 1.6em; line-height: 1.5; animation: none; color: #6b4a2a; }
.bk-askheart .ah-yes .ah-big { font-size: 2.2em; }
.ah-yl { font: 800 .95em Rubik, sans-serif; }

/* ---- the closed book waits to be opened (owner: never by itself) ---- */
.bk-book.waiting .bk-leaf.first .front { cursor: pointer; }
.bk-book.waiting .bk-leaf.first .front::before {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 3px rgba(255, 215, 120, .55), 0 0 30px 6px rgba(255, 200, 90, .35);
  animation: bkWait 2.2s ease-in-out infinite;
}
@keyframes bkWait { 50% { box-shadow: inset 0 0 0 3px rgba(255, 225, 140, .9), 0 0 46px 12px rgba(255, 205, 100, .6); } }
.bk-openhint {
  position: absolute; z-index: 6; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 8px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 16px Rubik, sans-serif; color: #3a2200; white-space: nowrap;
  background: linear-gradient(180deg, #fff1b8, #e9c262 55%, #c99a3c); box-shadow: 0 0 0 2px #6e2a12, 0 8px 22px rgba(0, 0, 0, .5);
  animation: bkHint 1.8s ease-in-out infinite;
}
.bk-openhint:focus-visible { outline: 3px solid #ffd36e; outline-offset: 3px; }
.oh-hand { display: inline-block; animation: bkTap 1.2s ease-in-out infinite; }
@keyframes bkHint { 50% { transform: translateX(-50%) translateY(-4px); } }
@keyframes bkTap { 50% { transform: translateY(-5px) scale(1.1); } }
.bk-dlg.sideways .bk-openhint { bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .bk-openhint, .oh-hand, .bk-book.waiting .bk-leaf.first .front::before { animation: none !important; } }
html.a11y-still .bk-openhint, html.a11y-still .oh-hand, html.a11y-still .bk-book.waiting .bk-leaf.first .front::before { animation: none !important; }
.bk-dlg:has(.bk-openhint) .bk-handle { visibility: hidden; }
