/* A bound volume; right-to-left reading order is independent of the site's language. */
.mushaf-study {
  position: relative;
  container-type: inline-size;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.mushaf-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1.57;
  perspective: 1200px;
  perspective-origin: 51% 35%;
  pointer-events: none;
}
.mushaf-transcript {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
}
.mushaf-reader-link {
  position: absolute;
  inset: 1.5% 1.5% 0;
  border-radius: 4%;
  color: var(--folio-accent);
  touch-action: manipulation;
}
.mushaf-ground {
  position: absolute;
  inset: 28% 0 -3% 0;
  border-radius: 48%;
  background: radial-gradient(ellipse at center, #040b19b8 0, #040d2082 39%, transparent 71%);
  transform: rotate(-5deg);
}
.mushaf-volume {
  position: absolute;
  top: 49%;
  left: 4%;
  width: 93%;
  height: 88%;
  transform: translateY(-50%) rotateX(15deg) rotateZ(-5.5deg);
  transform-style: preserve-3d;
}
.mushaf-cover-board {
  position: absolute;
  inset: 0;
  border: 1px solid #588494;
  border-radius: 2.3% 2.5% 2.1% 2.2%;
  background:
    repeating-linear-gradient(37deg, #ffffff0b 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-37deg, #0b1a2c48 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #244a63, #17415c 44%, #11283d 49%, #3b5d71 51%, #24475f 58%, #31546d);
  box-shadow: 0 2px 0 #648190, 0 5px 0 #19334b, 0 7px 0 #081726, 0 16px 16px -8px #050b16a6, 0 31px 26px -12px #040b186e;
}
.mushaf-cover-board::after {
  content: "";
  position: absolute;
  inset: 1.55% .95%;
  border: 1px solid #ae9664;
  border-radius: 1.9%;
}
.mushaf-ribbon {
  position: absolute;
  top: 84%;
  left: 48.1%;
  width: 2.4%;
  height: 22%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 49% 82%, 0 100%);
  transform: rotate(7deg);
  background: linear-gradient(90deg, #786130, #d4b66d 27%, #b2914e 62%, #776035);
}
.mushaf-edges {
  position: absolute;
  top: 1.7%;
  bottom: 2.5%;
  width: 47.8%;
  border: 1px solid #b3a17a;
  background: repeating-linear-gradient(0deg, #c8bb96 0 1px, #e4d9b9 1px 2px, #b4a687 2px 3px);
  box-shadow: 0 2px 2px #13243585;
}
.mushaf-edges-left { left: 1.9%; border-radius: 2% .4% 3% 2%; transform: rotate(.7deg); }
.mushaf-edges-right { right: 1.9%; border-radius: .4% 2% 2% 3%; transform: rotate(-.7deg); }
.mushaf-open {
  position: absolute;
  inset: 1.25% 2.65% 4.15%;
  transform: translateZ(3px);
  transform-style: preserve-3d;
}
.mushaf-page {
  --paper-shade: linear-gradient(90deg, #eee8d7 0%, #f4efdf 50%, #eee8d7 86%, #c0b69d 100%);
  position: absolute;
  top: 0;
  height: 100%;
  border: 1px solid #b2a68b;
  background-image: var(--paper-shade);
}
.mushaf-page::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: .11;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='144' height='144'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23837567' filter='url(%23f)' opacity='.76' d='M0 0h144v144H0z'/%3E%3C/svg%3E");
}
.mushaf-fixed { width: 50%; }
.mushaf-fixed.mushaf-left { transform-origin: right center; transform: rotateY(3deg); }
.mushaf-fixed.mushaf-right { transform-origin: left center; transform: rotateY(-3deg); }
.mushaf-left, .mushaf-front { left: 0; border-radius: 1.3% .5% .7% 1.8%; }
.mushaf-right, .mushaf-back {
  right: 0;
  border-radius: .5% 1.3% 1.8% .7%;
  --paper-shade: linear-gradient(90deg, #ada18a 0%, #ded5bd 4%, #f2ecdc 12%, #f6f0df 43%, #e9dfc8 100%);
}
.mushaf-frame {
  position: absolute;
  inset: 6.25% 6.4%;
  border: 1px solid #9d8758;
  outline: 1px solid #c5b792;
  outline-offset: 2px;
}
.mushaf-frame::before {
  content: "";
  position: absolute;
  inset: 1% 1.05%;
  border: 1px solid #a8a181;
}
.mushaf-typeset {
  position: absolute;
  inset: 4% 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #263642;
  font-family: "VQ Reading", "Traditional Arabic", Georgia, serif;
  font-weight: 400;
  text-align: center;
}
.mushaf-typeset p {
  width: 100%;
  margin: 4.5% 0;
  color: inherit;
  font: inherit;
  font-size: 3.25cqw;
  line-height: 1.73;
  text-wrap: pretty;
}
.mushaf-study[data-motion="scroll"] .mushaf-typeset p { font-size: 4.15cqw; }
.mushaf-line { display: inline; }
.mushaf-ending { white-space: nowrap; }
.mushaf-line i {
  display: inline-grid;
  place-content: center;
  width: 1.1em;
  height: 1.1em;
  margin-inline: .24em .1em;
  border: 1px solid #958054;
  border-radius: 40% 47%;
  color: #76613b;
  font-size: .56em;
  font-style: normal;
  line-height: 1;
  vertical-align: .13em;
}
.mushaf-headpiece {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 106%;
  aspect-ratio: 5.76;
  margin-block-end: 3%;
  background: url("/assets/mushaf-headpiece.svg") center / 100% 100% no-repeat;
}
.mushaf-headpiece span { font-size: 2.8cqw; line-height: 1.1; }
.mushaf-fleur, .mushaf-tailpiece {
  width: 1.13cqw;
  height: 1.13cqw;
  border: 1px solid #927a51;
  background: #c6b88c;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.mushaf-tailpiece { width: .67cqw; height: .67cqw; background: #9e8b61; }
.mushaf-turning-leaf {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  display: none;
  transform-origin: right center;
  transform-style: preserve-3d;
  transform: translateZ(1.6px) rotateY(var(--mushaf-angle, 0deg));
}
.mushaf-turning-leaf .mushaf-page {
  width: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mushaf-turning-leaf .mushaf-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #62554324, transparent 27%, #fff8dc45 60%, #74685125);
  opacity: var(--mushaf-lift, 0);
}
.mushaf-front { transform: rotateY(0deg) translateZ(.6px); }
.mushaf-back { transform: rotateY(180deg) translateZ(.6px); }
/* WebKit can composite positioned descendants of an edge-on face separately. */
.mushaf-study[data-facing="front"] .mushaf-back,
.mushaf-study[data-facing="back"] .mushaf-front,
.mushaf-study[data-facing="edge"] .mushaf-turning-leaf .mushaf-typeset { display: none; }
.mushaf-leaf-shadow {
  display: none;
  position: absolute;
  pointer-events: none;
  inset: 0;
  transform: translateZ(.4px);
  background: linear-gradient(90deg, transparent 12%, #34312333 34%, #4033208a 49%, #332b1b52 57%, transparent 76%);
  opacity: var(--mushaf-lift, 0);
}
.mushaf-study[data-motion="scroll"] :is(.mushaf-turning-leaf, .mushaf-leaf-shadow) { display: block; }
.mushaf-study[data-motion="scroll"] .mushaf-static-only { display: none; }

@media (min-width:1800px) { .mushaf-stage { perspective:1600px; } }
@media (max-width:680px) {
  .mushaf-stage { aspect-ratio:1.5; perspective:780px; }
  .mushaf-volume { width:94%; left:3%; }
}
