/* Rich text (content written in TinyMCE): used inside the editor (content_css, body.rich-text) and on the
   public pages (<div class="rich-text">), so what the board sees is what visitors see. */
.rich-text { color: #4D4D4D; font-size: 17px; line-height: 1.75; }
.rich-text > :first-child { margin-top: 0; }
.rich-text h2, .rich-text h3, .rich-text h4 { color: #10223F; line-height: 1.3; margin: 1.6em 0 .6em; }
.rich-text h2 { font-size: 1.6em; }
.rich-text h3 { font-size: 1.3em; }
.rich-text h4 { font-size: 1.1em; }
.rich-text p { margin: 0 0 1.1em; }
.rich-text a { color: #0B76A8; text-decoration: underline; text-underline-offset: 3px; }

/* Lists: clear markers, comfortable spacing, nested levels */
.rich-text ul, .rich-text ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.rich-text li { margin: .35em 0; padding-left: .3em; }
.rich-text ul { list-style: none; padding-left: 1.4em; }
.rich-text ul > li { position: relative; }
.rich-text ul > li::before { content: ""; position: absolute; left: -1.05em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: #FF1E02; }
.rich-text ul ul > li::before { background: transparent; border: 2px solid #FF1E02; }
.rich-text ol > li::marker { color: #0B76A8; font-weight: 700; }

/* Quotes */
.rich-text blockquote { margin: 1.6em 0; padding: 1.1em 1.4em 1.1em 1.6em; border-left: 4px solid #FFC84D; background: #FFF4DB; border-radius: 0 12px 12px 0; font-size: 1.08em; font-style: italic; color: #10223F; }
.rich-text blockquote p:last-child { margin-bottom: 0; }

/* Tables: header row, borders, optional stripes (class table-striped), scroll on small screens */
.rich-text table { width: 100%; margin: 1.5em 0; border-collapse: separate; border-spacing: 0; border: 1px solid #E7E9EC; border-radius: 12px; overflow: hidden; font-size: .95em; display: block; overflow-x: auto; }
.rich-text table > * { display: table; width: 100%; }
.rich-text th, .rich-text td { padding: .75em 1em; border-bottom: 1px solid #E7E9EC; text-align: left; vertical-align: top; }
.rich-text thead th, .rich-text tr:first-child > th { background: #095E86; color: #fff; font-weight: 600; }
.rich-text tr:last-child > td { border-bottom: 0; }
.rich-text table.table-striped tbody tr:nth-child(even) td { background: #F5F6F7; }
.rich-text caption { caption-side: bottom; padding-top: .6em; font-size: .9em; color: #4D4D4D; }

/* Images and YouTube videos */
.rich-text img { max-width: 100%; height: auto; border-radius: 12px; }
.rich-text figure { margin: 1.6em 0; }
.rich-text figure.image { display: table; margin-left: auto; margin-right: auto; }
.rich-text figcaption { display: table-caption; caption-side: bottom; padding-top: .5em; font-size: .9em; color: #4D4D4D; text-align: center; }
.rich-text .align-left { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.rich-text .align-right { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.rich-text .align-center { display: block; margin-left: auto; margin-right: auto; }
.rich-text iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 1.6em 0; border: 0; border-radius: 12px; }
.rich-text hr { margin: 2em 0; border: 0; border-top: 2px solid #E7E9EC; }
.rich-text::after { content: ""; display: table; clear: both; }

@media (max-width: 575.98px) {
    .rich-text { font-size: 16px; }
    .rich-text .align-left, .rich-text .align-right { float: none; max-width: 100%; margin: 1em 0; }
}

/* Dark mode of the site (moon button); the editor never has this attribute */
[data-bs-theme=dark] .rich-text { color: #CACACA; }
[data-bs-theme=dark] .rich-text h2, [data-bs-theme=dark] .rich-text h3, [data-bs-theme=dark] .rich-text h4 { color: #FFFFFF; }
[data-bs-theme=dark] .rich-text a, [data-bs-theme=dark] .rich-text ol > li::marker { color: #7FCDEE; }
[data-bs-theme=dark] .rich-text ul > li::before { background: #FF1E02; }
[data-bs-theme=dark] .rich-text ul ul > li::before { background: transparent; border-color: #FF1E02; }
[data-bs-theme=dark] .rich-text blockquote { background: #494130; color: #FFFFFF; }
[data-bs-theme=dark] .rich-text table, [data-bs-theme=dark] .rich-text th, [data-bs-theme=dark] .rich-text td, [data-bs-theme=dark] .rich-text hr { border-color: #5A5A5A; }
[data-bs-theme=dark] .rich-text th { background: #1F1F1F; color: #FFFFFF; }
[data-bs-theme=dark] .rich-text table.table-striped tbody tr:nth-child(even) td { background: #4D4D4D; }
[data-bs-theme=dark] .rich-text caption, [data-bs-theme=dark] .rich-text figcaption { color: #CACACA; }
