/* =========================================================
   Briavel Institute — rich text content
   Used in three places:
   1. Inside the TinyMCE editor frame (content_css, body.rte-content)
   2. Wherever saved editor HTML is shown (.rte-content) — portal and website
   3. Formulas saved as <span class="math-tex"> (rendered by MathJax)
   ========================================================= */

.rte-content,
body.mce-content-body.rte-content {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #1f3a4a;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Editor frame only */
body.mce-content-body.rte-content {
  margin: 0;
  padding: 14px 18px;
  background: #fff;
}

.rte-content > :first-child { margin-top: 0; }
.rte-content > :last-child { margin-bottom: 0; }

.rte-content p { margin: 0 0 0.9em; }

.rte-content h1, .rte-content h2, .rte-content h3,
.rte-content h4, .rte-content h5, .rte-content h6 {
  font-family: inherit;
  color: #102d3d;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 1.4em 0 0.55em;
}
.rte-content h1 { font-size: 1.75em; }
.rte-content h2 { font-size: 1.45em; }
.rte-content h3 { font-size: 1.22em; }
.rte-content h4 { font-size: 1.08em; }
.rte-content h5, .rte-content h6 { font-size: 1em; }

.rte-content a {
  color: #0290be;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rte-content a:hover { color: #0a6f95; }

.rte-content strong, .rte-content b { font-weight: 700; color: inherit; }

.rte-content ul, .rte-content ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}
.rte-content li { margin: 0.25em 0; }
.rte-content li > ul, .rte-content li > ol { margin: 0.25em 0 0.25em; }
.rte-content ul li::marker { color: #0290be; }
.rte-content ol li::marker { color: #0a6f95; font-weight: 700; }

.rte-content blockquote {
  margin: 1.1em 0;
  padding: 0.8em 1.1em;
  border-left: 4px solid #2bb3b8;
  background: #ecf9fc;
  border-radius: 0 12px 12px 0;
  color: #1f3a4a;
}
.rte-content blockquote p:last-child { margin-bottom: 0; }

.rte-content hr {
  border: 0;
  border-top: 1px solid rgba(16, 45, 61, 0.14);
  margin: 1.6em 0;
}

.rte-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.rte-content figure { margin: 1.2em 0; }
.rte-content figcaption {
  font-size: 0.85em;
  color: #5a6e7a;
  text-align: center;
  margin-top: 0.4em;
}

.rte-content sub, .rte-content sup { font-size: 0.75em; line-height: 0; }

.rte-content code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.9em;
  background: #f3f7f9;
  border: 1px solid rgba(16, 45, 61, 0.08);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}
.rte-content pre {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.88em;
  background: #0d2331;
  color: #e6f3f8;
  border-radius: 12px;
  padding: 1em 1.2em;
  overflow-x: auto;
  margin: 1em 0;
}
.rte-content pre code { background: none; border: 0; padding: 0; color: inherit; }

/* Tables (including Word imports) */
.rte-content table {
  border-collapse: collapse;
  max-width: 100%;
  margin: 1em 0;
  font-size: 0.94em;
}
.rte-content table td,
.rte-content table th {
  padding: 0.5em 0.75em;
  vertical-align: top;
}
.rte-content table.rte-table,
.rte-content table[border="1"] {
  width: 100%;
  border: 1px solid rgba(16, 45, 61, 0.16);
}
.rte-content table.rte-table td,
.rte-content table.rte-table th,
.rte-content table[border="1"] td,
.rte-content table[border="1"] th {
  border: 1px solid rgba(16, 45, 61, 0.16);
}
.rte-content table th,
.rte-content table.rte-table tr:first-child th {
  background: #f6fafc;
  color: #102d3d;
  font-weight: 800;
  text-align: left;
}
/* Wide tables scroll instead of breaking the page on small screens */
@media (max-width: 767.98px) {
  .rte-content table { display: block; overflow-x: auto; }
}

/* Formulas */
.rte-content .math-tex,
.math-tex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}
.rte-content .math-tex mjx-container,
.math-tex mjx-container { margin: 0 !important; }
.rte-content .math-tex mjx-container[display="true"] { display: block; margin: 0.6em 0 !important; }
/* In the editor, formulas are atomic: highlight them so they're easy to click and edit */
body.mce-content-body .math-tex {
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
  background: rgba(2, 144, 190, 0.06);
  outline: 1px dashed rgba(2, 144, 190, 0.3);
}
body.mce-content-body .math-tex:hover { background: rgba(2, 144, 190, 0.12); }
body.mce-content-body .math-tex[data-mce-selected] {
  outline: 2px solid #0290be;
  background: rgba(2, 144, 190, 0.14);
}

/* Editor helpers */
body.mce-content-body table[data-mce-selected] { outline: 2px solid #0290be; }
body.mce-content-body img[data-mce-selected] { outline: 2px solid #0290be; }
body.mce-content-body .mce-item-table,
body.mce-content-body .mce-item-table td,
body.mce-content-body .mce-item-table th {
  border: 1px dashed rgba(16, 45, 61, 0.25);
}
