/* Book text: Arabic naskh at a generous measure and leading. */

.prose {
  position: relative; /* containing block for page-marker notes */
  font-size: calc(var(--step-1) * var(--reading-scale));
  line-height: var(--leading-body);
  color: var(--color-ink);
  hanging-punctuation: first;
}
/* Label for page markers; book.js overrides it from the i18n string. */
:root:lang(ar) .prose {
  --page-marker-prefix: 'ص ';
}

.prose > * + * {
  margin-block-start: 1em;
}

.prose h2 {
  margin-block: 1.8em 0.6em;
  color: var(--color-accent);
  font-size: 1.45em;
}
.prose h3 {
  margin-block: 1.5em 0.4em;
  font-size: 1.2em;
  color: var(--color-ink);
}
.prose > :first-child,
.prose > .page-marker:first-child + * {
  margin-block-start: 0;
}

.prose strong {
  font-weight: var(--weight-bold);
}
.prose em {
  font-style: normal;
  color: var(--color-accent);
}

.prose ol,
.prose ul {
  padding-inline-start: 1.6em;
}
.prose li + li {
  margin-block-start: 0.35em;
}
.prose ol {
  list-style: arabic-indic;
}
.prose li::marker {
  color: var(--color-gold);
}

/* ---- Block verse: framed like a cartouche, Quranic face, centred ---- */
.prose .verse {
  margin-block: 1.6em;
  padding: 1em 1.25em 0.75em;
  background: var(--color-verse-bg);
  border-block: var(--border-hair) solid var(--color-gold-soft);
  border-radius: var(--radius-sm);
  text-align: center;
}
.verse-text {
  display: block;
  color: var(--color-verse-ink);
  font-family: var(--font-quran);
  font-size: 1.2em;
  line-height: 2.2;
}
.verse:not(.verse--bracketed) .verse-text::before {
  content: '﴿';
  margin-inline-end: 0.25em;
  color: var(--color-gold);
}
.verse:not(.verse--bracketed) .verse-text::after {
  content: '﴾';
  margin-inline-start: 0.25em;
  color: var(--color-gold);
}
.verse-ref {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-style: normal;
}
.verse .verse-ref {
  display: block;
  margin-block-start: 0.25em;
}
.verse .verse-ref::before {
  content: '[';
}
.verse .verse-ref::after {
  content: ']';
}

/* ---- Inline verse ---- */
.verse-inline {
  font-family: var(--font-quran);
  color: var(--color-verse-ink);
  quotes: '﴿' '﴾';
}
.verse-inline::before,
.verse-inline::after {
  color: var(--color-gold);
}
.verse-inline + .verse-ref::before {
  content: '[';
}
.verse-inline + .verse-ref::after {
  content: ']';
}

/* ---- Hadith and notes ---- */
.prose .hadith {
  padding: 0.75em 1.1em;
  background: var(--color-hadith-bg);
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
}
.prose .note {
  padding-block-start: 0.6em;
  border-block-start: var(--border-hair) dashed var(--color-rule-strong);
  color: var(--color-note-ink);
  font-size: 0.85em;
}

/* ---- Figures and definition lists (about page) ---- */
.prose figure {
  margin-block: 1.6em;
}
.prose figcaption {
  margin-block-start: 0.4em;
  color: var(--color-muted);
  font-size: 0.8em;
  text-align: center;
}
.prose dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25em 1.25em;
}
.prose dt {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.75em;
  line-height: 2.4;
}
.prose dd {
  margin: 0;
}

/* ---- Page markers: "ص N" in the inline-end gutter ---- */
.page-marker {
  scroll-margin-block-start: calc(var(--header-height) + var(--space-6));
}
/* data-page = PDF page (anchors, reader links); data-printed = the book's own number. */
.page-marker[data-printed]::before {
  content: var(--page-marker-prefix, '') attr(data-printed);
  position: absolute;
  inset-inline-start: calc(100% + var(--space-5));
  padding-inline: var(--space-2);
  border-inline-start: 2px solid var(--color-gold);
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 2.4;
  white-space: nowrap;
}
/* No gutter on narrow screens: show the note in the flow instead. */
@media (max-width: 72em) {
  .page-marker::before {
    position: static;
    display: inline-block;
    margin-inline-end: 0.5em;
    line-height: var(--leading-ui);
  }
}

.prose__empty {
  color: var(--color-muted);
}

/* Verse text injected from content/quran/resolved.json (server/lib/quran.js). */
.ayah-end {
  color: var(--color-gold);
  font-size: 0.85em;
}
.verse-inline.is-missing {
  quotes: none;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}

/* ---- Classes seen in the extracted content beyond the contract ---- */
.prose .calligraphy {
  margin-block: 1.2em;
  color: var(--color-accent);
  font-family: var(--font-quran);
  font-size: 1.35em;
  text-align: center;
}
.prose .lead {
  font-size: 1.08em;
  color: var(--color-ink-soft);
}
.prose .plain-list {
  list-style: none;
  padding-inline-start: 0;
}
.prose .sources {
  color: var(--color-note-ink);
  font-size: 0.85em;
}
