/* Inkara Online Viewer — companion to flipbook.js. Dark stage, one page,
   bottom bar. Fills whatever it is put in (the loader page or an iframe). */
html, body { margin: 0; height: 100%; background: #2b2b37; }
.fb, #flipbook { position: relative; width: 100%; height: 100%; min-height: 320px;
  display: flex; flex-direction: column; background: #2b2b37; color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; overflow: hidden; }
.fb:fullscreen { width: 100vw; height: 100vh; }
.fb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 64px; }
.fb-pagebox { position: relative; margin: 0 auto; display: flex; align-items: center;
  justify-content: center; perspective: 2400px; }
/* Width and height are set in PIXELS by flipbook.js sizeBox(), from the stage's
   free space and the manifest's real page size — deliberately not `aspect-ratio`,
   which a box with both dimensions definite ignores. A half is therefore exactly
   one page: no letterbox margins, and the flip leaf lines up with the page edge. */

/* A spread: two pages meeting at the spine, each exactly half the box. Both
   layers are stacked; the top one is what you see. */
.fb-spread { position: absolute; inset: 0; display: flex; align-items: stretch; justify-content: center;
  opacity: 0; transition: opacity 0.25s ease; }
.fb-spread.is-top { opacity: 1; z-index: 2; }
.fb-side { width: 50%; height: 100%; object-fit: contain; background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); }
.fb-side-l { object-position: right center; }
.fb-side-r { object-position: left center; }
/* A view holding one page — the cover, or a lone last page — sits centred in
   the spread box rather than stretching across it. */
.fb-spread.is-single .fb-side-l { width: 50%; margin: 0 auto; }
/* Single-page mode: the box is one page wide, so the half-width rule would
   shrink it. */
.fb:not(.fb-is-spread) .fb-side { width: 100%; object-position: center; }

/* Page-turn leaf: one page, hinged on its spine edge. In spread mode it covers
   exactly the half that is turning; in single-page mode, the whole box. */
.fb-flipper { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.fb-leaf { position: absolute; top: 0; height: 100%; width: 100%;
  transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.4, 0.05, 0.3, 1); }
.fb-is-spread .fb-leaf { width: 50%; }
.fb-leaf-fwd { left: auto; right: 0; transform-origin: left center; transform: rotateY(0deg); }
.fb-leaf-fwd.is-turning { transform: rotateY(-180deg); }
.fb-leaf-back { left: 0; right: auto; transform-origin: right center; transform: rotateY(0deg); }
.fb-leaf-back.is-turning { transform: rotateY(180deg); }
.fb-leaf-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; backface-visibility: hidden; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); }
.fb-leaf-face.fb-leaf-front { object-position: left center; }
.fb-leaf-face.fb-leaf-back { transform: rotateY(180deg); object-position: right center; }
.fb:not(.fb-is-spread) .fb-leaf-face { object-position: center; }
.fb-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; z-index: 4; }
.fb-arrow:hover { background: rgba(255, 255, 255, 0.2); }
.fb-arrow:disabled { opacity: 0.25; cursor: default; }
.fb-prev { left: 8px; } .fb-next { right: 8px; }
.fb-bar { flex: 0 0 auto; background: #1f1f28; padding: 10px 16px 12px; }
.fb-seek { position: relative; height: 18px; cursor: pointer; display: flex; align-items: center; }
.fb-seek::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; background: rgba(255, 255, 255, 0.25); border-radius: 2px; }
.fb-seek-fill { position: absolute; left: 0; height: 4px; background: #fff; border-radius: 2px; }
.fb-seek-knob { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translateX(-50%); }
.fb-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.fb-brand { flex: 0 0 auto; display: block; line-height: 0; opacity: 0.9; transition: opacity 0.15s; }
.fb-brand:hover, .fb-brand:focus-visible { opacity: 1; }
.fb-brand img { height: 30px; width: auto; display: block; }
.fb-counter { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; min-width: 64px; }
.fb-title { flex: 1 1 auto; min-width: 0; font-size: 13px; color: rgba(255, 255, 255, 0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.fb-tools { display: flex; gap: 6px; margin-left: auto; }   /* stays right when a phone hides the title */
.fb-tool { width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fb-tool:hover, .fb-tool.is-on { background: rgba(255, 255, 255, 0.14); }
.fb-gallery { position: absolute; inset: 0; z-index: 10; background: rgba(31, 31, 40, 0.97); display: flex; flex-direction: column; }
/* The script toggles the hidden attribute; display:flex above would otherwise win over the UA's display:none. */
.fb-gallery[hidden], .fb-toast[hidden] { display: none; }
.fb-gallery-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 600; }
/* Rows are max-content and each tile's height comes from its image's page ratio (--ar, set per page
   from the manifest). An aspect-ratio on the overflow:hidden button let the grid size rows to ~27px in
   a fixed-height flex column, so every row overlapped the next. */
.fb-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 16px 16px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(96px, 11vw, 150px), 1fr)); grid-auto-rows: max-content;
  gap: 14px; align-content: start; }
.fb-thumb { position: relative; border: 2px solid transparent; border-radius: 4px; padding: 0; background: #fff; cursor: pointer; overflow: hidden; }
.fb-thumb img { width: 100%; height: auto; aspect-ratio: var(--ar, 1 / 1.3); object-fit: contain; display: block; background: #fff; }
.fb-thumb:hover { border-color: rgba(255, 255, 255, 0.6); }
.fb-thumb.is-current { border-color: #e2478a; }
.fb-thumb-n { position: absolute; right: 4px; bottom: 4px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, 0.65); padding: 1px 6px; border-radius: 10px; }
.fb-toast { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); background: #fff; color: #1f1f28; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 20px; z-index: 12; }
.fb-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.75); padding: 24px; text-align: center; }
.fb-empty-title { font-size: 16px; }
@media (max-width: 600px) {
  .fb-stage { padding: 10px 44px; }
  .fb-arrow { width: 40px; height: 40px; }
  .fb-title { display: none; }
  .fb-brand img { height: 24px; }
}

/* ── Clickable links (2026-09-25) ─────────────────────────────────────────
   Each overlay takes exactly its page image's box, in every layout, so the
   hotspots' percentages land on the artwork. Mirrors the .fb-side rules above
   and must stay in step with them. */
.fb-links { position: absolute; top: 0; height: 100%; z-index: 1; pointer-events: none; }
.fb-links-l { left: 0; width: 50%; }
.fb-links-r { left: 50%; width: 50%; }
.fb-spread.is-single .fb-links-l { left: 25%; }            /* the cover, alone in a spread */
.fb-spread.is-single .fb-links-r { display: none; }
.fb:not(.fb-is-spread) .fb-links-l { left: 0; width: 100%; } /* single-page mode */
.fb:not(.fb-is-spread) .fb-links-r { display: none; }
/* Only the page on top answers, and nothing answers mid-turn. */
.fb-spread:not(.is-top) .fb-links,
.fb.fb-busy .fb-links { display: none; }
/* Invisible until pointed at: a faint outline says "this is a link" without
   drawing anything on the page. */
.fb-link { position: absolute; display: block; pointer-events: auto; border-radius: 2px;
  cursor: pointer; -webkit-tap-highlight-color: rgba(164, 18, 63, 0.18); }
.fb-link:hover, .fb-link:focus-visible { outline: 2px solid rgba(164, 18, 63, 0.55);
  outline-offset: 1px; background: rgba(164, 18, 63, 0.06); }
