/* ==========================================================
   Reader enhancements: previous/next pager, floating controls,
   night reading mode. Loaded after each page's own styles.
   ========================================================== */

/* ---------- Previous / Next pager (identical at top and bottom) ---------- */
.pager{display:flex;justify-content:space-between;gap:1rem;width:min(900px,100%);margin:0 auto 2.4rem}
.pager+*{margin-top:0}
.pager a{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:.2rem;padding:.75rem 1.05rem;border:1px solid #c9a24b;border-radius:2px;background:#fbf3df;color:#7c0f24;text-decoration:none;font-family:"EB Garamond",serif;line-height:1.3;box-shadow:0 4px 14px #5b250d14}
.pager small{font-size:.78rem;letter-spacing:.12em;text-transform:uppercase;color:#7a5a14}
.pager span{font-size:1.12rem;overflow-wrap:anywhere}
.pager .pager-prev{text-align:left;align-items:flex-start}
.pager .pager-next{text-align:right;align-items:flex-end}
.pager a:hover,.pager a:focus-visible{background:#7c0f24;color:#f8eed7;outline:2px solid #c9a24b;outline-offset:2px}
.pager a:hover small,.pager a:focus-visible small{color:#e3c98a}
@media(max-width:560px){.pager{flex-direction:column;gap:.7rem}.pager .pager-next{text-align:right}}

/* ---------- Floating controls ---------- */
.reader-btn{position:fixed;z-index:60;padding:.42rem .85rem;border:1px solid #c9a24b;border-radius:2px;background:#4c0716;color:#e3c98a;font:400 .95rem/1.3 "EB Garamond",serif;letter-spacing:.04em;cursor:pointer;box-shadow:0 4px 14px #0006;text-decoration:none}
.reader-btn:hover,.reader-btn:focus-visible{background:#e3c98a;color:#4c0716;outline-offset:3px}
.theme-toggle{top:.8rem;right:.8rem}
.to-top{right:.8rem;bottom:.8rem;opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}
.to-top.show{opacity:1;visibility:visible}
@media(max-width:560px){.reader-btn{font-size:.85rem;padding:.35rem .65rem}}

/* The in-cover "Contents" link moves to the top-left so it never meets the Night/Day button */
.cover .contents-return{right:auto;left:clamp(1rem,4vw,3rem)}
@media(max-width:560px){.cover .contents-return{right:auto;left:.8rem}}

/* ==========================================================
   NIGHT READING MODE
   Whole reading surface becomes dark; every text layer is
   re-coloured so it stays readable on the dark cards.
   ========================================================== */
html[data-theme="night"]{color-scheme:dark}
html[data-theme="night"] body{background:#0f0705}

/* page surface */
html[data-theme="night"] main{background-color:#150c09!important;background-image:radial-gradient(ellipse at 10% 0%,#7c0f2426,transparent 42%),radial-gradient(ellipse at 90% 100%,#7c0f2426,transparent 42%)!important;color:#eadcc0}

/* cards */
html[data-theme="night"] main :is(.prelude,.verse){background:#241610!important;border-color:#6e5226!important;box-shadow:0 7px 22px #0008}
html[data-theme="night"] main :is(.ritual,.instruction,.dedication,.invocation){background:#2b1a13!important;border-color:#6e5226!important}

/* base text colour for everything inside the reading area */
html[data-theme="night"] main :where(h1,h2,h3,h4,h5,h6,p,span,div,li,b,i,em,strong,small,a,blockquote,td,th,cite,label,dt,dd){color:#eadcc0!important;-webkit-text-fill-color:currentColor!important;opacity:1}

/* headings and closing lines */
html[data-theme="night"] main :is(.intro h2,.section-title,.closing,.sub-h1,.colophon,.dedication){color:#f0bfae!important}
html[data-theme="night"] main .intro>p{color:#cdb590!important}

/* Sanskrit (Devanagari verse) */
html[data-theme="night"] main :is(.dev,.san,.prelude .dev,.verse .dev,.mantra-card .dev,.mini-verse .dev){color:#f8ebcc!important}

/* IAST transliteration */
html[data-theme="night"] main :is(.iast,.prelude .iast,.verse .iast){color:#d9bd7c!important}

/* English meaning */
html[data-theme="night"] main :is(.verse-meanings>div:first-child>p,.prelude-meaning,.eng,.txt,.meaning-en p,.meanings p,.prose-block p){color:#eadcc0!important}

/* Hindi bhavartha */
html[data-theme="night"] main :is(.meaning-hi p,.meaning-hi .devanagari,.hin,.hin-cue,.prelude .meaning-hi>p,.verse .meaning-hi>p){color:#f4c9b8!important}

/* small labels and verse numbers */
html[data-theme="night"] main :is(.verse-label,.prelude-label,.verse-meanings span,.meaning-hi>span,.lang-label,.speaker-label,.verse-num,.section-sub,.eyebrow-devanagari,.cue,.num,.source){color:#dcb860!important}

/* ornaments */
html[data-theme="night"] main .verse:before,html[data-theme="night"] main .verse:after{border-color:#c9a24b}
html[data-theme="night"] main :is(.verse-meanings,.meaning-hi){border-color:#6e522688!important}
html[data-theme="night"] main :is(.divider-art,.om-art,.om-divider-mark,.yantra-art){background-color:#f3e6c6!important;border-radius:50%!important;mix-blend-mode:normal!important;box-shadow:0 0 0 1px #c9a24b88!important}

/* pager */
html[data-theme="night"] .pager a{background:#241610;border-color:#8a6a2a;box-shadow:0 4px 14px #0008}
html[data-theme="night"] .pager a span{color:#f0bfae!important}
html[data-theme="night"] .pager a small{color:#d9bd7c!important}
html[data-theme="night"] .pager a:hover,html[data-theme="night"] .pager a:focus-visible{background:#e3c98a}
html[data-theme="night"] .pager a:hover span,html[data-theme="night"] .pager a:focus-visible span,html[data-theme="night"] .pager a:hover small,html[data-theme="night"] .pager a:focus-visible small{color:#2a1208!important}

@media print{.reader-btn{display:none!important}}
