/* ── Lesson rich text (admin editor + learner view) ── */
.crs-rich { line-height: 1.95; font-size: 1.05em; color: inherit; overflow-wrap: anywhere; }
.crs-rich > *:first-child { margin-top: 0; }
.crs-rich h2 { font-size: 1.55em; font-weight: 800; margin: 1.4em 0 .55em; line-height: 1.4; }
.crs-rich h3 { font-size: 1.25em; font-weight: 800; margin: 1.2em 0 .45em; line-height: 1.45; }
.crs-rich h4 { font-size: 1.08em; font-weight: 800; margin: 1em 0 .4em; }
.crs-rich p { margin: 0 0 .9em; }
.crs-rich ul, .crs-rich ol { margin: 0 0 1em; padding-inline-start: 1.6em; }
.crs-rich ul { list-style: disc; }
.crs-rich ol { list-style: decimal; }
.crs-rich li { margin: .25em 0; }
.crs-rich a { color: #7c3aed; text-decoration: underline; text-underline-offset: 3px; }
.crs-rich blockquote { margin: 1em 0; padding: .75em 1.1em; border-inline-start: 4px solid #a78bfa; background: rgba(124,58,237,.06); border-radius: .5rem; }
.crs-rich pre { direction: ltr; text-align: left; background: #0f172a; color: #e2e8f0; padding: 1em 1.1em; border-radius: .6rem; overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; line-height: 1.6; white-space: pre-wrap; margin: 0 0 1em; }
.crs-rich code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.crs-rich img { max-width: 100%; height: auto; border-radius: .6rem; margin: .6em 0; display: block; }
.crs-rich hr { border: 0; border-top: 1px solid rgba(100,116,139,.3); margin: 1.6em 0; }
.crs-rich table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: .95em; display: block; overflow-x: auto; }
.crs-rich th, .crs-rich td { border: 1px solid rgba(100,116,139,.35); padding: .5em .7em; min-width: 80px; vertical-align: top; }
.crs-rich th { background: rgba(124,58,237,.08); font-weight: 800; }

/* ── Lesson media block (learner view + preview) ── */
.crs-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; margin: 0 0 1.4rem; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.crs-video iframe, .crs-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.crs-attachments { margin-top: 1.8rem; border-top: 1px solid rgba(100,116,139,.2); padding-top: 1.1rem; }
.crs-attachments h4 { font-size: 1rem; font-weight: 800; margin: 0 0 .7rem; }
.crs-attachments ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.crs-attachments a { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; border: 1px solid rgba(100,116,139,.25); border-radius: .7rem; text-decoration: none; color: inherit; font-weight: 600; transition: background .15s, border-color .15s; }
.crs-attachments a:hover { background: rgba(124,58,237,.06); border-color: #a78bfa; }

/* ── Admin rich-text editor ── */
.crs-ed { border: 1px solid #d8dee9; border-radius: 14px; background: #fff; overflow: hidden; }
.crs-ed__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 2; }
.crs-ed__bar button { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 700; color: #334155; cursor: pointer; line-height: 1; }
.crs-ed__bar button:hover { background: #ede9fe; color: #6d28d9; }
.crs-ed__bar button.on { background: #6d28d9; color: #fff; }
.crs-ed__sep { width: 1px; background: #e2e8f0; margin: 4px 3px; }
.crs-ed__area { min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 18px 20px; outline: none; font-size: 16px; color: #0f172a; }
.crs-ed__area:empty::before { content: 'اكتب شرح الدرس هنا...'; color: #94a3b8; }
.crs-ed__src { width: 100%; min-height: 320px; border: 0; padding: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: #0f172a; color: #e2e8f0; resize: vertical; outline: none; }
.crs-ed__status { font-size: 13px; color: #6d28d9; padding: 0 12px; }
.crs-ed__status:not(:empty) { padding: 6px 12px; border-top: 1px solid #f1f5f9; }
