/* eBook Lessons. Cosmic: navy #0B1437, indigo #283593, gold #F5C451. Parchment: brown #5D4037, cream #FBF3E4 */
.ebk-app { --navy: #0B1437; --ink: #1C2340; --gold: #F5C451; --gold2: #E0A526; --accent: #3949AB; --paper: #FFFFFF; --soft: #5E6582; --line: #E4E6F0;
    --ebk-fs: 100%; font-family: "Segoe UI", "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); box-sizing: border-box; margin: 1.5em 0; line-height: 1.5; }
.ebk-app *, .ebk-app *::before, .ebk-app *::after { box-sizing: border-box; }
.ebk-theme-parchment { --navy: #3E2723; --ink: #2E1F16; --gold: #E9B44C; --gold2: #B9802A; --accent: #8D4E2A; --paper: #FFFDF7; --soft: #6D5A4C; --line: #E8DCC8; }
.ebk-app a { text-decoration: none; }
.ebk-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 700; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink) !important; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.ebk-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(11, 20, 55, .15); }
.ebk-btn:focus-visible, .ebk-app a:focus-visible, .ebk-app button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ebk-primary { background: linear-gradient(135deg, var(--gold), var(--gold2)); border-color: var(--gold2); color: var(--navy) !important; }

/* language buttons */
.ebk-langs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); }
.ebk-lang { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: inherit; line-height: 1.2; }
.ebk-lang.ebk-on { background: var(--gold); color: var(--navy) !important; }
.ebk-lang.ebk-miss:not(.ebk-on) { opacity: .7; }
.ebk-lang.ebk-miss::after { content: "*"; margin-left: 1px; opacity: .8; }

