/* Divya Granth 3D layer: real depth for covers, cards, open books and controls.
   Loaded after each page's own CSS; it only adds depth (transforms, layered
   shadows, light) and never changes layout or scripture text. Everything is
   disabled for prefers-reduced-motion users except static shading. */
:root{--dg3d-ease:cubic-bezier(.2,.8,.2,1)}

/* ---------- Home: hardcover books with thickness and a spine ---------- */
.dg3d .oldBookCard{overflow:visible!important}
.dg3d .oldCover{position:relative;transform-style:preserve-3d;transform-origin:left center;
 transform:perspective(800px) rotateY(-18deg) rotateX(4deg);transition:transform .6s var(--dg3d-ease),box-shadow .6s var(--dg3d-ease);
 /* page block: alternating cream/shadow edges, then the cast shadow */
 box-shadow:inset 0 0 0 3px #714528,inset 0 0 0 6px #bd965c,inset 7px 0 6px -3px #0006,
  1px 1px 0 #f6ead0,2px 2px 0 #d5bf93,3px 3px 0 #f6ead0,4px 4px 0 #cfb788,5px 5px 0 #f3e5c6,6px 6px 0 #c8ae7e,7px 7px 0 #efe0bd,
  16px 20px 26px -4px #0009!important}
/* glossy light sweeping across the cloth */
.dg3d .oldCover>span:first-child{filter:drop-shadow(0 3px 2px #0006)}
.dg3d .oldCover b,.dg3d .oldCover em{text-shadow:0 1px 0 #0008,0 -1px 0 #fff3}
.dg3d .oldBookCard:hover .oldCover,.dg3d .oldBookCard.dg3d-active .oldCover,.dg3d .oldCover:focus-visible{
 transform:perspective(800px) rotateY(-6deg) rotateX(2deg) translateZ(22px)}

/* ---------- Tilting cards with moving light ---------- */
.dg3d-tilt{position:relative;transform-style:flat;will-change:transform;
 transform:perspective(1000px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(var(--lift,0px)) scale(var(--sc,1))!important;
 transition:transform .55s var(--dg3d-ease),box-shadow .4s var(--dg3d-ease)!important}
.dg3d-tilt.dg3d-active{--lift:-4px;transition:transform .09s linear,box-shadow .3s!important}
.dg3d-tilt.dg3d-press{--sc:.985}
.dg3d .oldBookCard.dg3d-active{box-shadow:0 26px 40px -8px #020f0b80,inset 0 1px 0 #fff5e2!important}
.dg3d .categoryReady.dg3d-active{box-shadow:0 22px 34px -10px #000a!important}
.dg3d-shine{position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:4;opacity:0;transition:opacity .35s;
 background:radial-gradient(circle at var(--mx,50%) var(--my,0%),#ffffff55 0,#ffffff12 28%,#fff0 55%);mix-blend-mode:soft-light}
.dg3d-active>.dg3d-shine{opacity:1}
.dg3d .categoryReady{box-shadow:0 2px 0 #0000001f,0 10px 22px -10px #0008,inset 0 1px 0 #fff8}

/* ---------- Scroll-in: cards rise out of the page ---------- */
.dg3d-reveal{opacity:0;transform:perspective(1000px) rotateX(16deg) translateY(28px)!important}
.dg3d-reveal.dg3d-in{opacity:1;transform:perspective(1000px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(var(--lift,0px)) scale(var(--sc,1))!important;
 transition:opacity .7s var(--dg3d-ease),transform .8s var(--dg3d-ease)!important}

/* ---------- Dedication frame: carved, layered depth ---------- */
.dg3d .familyDedication img{box-shadow:0 1px 0 #fff4 inset,0 0 0 4px #b98d4c,0 0 0 7px #6b4a24,0 18px 30px -6px #000b!important}

/* ---------- Open books: page block, gutter curve, lying on a table ---------- */
/* No transform here: a 3D-transformed ancestor stops Android Chrome from repainting
   the scrolling page text until it is tapped. Depth comes from the layered edges. */
.dg3d .dg-physical-book,.dg3d .openBook{
 box-shadow:0 1px 0 #efe2c4,0 2px 0 #cdb88f,0 3px 0 #efe2c4,0 4px 0 #c5ae82,0 5px 0 #ebdcba,0 6px 0 #bea578,
  0 7px 0 #e6d6b2,0 8px 0 #7a5734,0 26px 44px -10px #000c,0 0 0 8px #c9a7732e!important}
.dg3d .book>.page:first-of-type,.dg3d .openBook .leftPaper{box-shadow:inset -26px 0 26px -20px #3a24145e,inset 0 0 40px #8a6a3a14}
.dg3d .book>.page:last-of-type,.dg3d .openBook .rightPaper{box-shadow:inset 26px 0 26px -20px #3a24145e,inset 0 0 40px #8a6a3a14}
/* page flips get a real shadow under the turning sheet */
.dg3d .dg-flip-sheet{filter:drop-shadow(0 10px 14px #0005)}

/* ---------- Player bar: raised, tactile controls ---------- */
.dg3d .dg-player{box-shadow:0 -1px 0 #ffffff14 inset,0 -14px 34px #0008}
.dg3d .dg-pbtn{background:linear-gradient(180deg,#ffffff0d,#ffffff03);box-shadow:inset 0 1px 0 #ffffff14,0 2px 0 #00000040}
.dg3d .dg-pbtn:active{transform:translateY(2px) scale(.95);box-shadow:inset 0 2px 4px #0006}
.dg3d .dg-play{box-shadow:0 8px 0 -2px #8a6630,0 14px 24px #000a,inset 0 2px 0 #fff9,inset 0 -6px 10px #a77c3d88,0 0 0 4px #e8c88d22}
.dg3d .dg-play:active{transform:translateY(4px) scale(.96);box-shadow:0 3px 0 -1px #8a6630,0 6px 12px #0009,inset 0 2px 0 #fff9,inset 0 -4px 8px #a77c3d88}
.dg3d .dg-sheet-card{box-shadow:0 -30px 60px #000c,inset 0 1px 0 #ffffff22}
.dg3d .dg-seg button[aria-checked="true"]{box-shadow:0 4px 0 #8a6630,0 8px 16px -4px #0008,inset 0 1px 0 #fff8}
.dg3d .dg-seg button:active{transform:translateY(2px)}

/* ---------- Buttons on the home page and in the book pages ---------- */
.dg3d .goldBtn,.dg3d .dgBellButton{box-shadow:0 4px 0 #8f6a33,0 10px 18px -6px #000a,inset 0 1px 0 #fff9!important;transition:transform .12s,box-shadow .12s}
.dg3d .goldBtn:active,.dg3d .dgBellButton:active{transform:translateY(3px);box-shadow:0 1px 0 #8f6a33,0 4px 8px -4px #000a,inset 0 1px 0 #fff9!important}
.dg3d .hc-play,.dg3d .oldPagePlay,.dg3d [id$="LeftPlay"],.dg3d [id$="RightPlay"],.dg3d #rPlayLeft,.dg3d #rPlayRight,.dg3d #hiPlay,.dg3d #enPlay,.dg3d #playOriginal,.dg3d #playMeaning,.dg3d #leftPlay,.dg3d #rightPlay{
 box-shadow:0 3px 0 #0f3324,0 6px 10px -2px #0007,inset 0 1px 0 #ffffff40}

@media (prefers-reduced-motion:reduce){
 .dg3d-tilt,.dg3d-reveal,.dg3d-reveal.dg3d-in{transition:none!important}
 .dg3d-reveal{opacity:1;transform:none!important}
 .dg3d .oldCover{transition:none}
}
.dg3d .oldBookDescription{position:relative;z-index:2}
