/* ई-पेपर फ़्लिपबुक */
:root { --fb-primary: #c0141c; --fb-bg: #2b2f36; --fb-bar: #16191e; --fb-ink: #f1f3f5; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--fb-bg); color: var(--fb-ink); font-family: 'Mukta', 'Noto Sans Devanagari', system-ui, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fb { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.fb-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--fb-bar); border-bottom: 3px solid var(--fb-primary); position: sticky; top: 0; z-index: 20; }
.fb-back { font-size: 30px; line-height: 1; padding: 0 6px 4px; opacity: .85; }
.fb-brand img { height: 34px; display: block; background: #fff; border-radius: 4px; padding: 2px 4px; }
.fb-brand { font-weight: 800; font-size: 18px; }
.fb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.fb-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-title span { font-size: 13px; opacity: .7; }
.fb-tools { display: flex; align-items: center; gap: 2px; }
.fb-tools > * { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; }
.fb-tools > *:hover { background: rgba(255,255,255,.1); }
.fb-tools .wa:hover { background: #25d366; }
.fb-tools .fb-lang { width: auto; padding: 0 10px; font-size: 13px; border: 1px solid rgba(255,255,255,.25); height: 30px; border-radius: 99px; margin-left: 4px; }

.fb-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 18px 64px; min-height: 340px; overflow: hidden; }
.fb-book { position: relative; perspective: 2600px; }
.fb-book .pg { position: absolute; top: 0; height: 100%; background: #fff; overflow: hidden; }
.fb-book .pg img { width: 100%; height: 100%; display: block; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.fb-book .pg.l { left: 0; box-shadow: inset -18px 0 24px -16px rgba(0,0,0,.35); }
.fb-book .pg.r { right: 0; box-shadow: inset 18px 0 24px -16px rgba(0,0,0,.3); }
.fb-book.single .pg.r { box-shadow: none; }
.fb-book .pg .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #999; font-size: 14px; background: repeating-linear-gradient(45deg, #fafafa 0 12px, #f2f2f2 12px 24px); }
.fb-book .shadow { position: absolute; inset: 0; box-shadow: 0 18px 50px rgba(0,0,0,.55); pointer-events: none; }
/* मुड़ता पन्ना */
.fb-book .leaf { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.45,.05,.3,1); z-index: 5; }
.fb-book .leaf > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; overflow: hidden; }
.fb-book .leaf > div img { width: 100%; height: 100%; display: block; }
.fb-book .leaf .back { transform: rotateY(180deg); }
.fb-book .leaf.fwd { transform-origin: left center; }
.fb-book .leaf.bwd { transform-origin: right center; }
.fb-book .leaf.fwd.go { transform: rotateY(-180deg); }
.fb-book .leaf.bwd.go { transform: rotateY(180deg); }
.fb-book .leaf > div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.18)); opacity: 0; transition: opacity .75s; }
.fb-book .leaf.go > div::after { opacity: 1; }
.fb-book .hit { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 6; cursor: pointer; }
.fb-book .hit.l { left: 0; cursor: w-resize; } .fb-book .hit.r { right: 0; cursor: e-resize; }

.fb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; font-size: 44px; line-height: 1; background: rgba(0,0,0,.35); border-radius: 10px; z-index: 8; padding-bottom: 6px; }
.fb-nav:hover { background: var(--fb-primary); }
.fb-nav.prev { left: 8px; } .fb-nav.next { right: 8px; }
.fb-nav:disabled, .fb-bottom button:disabled { opacity: .25; cursor: default; background: rgba(0,0,0,.2); }

.fb-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: .85; }
.fb-loading i { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--fb-primary); border-radius: 50%; animation: fbspin 1s linear infinite; }
.fb-loading.err i { display: none; }
@keyframes fbspin { to { transform: rotate(360deg); } }

.fb-bottom { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; background: var(--fb-bar); }
.fb-bottom button { width: 40px; height: 36px; border-radius: 8px; font-size: 22px; background: rgba(255,255,255,.08); }
.fb-bottom button:hover:not(:disabled) { background: var(--fb-primary); }
.fb-pg { display: flex; align-items: center; gap: 6px; margin: 0 8px; font-size: 15px; }
.fb-pg select { font: inherit; background: #fff; color: #111; border-radius: 6px; padding: 3px 6px; border: 0; }

.fb-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 12px; background: #1d2026; scrollbar-width: thin; }
.fb-thumbs button { flex: none; width: 74px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: #fff; position: relative; }
.fb-thumbs button.on { border-color: var(--fb-primary); box-shadow: 0 0 0 2px var(--fb-primary); }
.fb-thumbs img { width: 100%; display: block; aspect-ratio: var(--ar, .7); object-fit: cover; }
.fb-thumbs span { position: absolute; bottom: 2px; right: 3px; font-size: 11px; background: rgba(0,0,0,.7); color: #fff; padding: 0 4px; border-radius: 3px; }
.fb-more { padding: 10px 14px 18px; font-size: 14px; background: #1d2026; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fb-more a { opacity: .8; text-decoration: underline; text-underline-offset: 3px; }
.fb-more a:hover { opacity: 1; }

/* बड़ा करके पढ़ना */
.fb-zoom { position: fixed; inset: 0; z-index: 50; background: #111; display: flex; flex-direction: column; }
.fb-zoom-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--fb-bar); }
.fb-zoom-bar span { flex: 1; }
.fb-zoom-bar button { width: 40px; height: 36px; border-radius: 8px; font-size: 20px; background: rgba(255,255,255,.1); }
.fb-zoom-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; text-align: center; padding: 12px; }
.fb-zoom-body img { display: inline-block; margin: 0 4px 12px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.6); max-width: none; vertical-align: top; }
.fb-noscript { text-align: center; padding: 40px; }
.fb-noscript a { text-decoration: underline; }

@media (max-width: 760px) {
  .fb-stage { padding: 10px 6px; }
  .fb-nav { width: 34px; height: 56px; font-size: 32px; background: rgba(0,0,0,.25); }
  .fb-nav.prev { left: 2px; } .fb-nav.next { right: 2px; }
  .fb-brand { display: none; }
  .fb-tools > * { width: 34px; }
  .fb-tools [data-fb="full"] { display: none; }
  .fb-title span { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .fb-book .leaf { transition-duration: .35s; } }
