/* Single editorial pages only. Existing tools and download authorization are untouched. */
@font-face {
  font-family: "Tajawal Editorial";
  src: url("../fonts/Tajawal-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal Editorial";
  src: url("../fonts/Tajawal-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

.ll-single :is(.ll-article-content, .ll-article-lead),
.ldl-reading :is(.ldl-content, .ldl-intro, .ldl-explanation, .ldl-faq),
.lls-reading :is(.lls-content, .lls-intro) {
  font-family: "Tajawal Editorial", Tajawal, Cairo, Tahoma, sans-serif;
  font-weight: 400;
  line-height: 1.88;
  overflow-wrap: anywhere;
}
.ll-single :is(h1, h2, h3, h4, h5, h6),
.ldl-reading :is(h1, h2, h3, h4, h5, h6),
.lls-reading :is(h1, h2, h3, h4, h5, h6) {
  font-family: Cairo, Tahoma, Arial, sans-serif;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ll-single :is(.ll-article-content, .ll-article-lead) :is(p, li),
.ldl-reading :is(.ldl-content, .ldl-explanation, .ldl-faq) :is(p, li),
.lls-reading .lls-content :is(p, li) {
  font-family: inherit;
  line-height: inherit;
}
.ll-single .ll-article-content { line-height: 1.88; padding-top: 16px; }
.ll-single .ll-article-content p { margin-block: 0 0.85em; }
.ll-single .ll-article-content :is(h2, h3, h4) { margin-block: 1.25em 0.5em; line-height: 1.6; }
.ll-single .ll-article-content :is(ul, ol) { margin-block: 0.45em 0.9em; }
.ll-single .ll-article-content li { margin-block: 0 0.25em; }
.ll-single .ll-article-content p:empty { display: none; }
.ll-single .ll-article-content :is(p, figure, .wp-block-file) + :is(.wp-block-file, .ll-article-download) { margin-top: 0.5em; }
.ldl-reading .ldl-content p, .lls-reading .lls-content p { margin-block: 0 0.85em; }
.ldl-reading .ldl-content :is(h2, h3), .lls-reading .lls-content :is(h2, h3) { margin-block: 1.25em 0.5em; }
.ldl-reading .ldl-content p:empty,
.lls-reading .lls-content p:empty { display: none; }

/* Standard WordPress file blocks and explicitly marked download links only. */
.ll-single .ll-article-content .wp-block-file,
.ll-single .ll-article-content .ll-article-download {
  box-sizing: border-box;
  max-width: 100%;
  margin-block: 0.7em 1em;
  padding: 14px;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  background: #fff;
}
/* Standalone links to files become small cards; navigation and tool links remain links. */
.ll-single .ll-article-content p:has(> a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child) {
  padding: 13px;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  background: #fff;
  margin-block: 0.7em 1em;
}
.ll-single .ll-article-content :is(.wp-block-file__button, .ll-article-download__button, a[download], p > a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 8px;
  background: #0f4c81;
  color: #fff;
  font: 700 14px/1.5 Cairo, Tahoma, Arial, sans-serif;
  text-align: center;
  text-decoration: none;
}
.ll-single .ll-article-content :is(.wp-block-file__button, .ll-article-download__button, a[download], p > a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child)::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v10.17l3.59-3.58L18 11l-6 6-6-6 1.41-1.41L11 13.17V3ZM4 18h16v3H4v-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ll-single .ll-article-content :is(.wp-block-file__button, .ll-article-download__button, a[download], p > a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child):hover,
.ll-single .ll-article-content :is(.wp-block-file__button, .ll-article-download__button, a[download], p > a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child):focus-visible { background: #1d6fd6; color: #fff; }
.ldl-reading .ldl-download-actions .ldl-button,
.lls-reading .ldl-download-actions .lls-button { font-family: Cairo, Tahoma, Arial, sans-serif; font-weight: 700; }
/* Older lesson articles contain a direct PDF link with line breaks inside it. */
.lls-reading .lls-content a.lilo-download[href$=".pdf"] {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  margin-block: 0.3em;
  padding: 9px 16px;
  border-radius: 8px;
  background: #0f4c81;
  color: #fff;
  font: 700 14px/1.5 Cairo, Tahoma, Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.lls-reading .lls-content a.lilo-download[href$=".pdf"]::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: none;
  margin-inline-end: 8px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v10.17l3.59-3.58L18 11l-6 6-6-6 1.41-1.41L11 13.17V3ZM4 18h16v3H4v-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.lls-reading .lls-content a.lilo-download[href$=".pdf"] br { display: none; }
.lls-reading .lls-content a.lilo-download[href$=".pdf"]:hover,
.lls-reading .lls-content a.lilo-download[href$=".pdf"]:focus-visible { background: #1d6fd6; color: #fff; }

.ll-single .ll-article-content :is(img, video, iframe, svg),
.ldl-reading .ldl-content :is(img, video, iframe, svg),
.lls-reading .lls-content :is(img, video, iframe, svg) { max-width: 100%; }
.ll-single .ll-article-content :is(table, .wp-block-table),
.ldl-reading .ldl-content :is(table, .wp-block-table),
.lls-reading .lls-content :is(table, .wp-block-table) { display: block; max-width: 100%; overflow-x: auto; }
.ll-single .ll-article-content :is(pre, code),
.ldl-reading .ldl-content :is(pre, code),
.lls-reading .lls-content :is(pre, code) { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .ll-single .ll-article-full { padding: 18px 14px; }
  .ll-single .ll-article-content { font-size: 17px; line-height: 1.82; padding-top: 14px; }
  .ll-single .ll-article-content :is(h2, h3) { line-height: 1.5; }
  .ll-single .ll-article-content .wp-block-file { display: grid; gap: 8px; }
  .ll-single .ll-article-content :is(.wp-block-file__button, .ll-article-download__button, a[download], p > a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child) { width: 100%; }
  .lls-reading .lls-content a.lilo-download[href$=".pdf"] { width: 100%; }
  .ldl-reading :is(.ldl-content, .ldl-explanation, .ldl-faq),
  .lls-reading .lls-content { font-size: 16.5px; line-height: 1.82; }
  .ldl-library.ldl-reading .ldl-downloads, .lls-reading .lls-downloads { margin-block: 16px; }
  body.single-post a.orc-tools-launcher,
  body.single-orc_teacher_doc a.orc-tools-launcher,
  body.single-lls_resource a.orc-tools-launcher {
    left: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    min-height: 40px;
    padding: 6px 9px;
    gap: 5px;
    border-radius: 9px;
  }
  body.single-post .orc-tools-launcher svg,
  body.single-orc_teacher_doc .orc-tools-launcher svg,
  body.single-lls_resource .orc-tools-launcher svg { width: 18px; height: 18px; flex-basis: 18px; }
  body.single-post .orc-tools-launcher strong,
  body.single-orc_teacher_doc .orc-tools-launcher strong,
  body.single-lls_resource .orc-tools-launcher strong { font-size: 11px; }
  body.single-post .orc-tools-launcher small,
  body.single-orc_teacher_doc .orc-tools-launcher small,
  body.single-lls_resource .orc-tools-launcher small { display: none; }
}
[data-ostadi-theme="dark"] .ll-single .ll-article-content :is(.wp-block-file, .ll-article-download, p:has(> a:is([href$=".pdf"], [href$=".doc"], [href$=".docx"], [href$=".zip"], [href$=".rar"]):only-child)) { background: #15273b; border-color: #38516b; }
@media print { .ll-single .orc-tools-launcher, body.single-post .orc-tools-launcher, body.single-orc_teacher_doc .orc-tools-launcher, body.single-lls_resource .orc-tools-launcher { display: none !important; } }