/* ===== shelf ===== */
.ebk-shelf { position: relative; border-radius: 18px; padding: 26px 26px 30px; color: #FFFFFF; overflow: hidden;
    background: radial-gradient(circle at 15% 20%, rgba(245, 196, 81, .18) 0, transparent 30%), radial-gradient(circle at 85% 10%, rgba(121, 134, 203, .35) 0, transparent 35%), linear-gradient(160deg, #0B1437 0%, #1A237E 60%, #311B92 100%); }
.ebk-shelf::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: radial-gradient(1px 1px at 20px 30px, #FFF, transparent), radial-gradient(1px 1px at 120px 80px, #FFF, transparent), radial-gradient(1.5px 1.5px at 200px 150px, #FFE9A8, transparent), radial-gradient(1px 1px at 300px 40px, #FFF, transparent), radial-gradient(1px 1px at 380px 120px, #FFF, transparent);
    background-size: 420px 200px; }
.ebk-theme-parchment.ebk-shelf { background: linear-gradient(160deg, #4E342E, #6D4C41 60%, #3E2723); }
.ebk-shelfhead { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.ebk-shelfhead h2 { margin: 0; font-family: Georgia, "Noto Serif", "Times New Roman", serif; font-size: 32px; color: var(--gold) !important; letter-spacing: .01em; }
.ebk-shelfhead p { margin: 2px 0 0; color: #C5CAE9 !important; }
.ebk-shelfhead .ebk-lang { color: #FFFFFF; }
.ebk-books { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px; }
.ebk-book { display: flex; flex-direction: column; background: rgba(255, 255, 255, .97); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: transform .2s, box-shadow .2s; }
.ebk-book:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.ebk-cover { --c1: #1A237E; --c2: #4A148C; position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 3 / 3.4; padding: 18px 18px 16px 30px; color: #FFFFFF !important;
    background: var(--img, none) center / cover no-repeat, linear-gradient(145deg, var(--c1), var(--c2)); }
.ebk-cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .15) 60%, rgba(0, 0, 0, .15)); }
.ebk-cover::after { content: ""; position: absolute; inset: 10px 10px 10px 24px; border: 1px solid rgba(245, 196, 81, .6); border-radius: 6px; pointer-events: none; }
.ebk-glyph { position: absolute; top: 18px; right: 22px; font-size: 64px; line-height: 1; color: var(--gold); opacity: .9; text-shadow: 0 0 18px rgba(245, 196, 81, .6); }
.ebk-ctitle { position: relative; font-family: Georgia, "Noto Serif", serif; font-size: 22px; font-weight: 700; line-height: 1.2; text-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.ebk-cmeta { position: relative; margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.ebk-binfo { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; color: var(--ink); flex: 1; }
.ebk-binfo h3 { margin: 0; font-size: 17px; }
.ebk-binfo h3 a { color: var(--ink) !important; }
.ebk-binfo p { margin: 0; font-size: 13px; color: var(--soft) !important; }
.ebk-prog { height: 6px; background: #ECEEF6; border-radius: 4px; overflow: hidden; margin-top: auto; }
.ebk-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.ebk-start { align-self: flex-start; margin-top: 6px; background: var(--navy); border-color: var(--navy); color: #FFFFFF !important; }
.ebk-empty { position: relative; color: #FFFFFF; }

/* ===== reader ===== */
.ebk-reader { border-radius: 16px; overflow: hidden; background: #EEF0F8; box-shadow: 0 8px 30px rgba(11, 20, 55, .12); }
.ebk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px; background: linear-gradient(90deg, var(--navy), var(--c1, #1A237E) 60%, var(--c2, #4A148C)); color: #FFFFFF; position: sticky; top: 0; z-index: 5; }
.ebk-back, .ebk-tocbtn { color: #FFFFFF !important; font-weight: 700; font-size: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-family: inherit; line-height: 1.2; }
.ebk-tocbtn { display: none; }
.ebk-booktitle { flex: 1 1 200px; font-family: Georgia, "Noto Serif", serif; font-size: 18px; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ebk-glyph-s { margin-right: 8px; }
.ebk-bar .ebk-lang { color: #FFFFFF; }
.ebk-tools { display: inline-flex; gap: 4px; }
.ebk-tool { min-width: 38px; min-height: 34px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: #FFFFFF; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; padding: 0 8px; }
.ebk-tool:hover { background: rgba(255, 255, 255, .22); }
.ebk-progressline { height: 4px; background: rgba(11, 20, 55, .12); }
.ebk-progressline i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); transition: width .4s; }
.ebk-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 520px; }
.ebk-toc { background: #FFFFFF; border-right: 1px solid var(--line); padding: 14px 0; max-height: 80vh; overflow: auto; position: sticky; top: 58px; align-self: start; }
.ebk-tochead { display: flex; flex-direction: column; padding: 0 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.ebk-tochead b { font-family: Georgia, serif; font-size: 16px; color: var(--ink); }
.ebk-tocprog { font-size: 12px; color: var(--soft); }
.ebk-toc ol { list-style: none; margin: 0; padding: 0; }
.ebk-toc a { display: grid; grid-template-columns: 30px 1fr 18px; align-items: start; gap: 6px; padding: 8px 14px; font-size: 14px; color: var(--ink) !important; border-left: 3px solid transparent; }
.ebk-toc a:hover { background: #F4F5FB; }
.ebk-toc a.ebk-cur { background: #EEF0FF; border-left-color: var(--accent); font-weight: 700; }
.ebk-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #ECEEF6; font-size: 12px; font-weight: 800; color: var(--soft); }
.ebk-cur .ebk-n { background: var(--accent); color: #FFFFFF; }
.ebk-done { visibility: hidden; color: #2E7D32; font-weight: 800; }
.ebk-isdone .ebk-done { visibility: visible; }
.ebk-isdone .ebk-n { background: #C8E6C9; color: #1B5E20; }
.ebk-stage { padding: 28px 28px 34px; perspective: 1600px; }
.ebk-page { position: relative; max-width: 820px; margin: 0 auto; background: var(--paper); border-radius: 6px 14px 14px 6px; padding: 42px 52px 34px; font-size: var(--ebk-fs);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 14px 40px rgba(11, 20, 55, .14), inset 6px 0 12px -8px rgba(0, 0, 0, .25); transform-origin: left center; transition: transform .26s ease, opacity .26s ease; }
.ebk-page::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 22px; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, rgba(0, 0, 0, .06), transparent); pointer-events: none; }
.ebk-page.ebk-turn-next { transform: rotateY(-14deg) translateX(-20px); opacity: 0; }
.ebk-page.ebk-turn-prev { transform: rotateY(14deg) translateX(20px); opacity: 0; }
.ebk-page.ebk-fade { opacity: .2; }
.ebk-page.ebk-turn-in { animation: ebk-in .38s ease; }
@keyframes ebk-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ebk-page.ebk-loading { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .ebk-page, .ebk-page.ebk-turn-in { transition: none; animation: none; } .ebk-page.ebk-turn-next, .ebk-page.ebk-turn-prev { transform: none; } }
.ebk-kicker { margin: 0 0 6px; font-size: .8em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold2) !important; }
.ebk-ptitle { margin: 0 0 18px; font-family: Georgia, "Noto Serif", "Noto Serif Devanagari", "Times New Roman", serif; font-size: 2.1em; line-height: 1.2; color: var(--ink) !important; }
.ebk-ptitle:focus { outline: none; }
.ebk-hero { margin: 0 0 22px; }
.ebk-hero img { width: 100%; height: auto; border-radius: 10px; display: block; }
.ebk-content { font-family: Georgia, "Noto Serif", "Noto Serif Devanagari", "Times New Roman", serif; font-size: 1.12em; line-height: 1.8; color: var(--ink); }
.ebk-content p, .ebk-content li { color: var(--ink) !important; }
.ebk-content > p:first-of-type::first-letter { float: left; font-size: 3.4em; line-height: .9; padding: 6px 8px 0 0; color: var(--accent); font-weight: 700; }
[lang="hi"] .ebk-content > p:first-of-type::first-letter, .ebk-page[lang="hi"] .ebk-content > p:first-of-type::first-letter { float: none; font-size: 1em; padding: 0; color: inherit; font-weight: inherit; }
.ebk-content h2, .ebk-content h3 { font-family: Georgia, serif; color: var(--ink) !important; margin: 1.4em 0 .5em; }
.ebk-content h2 { border-bottom: 2px solid var(--gold); padding-bottom: 4px; }
.ebk-content img { max-width: 100%; height: auto; border-radius: 8px; }
.ebk-content blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--gold); background: #FFF9E8; border-radius: 0 8px 8px 0; }
.ebk-content table { width: 100%; border-collapse: collapse; font-family: "Segoe UI", sans-serif; font-size: .9em; }
.ebk-content th, .ebk-content td { border: 1px solid var(--line); padding: 6px 8px; }
.ebk-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: #FFF6DB; border: 1px solid #F3D27A; font-size: 14px; color: #6B4E00; }
.ebk-missing span { color: #6B4E00 !important; }
.ebk-missing .ebk-btn { min-height: 34px; padding: 0 14px; font-size: 13px; }
.ebk-pagefoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 30px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14px; }
.ebk-mark { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink); }
.ebk-mark input { width: 18px; height: 18px; accent-color: #2E7D32; }
.ebk-permalink { color: var(--accent) !important; font-weight: 600; }
.ebk-pnav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.ebk-pnav a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: #F8F9FD; color: var(--ink) !important; transition: border-color .15s, transform .15s; }
.ebk-pnav a:hover { border-color: var(--accent); transform: translateY(-1px); }
.ebk-pnav small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ebk-pnav span { font-weight: 700; font-size: 15px; }
.ebk-next { text-align: right; background: linear-gradient(135deg, #FFF8E1, #FFFFFF) !important; border-color: var(--gold) !important; }
.ebk-end { align-self: center; justify-self: end; font-weight: 700; color: var(--gold2); }

/* reading modes */
.ebk-mode-sepia .ebk-page { --paper: #F7EEDC; --ink: #3B2A1A; }
.ebk-mode-sepia .ebk-stage { background: #E9DEC8; }
.ebk-mode-night { background: #0B1020; }
.ebk-mode-night .ebk-stage { background: #0B1020; }
.ebk-mode-night .ebk-page { --paper: #151B30; --ink: #E3E6F3; --line: #2A3150; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.ebk-mode-night .ebk-pnav a { background: #1C2340; }
.ebk-mode-night .ebk-toc { background: #10162A; border-color: #2A3150; }
.ebk-mode-night .ebk-toc a, .ebk-mode-night .ebk-tochead b { color: #E3E6F3 !important; }
.ebk-mode-night .ebk-toc a:hover, .ebk-mode-night .ebk-toc a.ebk-cur { background: #1C2340; }
.ebk-mode-night .ebk-content blockquote { background: #1C2340; }

/* full screen */
.ebk-reader.ebk-full { position: fixed; inset: 0; z-index: 100000; margin: 0; border-radius: 0; overflow: auto; }
.ebk-reader:fullscreen { overflow: auto; }
html.ebk-noscroll, html.ebk-noscroll body { overflow: hidden; }

/* single posts */
.ebk-single { margin: 0 0 1.2em; }
.ebk-single .ebk-langs { background: #EEF0F8; border-color: var(--line); }
.ebk-single .ebk-lang { color: var(--ink); }
.ebk-single .ebk-missing { margin-top: 10px; }
.ebk-inbook { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 1.5em; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, #0B1437, #283593); color: #FFFFFF; }
.ebk-inbook > div { display: flex; flex-direction: column; margin-right: auto; }
.ebk-inbook small { color: var(--gold) !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.ebk-inbook b { color: #FFFFFF !important; font-family: Georgia, serif; font-size: 17px; }

@media (max-width: 900px) {
    .ebk-layout { grid-template-columns: 1fr; }
    .ebk-tocbtn { display: inline-block; }
    .ebk-toc { display: none; position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .ebk-tocopen .ebk-toc { display: block; }
    .ebk-stage { padding: 14px 10px 20px; }
    .ebk-page { padding: 26px 20px 22px; }
    .ebk-ptitle { font-size: 1.6em; }
    .ebk-pnav { grid-template-columns: 1fr; }
}
@media print { .ebk-bar, .ebk-toc, .ebk-pnav, .ebk-pagefoot, .ebk-progressline, .ebk-missing { display: none !important; } .ebk-layout { display: block; } .ebk-page { box-shadow: none; padding: 0; } }

/* break out of narrow theme content columns (centred, up to 1240px) */
.ebk-reader, .ebk-shelf { width: min(1240px, calc(100vw - 32px)) !important; max-width: none !important; margin-left: calc(50% - min(620px, 50vw - 16px)) !important; margin-right: 0 !important; }
.ebk-reader.ebk-full { width: auto !important; margin: 0 !important; }
@media (max-width: 600px) { .ebk-reader, .ebk-shelf { width: calc(100vw - 16px) !important; margin-left: calc(50% - 50vw + 8px) !important; } }

/* 1.1: zodiac signs as SVG, thumbnails on covers and in the contents */
.ebk-glyph { width: 70px; height: 70px; font-size: 0; color: var(--gold); filter: drop-shadow(0 0 8px rgba(245, 196, 81, .55)); z-index: 2; }
.ebk-zsvg { display: block; width: 100%; height: 100%; }
.ebk-glyph-s { display: inline-flex; width: 22px; height: 22px; vertical-align: -4px; color: var(--gold); }
.ebk-zsvg-s, .ebk-zsvg-t { display: block; width: 100%; height: 100%; }
.ebk-cover.ebk-hasimg { background: #0B1437; }
.ebk-cimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.ebk-cover.ebk-hasimg::after { inset: 0; border: 0; border-radius: 0; background: linear-gradient(180deg, rgba(11, 20, 55, .15) 0%, rgba(11, 20, 55, .35) 45%, rgba(11, 20, 55, .92) 100%); z-index: 1; }
.ebk-cover.ebk-hasimg::before { z-index: 2; }
.ebk-cover .ebk-ctitle, .ebk-cover .ebk-cmeta { z-index: 2; }
.ebk-cover.ebk-hasimg .ebk-glyph { width: 46px; height: 46px; top: 14px; right: 14px; padding: 8px; border-radius: 50%; background: rgba(11, 20, 55, .55); border: 1px solid rgba(245, 196, 81, .6); }
.ebk-toc a { grid-template-columns: 26px 40px 1fr 16px; align-items: center; }
.ebk-tthumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.ebk-tsign { --c1: #1A237E; --c2: #4A148C; padding: 7px; color: var(--gold); background: linear-gradient(145deg, var(--c1), var(--c2)); }
