/**
 * content-styles.css – Gemeinsame Typografie für Editor & Lesson Player
 *
 * Eine Änderung hier wirkt sich auf BEIDE aus:
 *   • Lesson Player:   .lp-desc.rich-content  (app.html)
 *   • Lesson Editor:   #editor.rich-content   (lesson-editor.html)
 */

/* ─── Basis ─────────────────────────────────────────────────── */
.rich-content {
  font-size: 15px;
  line-height: 1.75;
  color: inherit;
  max-width: 100%;
}

/* ─── Absätze ───────────────────────────────────────────────── */
.rich-content p {
  margin: 0 0 14px;
}
.rich-content p:last-child {
  margin-bottom: 0;
}

/* ─── Überschriften ─────────────────────────────────────────── */
.rich-content h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 28px 0 12px;
  line-height: 1.3;
}
.rich-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
  line-height: 1.3;
}
.rich-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 6px;
}
.rich-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 4px;
}
.rich-content h1:first-child,
.rich-content h2:first-child,
.rich-content h3:first-child {
  margin-top: 0;
}

/* ─── Betonung ──────────────────────────────────────────────── */
.rich-content strong,
.rich-content b {
  font-weight: 600;
}
.rich-content em,
.rich-content i {
  font-style: italic;
}
.rich-content u {
  text-decoration: underline;
}

/* ─── Links ─────────────────────────────────────────────────── */
.rich-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rich-content a:hover {
  opacity: 0.8;
}
/* Editor: normale Cursor-Anzeige — Cmd+Klick öffnet den Link (via JS) */
#editor.rich-content a {
  cursor: text;
}
#editor.rich-content a:hover {
  text-decoration-style: dashed;
}

/* ─── Listen ────────────────────────────────────────────────── */
.rich-content ul,
.rich-content ol {
  padding-left: 22px;
  margin: 6px 0 14px;
}
.rich-content li {
  margin-bottom: 6px;
  line-height: 1.65;
}
.rich-content ul li { list-style-type: disc; }
.rich-content ol li { list-style-type: decimal; }
.rich-content ul ul,
.rich-content ol ol,
.rich-content ul ol,
.rich-content ol ul {
  margin: 4px 0 4px;
}

/* ─── Trennlinie ────────────────────────────────────────────── */
.rich-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

/* ─── Bilder ────────────────────────────────────────────────── */
.rich-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 14px 0;
  display: block;
}

/* ─── Button / CTA ──────────────────────────────────────────── */
.rich-content a.content-btn {
  display: inline-block;
  padding: 9px 22px;
  background: #111827;
  color: #fff !important;
  border-radius: 7px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 14px;
  margin: 8px 0;
  transition: opacity 0.15s;
}
.rich-content a.content-btn:hover {
  opacity: 0.85;
}

/* ─── Link-Embed Block ──────────────────────────────────────── */
.rich-content a.link-embed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  background: #f9fafb;
  margin: 6px 0;
  transition: border-color 0.15s;
}
.rich-content a.link-embed::before {
  content: '🔗';
  font-size: 14px;
}
.rich-content a.link-embed:hover {
  border-color: #9ca3af;
}

/* ─── Erwähnung ─────────────────────────────────────────────── */
.rich-content .mention {
  color: #2563eb;
  font-weight: 500;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
}

/* ─── Tabellen ──────────────────────────────────────────────── */
.rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
}
.rich-content th,
.rich-content td {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}
.rich-content th {
  background: #f9fafb;
  font-weight: 600;
  color: #111827;
}
.rich-content tr:nth-child(even) td {
  background: #fafafa;
}
