/* Classeto 8.45 — article list rhythm and automatic Persian/English direction.
   Scopes: public article body and teacher article editor only. */

/* classeto_article_inline() already generates <br> for newlines. Avoid showing
   the original newline a second time through white-space: pre-wrap. */
html.classeto-public-page .site-article .post-body.cl-article-content {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Keep matching vertical rhythm in the editor and published articles. */
html.classeto-public-page .site-article .cl-article-content > p,
html.classeto-panel-page .cl-article-field .cl-article-editor > :is(p, div) {
  margin-block: 0 10px !important;
  line-height: 2.05 !important;
}
html.classeto-public-page .site-article .cl-article-content > h2,
html.classeto-panel-page .cl-article-field .cl-article-editor > h2 {
  margin-block: 16px 8px !important;
  line-height: 1.85 !important;
}
/* No extra margins created when the browser inserts a p/div inside an LI. */

/* Text in the editor contains raw newlines, whereas published HTML contains
   explicit <br> tags. Each representation gets just one newline visually. */
html.classeto-public-page .site-article .cl-article-content :is(p, h2, li) {
  white-space: normal !important;
}
html.classeto-panel-page .cl-article-field .cl-article-editor :is(p, div, h2, li) {
  white-space: pre-wrap !important;
}

/* dir=auto takes direction from each block's first strong character.
   For English list items both alignment and bullet direction are LTR. */
html.classeto-public-page .site-article .cl-article-content :is(p, h2, li)[dir="auto"],
html.classeto-panel-page .cl-article-field .cl-article-editor :is(p, div, h2, li)[dir="auto"] {
  text-align: start !important;
}
