/* Описание намаза Пророка — book styles */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #f7f4ee;
  color: #1c1c1c;
  font-family: 'Tinos', 'Noto Naskh Arabic', 'Times New Roman', 'Traditional Arabic', serif;
  font-size: 1.08rem;
  line-height: 1.62;
}

main, .cover, .toc {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* ---------- cover ---------- */
.cover {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.cover p { margin: .35em 0; }
.cover .t1 { font-size: 1.9rem; font-weight: bold; }
.cover .t2 { font-size: 1.45rem; font-weight: bold; }
.cover .t3 { font-size: 1.15rem; }
.cover .t4 { font-size: .98rem; color: #444; font-style: italic; }

/* ---------- headings ---------- */
h2, h3 {
  font-family: 'Tinos', 'Times New Roman', serif;
  line-height: 1.3;
  color: #101010;
  text-align: left;
}
h2 { font-size: 1.5rem; margin: 2.4em 0 .9em; }
h3 { font-size: 1.2rem;  margin: 1.9em 0 .7em; }

/* ---------- body text ---------- */
main p {
  margin: 0;
  text-indent: 1.3em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
main p.first,
main p.item,
main p.ayah,
main p.fn { text-indent: 0; }
main p + h2, main p + h3 { text-indent: 0; }
main p.item { margin-left: 1.3em; }
main p.quote { font-style: italic; }

/* ---------- ayah ---------- */
main p.ayah {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: center;
  font-family: 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  font-size: 1.5rem;
  line-height: 2;
  margin: 1.1em 0;
  color: #14251c;
}

/* ---------- footnotes ---------- */
main p.fn {
  font-size: .92rem;
  color: #4a4a4a;
  margin-top: .7em;
  padding-top: .5em;
  border-top: 1px solid #d8d2c4;
}

/* ---------- toc ---------- */
.toc { margin-top: 2.5rem; margin-bottom: 2.5rem; }
.toc h2 { margin-top: 0; }
.toc ol, .toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc > ul, .toc > ol {
  padding-left: 0;
}
.toc li { margin: .3em 0; }
.toc li ul, .toc li ol { margin-left: 1.4em; }
.toc li ul a, .toc li ol a { font-size: 1em; }
.toc li.d1 { margin-left: 1.4em; }
.toc li.d2 { margin-left: 2.8em; }
.toc li.d3 { margin-left: 4.2em; }
.toc a {
  color: #1a3f8f;
  text-decoration: none;
  border-bottom: 1px dotted #9db0d8;
}
.toc a:hover { border-bottom-style: solid; }

/* ---------- pandoc-generated structure (markdown.lua -> pandoc) ---------- */
main blockquote.ayah {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: center;
  font-family: 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  font-size: 1.5rem;
  line-height: 2;
  margin: 1.1em 0;
  color: #14251c;
}
main div.quote p {
  font-style: italic;
  text-indent: 0;
  margin: 0;
}
main div.item { margin-left: 1.3em; }
main div.item p { text-indent: 0; }

/* first paragraph after a heading / of a section has no indent */
main section > p:first-child,
main h2 + p, main h3 + p,
main p:first-of-type { text-indent: 0; }

/* footnotes (pandoc renders doc-endnotes at the end of the document) */
a.footnote-ref { color: #1a3f8f; text-decoration: none; }
a.footnote-ref sup { font-size: .75em; }
section.footnotes {
  font-size: .92rem;
  color: #4a4a4a;
  margin-top: 2em;
}
section.footnotes ol { padding-left: 1.4em; }
section.footnotes li { margin: .4em 0; }
a.footnote-back { color: #4a4a4a; text-decoration: none; }

/* leftovers that had no in-text reference */
main div.notes, main div.fn {
  font-size: .92rem;
  color: #4a4a4a;
}
main div.fn {
  margin-top: .7em;
  padding-top: .5em;
  border-top: 1px solid #d8d2c4;
}

/* index (алфавитный указатель): cleaned leader dots + page numbers */
main div.idx {
  font-size: .92rem;
  color: #333;
}
main div.idx ul {
  list-style: none;
  margin: .3em 0;
  padding-left: 0;
}
main div.idx li {
  margin: .2em 0;
  text-indent: 0;
}

/* ---------- links / misc ---------- */
a { color: #1a3f8f; }
main a { text-decoration: none; border-bottom: 1px solid #b9c6e6; }

@media (max-width: 640px) {
  body { font-size: 1.02rem; }
  .cover .t1 { font-size: 1.55rem; }
  .cover .t2 { font-size: 1.25rem; }
  h2 { font-size: 1.32rem; }
  h3 { font-size: 1.12rem; }
}
