/* A quiet, tactile reading room for the Sanskrit source text. */
#section-granth { --ink: #342c20; --paper: #f5ecd8; --paper-deep: #e7d6b7; --gold: #e6b95a; }
.ag-language-picker { display:flex; align-items:center; gap:2px; padding:3px; border:1px solid rgba(148,163,184,.22); border-radius:13px; background:#0b1120; }
.ag-language-picker button { min-height:32px; padding:0 8px; border:0; border-radius:9px; background:transparent; color:#94a3b8; font:700 11px/1 'Mukta',sans-serif; white-space:nowrap; cursor:pointer; transition:background .18s,color .18s,transform .18s; }
.ag-language-picker button[aria-pressed="true"] { color:#111827; background:linear-gradient(135deg,#f5d782,#e8ad4d); box-shadow:0 2px 12px #e6b95a33; }
.ag-language-picker button:focus-visible,.reader-toolbar button:focus-visible,.reader-controls :focus-visible,.reader-pagination button:focus-visible { outline:2px solid #f3cb73; outline-offset:2px; }
#tabNav .tab-btn { flex:0 0 auto; }
.granth-hero { position:relative; min-height:215px; display:flex; align-items:center; justify-content:space-between; gap:20px; overflow:hidden; padding:clamp(22px,4vw,42px); border:1px solid rgba(230,185,90,.3); border-radius:28px; background:radial-gradient(80% 130% at 92% 4%,#c0782b32,transparent 55%),linear-gradient(115deg,#171520,#0c1221 65%,#101a22); box-shadow:0 18px 60px #0005,inset 0 1px #fff1; }
.granth-hero-glow { position:absolute; right:8%; top:-115px; width:280px; height:280px; border:1px solid #e6b95a24; border-radius:50%; box-shadow:0 0 0 20px #e6b95a09,0 0 0 45px #e6b95a06; pointer-events:none; }
.granth-hero-copy { position:relative; max-width:800px; }
.granth-eyebrow { color:#ecc773; font:800 10px/1.5 'Outfit','Mukta',sans-serif; letter-spacing:.18em; text-transform:uppercase; }
.granth-hero h2 { margin:9px 0 7px; color:#fff5db; font:800 clamp(23px,3.3vw,38px)/1.18 'Tiro Devanagari Hindi','Mukta',serif; letter-spacing:-.025em; }
.granth-hero p { max-width:790px; margin:0; color:#c2b7a2; font:500 14px/1.7 'Mukta',sans-serif; }
.granth-seal { position:relative; flex:0 0 auto; width:112px; height:112px; display:flex; flex-direction:column; align-items:center; justify-content:center; border:1px solid #d8b76888; border-radius:50%; color:#f1ce7a; box-shadow:inset 0 0 0 7px #e6b95a10,0 0 38px #e6b95a15; }
.granth-seal:before,.granth-seal:after { position:absolute; inset:8px; border:1px solid #d8b76835; border-radius:50%; content:""; }
.granth-seal:after { inset:-7px; border-style:dashed; opacity:.55; }
.granth-seal span { font:32px/1 'Tiro Devanagari Hindi',serif; }
.granth-seal small { margin-top:5px; font:700 10px/1 'Mukta',sans-serif; letter-spacing:.13em; }
.granth-catalog { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(230px,.75fr); gap:14px; align-items:stretch; }
.granth-book-card { min-height:304px; display:grid; grid-template-columns:minmax(175px,.7fr) minmax(0,1.3fr); gap:clamp(16px,3vw,34px); align-items:center; padding:clamp(14px,2.5vw,24px); border:1px solid #e5bd6540; border-radius:26px; background:linear-gradient(145deg,#171923,#0e1421 75%); box-shadow:0 16px 36px #0003,inset 0 1px #fff1; }
.granth-cover-art { position:relative; min-height:260px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:11px; overflow:hidden; padding:20px 16px; border:1px solid #e6c36c; border-radius:9px 18px 18px 9px; color:#f2d88e; text-align:center; background:radial-gradient(ellipse at 50% 43%,#406958 0,#203c39 38%,#14201f 70%),linear-gradient(110deg,#a97a2c 0,#563f1f 3%,#1a2a27 9%,#12201f 100%); box-shadow:inset 5px 0 8px #ffd77922,inset -7px 0 12px #0007,10px 12px 22px #0005; }
.granth-cover-art:before { position:absolute; inset:9px; border:1px solid #d7b4558a; border-radius:5px 13px 13px 5px; content:""; }
.granth-cover-lines { position:absolute; inset:17px; border:1px solid #d7b45542; border-radius:3px 10px 10px 3px; }
.cover-om { z-index:1; font:38px/1 'Tiro Devanagari Hindi',serif; text-shadow:0 2px 18px #efcf77; }
.cover-title { z-index:1; font:800 clamp(16px,2vw,21px)/1.5 'Tiro Devanagari Hindi','Mukta',serif; }
.cover-subtitle { z-index:1; color:#d6c184; font:italic 12px/1.4 Georgia,serif; letter-spacing:.05em; }
.cover-mark { z-index:1; margin-top:17px; color:#c9b574; font:700 10px/1.5 'Mukta',sans-serif; letter-spacing:.05em; }
.granth-card-copy h3 { margin:7px 0; color:#fff4d8; font:800 clamp(21px,2.5vw,30px)/1.28 'Tiro Devanagari Hindi','Mukta',serif; }
.granth-card-copy>p { margin:0; color:#aaa59b; font:500 13px/1.7 'Mukta',sans-serif; }
.granth-card-meta { display:flex; flex-wrap:wrap; gap:8px 18px; margin:17px 0 18px; color:#d5c7a5; font:600 12px/1.5 'Mukta',sans-serif; }
.granth-card-meta span:first-child { color:#ebca77; }
.granth-primary-button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:46px; padding:0 20px; border:1px solid #f0d384; border-radius:14px; color:#201a0f; background:linear-gradient(135deg,#f4d984,#dba849); box-shadow:0 7px 22px #d8a4412e; font:800 14px/1.3 'Mukta',sans-serif; cursor:pointer; transition:transform .2s,box-shadow .2s; }
.granth-primary-button:after { content:"↗"; font:800 17px/1 'Outfit',sans-serif; }
.granth-primary-button:hover { transform:translateY(-2px); box-shadow:0 11px 25px #d8a44145; }
.granth-source-note { display:flex; align-items:flex-start; gap:10px; padding:16px; border:1px solid #64748b30; border-radius:19px; background:#0d1422; }
.granth-source-note p { margin:0; color:#a9b3c1; font:500 12px/1.75 'Mukta',sans-serif; }
.source-note-icon { flex:0 0 auto; color:#e6c06b; font:700 17px/1.4 sans-serif; }
.gita-reader { overflow:hidden; padding:clamp(12px,2vw,20px); border:1px solid #d4ae5a44; border-radius:24px; background:linear-gradient(145deg,#171923,#0b1120); box-shadow:0 22px 65px #0005; }
.gita-reader.hidden { display:none!important; }
.reader-toolbar { display:grid; grid-template-columns:1fr minmax(130px,2fr) 1fr; align-items:center; gap:10px; padding-bottom:14px; }
.reader-toolbar button { display:inline-flex; align-items:center; gap:7px; width:max-content; min-height:38px; padding:0 12px; border:1px solid #d1ad6540; border-radius:12px; color:#dcc48c; background:#151a26; font:700 12px/1.2 'Mukta',sans-serif; cursor:pointer; }
.reader-toolbar .reader-bookmark { justify-self:end; }
.reader-bookmark.is-saved { color:#ffe29a; border-color:#ebc464aa; background:#4d3c1c55; }
.reader-toolbar-title { display:grid; gap:3px; text-align:center; color:#fbf0d3; font:800 15px/1.3 'Tiro Devanagari Hindi','Mukta',serif; }
.reader-kicker { color:#a99b7b; font:800 9px/1.2 'Outfit','Mukta',sans-serif; letter-spacing:.18em; }
.reader-controls { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin:0 auto 14px; }
.reader-controls label { display:grid; gap:4px; color:#a9b1bd; font:700 10px/1.3 'Mukta',sans-serif; }
.reader-controls select,.reader-controls input { min-height:39px; min-width:165px; padding:0 11px; border:1px solid #334155; border-radius:11px; outline:none; color:#e8e4da; background:#101725; font:600 12px/1.2 'Mukta',sans-serif; }
.reader-controls input { min-width:90px; width:112px; }
.font-controls { display:flex; gap:5px; margin-left:auto; }
.font-controls button { min-width:43px; height:39px; border:1px solid #334155; border-radius:11px; color:#e8d19b; background:#101725; font:800 13px/1 'Outfit',sans-serif; cursor:pointer; }
.gita-book-wrap { position:relative; display:grid; grid-template-columns:minmax(240px,.74fr) minmax(0,1.26fr); gap:0; min-height:520px; padding:13px; overflow:hidden; border:1px solid #9c713f; border-radius:16px 23px 23px 16px; background:linear-gradient(90deg,#7e572b 0,#be9559 2%,#77532e 2.5%,#dfc393 4%,#4b3826 4.3%,#634726 50%,#51391f 100%); box-shadow:0 22px 42px #0008,inset 0 0 0 2px #f4d49224,inset 14px 0 20px #0005; perspective:1700px; }
.gita-book-spine { position:absolute; top:15px; bottom:15px; left:calc(37% + 5px); width:18px; z-index:3; transform:translateX(-50%); border-radius:50%; background:linear-gradient(90deg,#b68d52aa,#674923aa 40%,#301f13aa 51%,#b18a4e88); box-shadow:0 0 15px #0009; pointer-events:none; }
.gita-side-page,.gita-page { position:relative; min-width:0; min-height:492px; padding:clamp(24px,4vw,48px); color:var(--ink); background:radial-gradient(ellipse at 50% 5%,#fffbe9,#f5ecd8 67%,#ebdbbb); box-shadow:inset 0 0 22px #9e7a4225; }
.gita-side-page { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:36px clamp(24px,3.5vw,48px); text-align:center; border-radius:5px 0 0 5px; }
.gita-side-page:after,.gita-page:after { position:absolute; inset:9px; border:1px solid #a8814533; border-radius:3px; content:""; pointer-events:none; }
.side-page-mandala { width:68px; height:68px; display:grid; place-items:center; border:1px solid #a9834a99; border-radius:50%; color:#997237; box-shadow:inset 0 0 0 5px #99723712; font:31px/1 'Tiro Devanagari Hindi',serif; }
.side-page-rule { width:60px; height:1px; margin:23px 0 15px; background:#ad8a53; }
.side-page-label { margin:0; color:#927243; font:800 9px/1.4 'Outfit','Mukta',sans-serif; letter-spacing:.18em; text-transform:uppercase; }
.gita-side-page h3 { margin:9px 0 4px; color:#403725; font:800 clamp(18px,2vw,24px)/1.4 'Tiro Devanagari Hindi','Mukta',serif; }
.gita-side-page>p:not(.side-page-label):not(.side-page-hint) { margin:0; color:#807252; font:600 11px/1.6 'Mukta',sans-serif; }
.side-page-ornament { margin:21px 0 13px; color:#bc9250; font:30px/1 Georgia,serif; }
.side-page-hint { max-width:270px; margin:0; color:#766c58; font:500 12px/1.8 'Mukta',sans-serif; }
.gita-page-stage { position:relative; min-width:0; min-height:492px; transform-style:preserve-3d; }
.gita-page { height:100%; min-height:492px; padding:clamp(24px,3.8vw,46px); overflow:hidden; border-radius:0 5px 5px 0; }
#gitaPageContent { position:relative; z-index:1; max-height:404px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#b99a67 transparent; padding:2px 2px 10px; }
.verse-block { padding:0 0 19px; }
.verse-block+.verse-block { padding-top:15px; border-top:1px solid #9b815425; }
.verse-ref { display:flex; align-items:center; gap:8px; margin-bottom:12px; color:#997544; font:800 10px/1.3 'Outfit','Mukta',sans-serif; letter-spacing:.13em; }
.verse-ref:after { content:""; width:38px; height:1px; background:#bd9b664f; }
.verse-text { color:#3d3323; font:clamp(18px,2vw,23px)/1.9 'Tiro Devanagari Hindi','Mukta',serif; white-space:pre-line; overflow-wrap:anywhere; text-align:center; }
.verse-transliteration { margin:11px auto 0; color:#8d7652; font:italic 12px/1.65 Georgia,'Mukta',serif; text-align:center; white-space:pre-line; overflow-wrap:anywhere; }
.verse-word-meanings { margin:12px 0 0; padding:10px 12px; border-left:2px solid #c09b5c; color:#675940; background:#d9c7a22e; font:500 11px/1.7 'Mukta',sans-serif; white-space:pre-line; }
.gita-page footer { position:absolute; right:30px; bottom:17px; left:30px; z-index:1; display:flex; align-items:center; justify-content:space-between; padding-top:7px; border-top:1px solid #a7875340; color:#9a8155; font:700 10px/1.3 'Outfit',sans-serif; }
.page-lotus { font:14px/1 Georgia,serif; }
.gita-flip-layer { position:absolute; inset:0; z-index:3; pointer-events:none; perspective:1600px; }
.gita-page-turn { position:absolute; inset:0; overflow:hidden; border-radius:0 5px 5px 0; transform-style:preserve-3d; transform-origin:left center; backface-visibility:hidden; background:var(--paper); box-shadow:3px 0 18px #0003; }
.gita-page-turn .gita-page { height:100%; }
.gita-page-turn.is-forward { animation:gitaFlipForward .68s cubic-bezier(.45,.03,.37,.99) both; }
.gita-page-turn.is-backward { transform-origin:right center; animation:gitaFlipBackward .68s cubic-bezier(.45,.03,.37,.99) both; }
@keyframes gitaFlipForward { 0%{transform:rotateY(0);filter:brightness(1)} 45%{filter:brightness(.88)} 100%{transform:rotateY(-180deg);filter:brightness(.76)} }
@keyframes gitaFlipBackward { 0%{transform:rotateY(0);filter:brightness(1)} 45%{filter:brightness(.88)} 100%{transform:rotateY(180deg);filter:brightness(.76)} }
.reader-pagination { display:grid; grid-template-columns:1fr minmax(110px,.75fr) 1fr; align-items:center; gap:12px; padding:15px 2px 5px; }
.reader-pagination button { display:inline-flex; align-items:center; justify-self:start; gap:8px; min-height:42px; padding:0 14px; border:1px solid #64748b55; border-radius:13px; color:#e8d5a1; background:#101725; font:700 12px/1.2 'Mukta',sans-serif; cursor:pointer; }
.reader-pagination button:last-child { justify-self:end; color:#14120d; border-color:#e8c86e; background:linear-gradient(135deg,#f3d77c,#c99b43); }
.reader-pagination button:disabled { opacity:.4; cursor:not-allowed; }
.page-progress { display:grid; gap:7px; color:#b2bac4; text-align:center; font:700 10px/1.2 'Outfit','Mukta',sans-serif; }
.page-progress-track { height:3px; overflow:hidden; border-radius:9px; background:#344054; }
.page-progress-track i { display:block; width:0; height:100%; border-radius:9px; background:linear-gradient(90deg,#c1913c,#f5d782); transition:width .35s ease; }
.reader-integrity-note { display:flex; align-items:flex-start; gap:8px; margin:13px 2px 0; color:#a3acb9; font:500 11px/1.65 'Mukta',sans-serif; }
.reader-integrity-note>span:first-child { color:#e3bf68; }
.granth-load-status { min-height:0; color:#f1c572; font:600 13px/1.7 'Mukta',sans-serif; }
.granth-load-status:empty { display:none; }
.granth-load-status.is-error { padding:16px; border:1px solid #fb718544; border-radius:15px; color:#fecdd3; background:#4c152022; }
.granth-load-status.is-loading { padding:15px; border:1px solid #e3bf6844; border-radius:15px; background:#4c381822; }
.granth-more-reading { padding:20px; border:1px solid #64748b30; border-radius:23px; background:linear-gradient(145deg,#111827,#0b1120); }
.granth-more-heading { display:flex; align-items:end; justify-content:space-between; gap:14px; margin-bottom:13px; }
.granth-more-heading h3 { margin:5px 0 0; color:#f5ead0; font:800 21px/1.3 'Tiro Devanagari Hindi','Mukta',serif; }
.granth-more-heading p { margin:0; color:#9ca8b7; font:500 11px/1.6 'Mukta',sans-serif; }
.other-granth-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:9px; }
.other-granth-card { display:grid; grid-template-columns:auto minmax(0,1fr); gap:9px; align-items:center; min-width:0; padding:12px; border:1px solid #8c744233; border-radius:15px; color:#eee5d1; text-align:left; background:#151a25; cursor:pointer; transition:border-color .18s,transform .18s,background .18s; }
.other-granth-card:hover { transform:translateY(-2px); border-color:#d6b35d88; background:#1d2230; }
.other-granth-card .other-book-icon { font-size:22px; }
.other-granth-card strong { display:block; overflow:hidden; color:#f0dfb2; font:800 12px/1.4 'Mukta',sans-serif; text-overflow:ellipsis; white-space:nowrap; }
.other-granth-card small { display:block; margin-top:2px; color:#9aa5b3; font:600 9px/1.4 'Mukta',sans-serif; }
@media(max-width:760px) {
  .ag-language-picker button { padding:0 7px; }
  .granth-catalog { grid-template-columns:1fr; }
  .granth-source-note { order:2; }
  .granth-more-reading { padding:15px; }
  .granth-more-heading { display:block; }
  .granth-more-heading p { margin-top:5px; }
  .other-granth-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .gita-book-wrap { grid-template-columns:minmax(0,1fr); min-height:440px; padding:9px; }
  .gita-book-spine,.gita-side-page { display:none; }
  .gita-page-stage { min-height:420px; }
  .gita-page { min-height:420px; border-radius:5px; }
  .gita-page-turn { border-radius:5px; }
  #gitaPageContent { max-height:340px; }
  .gita-page footer { right:24px; left:24px; }
}
@media(max-width:520px) {
  .granth-hero { min-height:unset; padding:22px 19px; border-radius:22px; }
  .granth-hero p { font-size:12px; }
  .granth-seal { width:60px; height:60px; margin-right:-5px; }
  .granth-seal:before { inset:5px; }
  .granth-seal:after { inset:-4px; }
  .granth-seal span { font-size:21px; }
  .granth-seal small { font-size:8px; }
  .granth-book-card { grid-template-columns:minmax(105px,.68fr) minmax(0,1.32fr); gap:14px; padding:12px; border-radius:21px; }
  .granth-cover-art { min-height:210px; padding:13px 9px; }
  .cover-om { font-size:28px; }
  .cover-title { font-size:14px; }
  .cover-subtitle { font-size:10px; }
  .cover-mark { font-size:8px; }
  .granth-card-copy h3 { font-size:20px; }
  .granth-card-copy>p { font-size:11px; }
  .granth-card-meta { gap:6px 10px; margin:11px 0 13px; font-size:10px; }
  .granth-primary-button { min-height:40px; padding:0 12px; font-size:12px; }
  .other-granth-card { gap:6px; padding:9px 7px; }
  .other-granth-card .other-book-icon { font-size:18px; }
  .other-granth-card strong { font-size:10px; }
  .other-granth-card small { font-size:8px; }
  .gita-reader { padding:10px; border-radius:19px; }
  .reader-toolbar { grid-template-columns:auto 1fr auto; gap:5px; padding-bottom:11px; }
  .reader-toolbar button { min-height:35px; padding:0 8px; font-size:10px; }
  .reader-toolbar-title { font-size:12px; }
  .reader-kicker { font-size:8px; }
  .reader-controls { gap:7px; }
  .reader-controls select { min-width:130px; max-width:calc(100vw - 155px); }
  .reader-controls input { min-width:68px; width:72px; }
  .font-controls { margin-left:auto; }
  .font-controls button { min-width:36px; height:38px; }
  .gita-book-wrap { min-height:390px; padding:7px; border-radius:12px; }
  .gita-page-stage,.gita-page { min-height:376px; }
  .gita-page { padding:25px 21px 44px; }
  #gitaPageContent { max-height:300px; }
  .verse-block { padding-bottom:14px; }
  .verse-block+.verse-block { padding-top:12px; }
  .verse-ref { margin-bottom:8px; font-size:9px; }
  .verse-text { font-size:18px; line-height:1.85; }
  .verse-transliteration { font-size:10px; line-height:1.55; }
  .verse-word-meanings { font-size:10px; }
  .reader-pagination { grid-template-columns:auto minmax(50px,1fr) auto; gap:7px; }
  .reader-pagination button { min-height:39px; gap:5px; padding:0 9px; font-size:10px; }
  .page-progress { font-size:9px; }
  .reader-integrity-note { font-size:10px; }
}
@media(prefers-reduced-motion:reduce) {
  .ag-language-picker button,.granth-primary-button,.page-progress-track i { transition:none; }
  .gita-page-turn.is-forward,.gita-page-turn.is-backward { animation:none; opacity:0; }
}
