/* Organizer-written Markdown (tournament descriptions, payment instructions). */
.rich-text {
    font-family: 'Outfit', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: color-mix(in oklab, var(--color-base-content) 85%, transparent);
    overflow-wrap: anywhere;
}
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p { margin: 0 0 0.75em; }
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 {
    font-family: 'Outfit', 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-base-content);
    margin: 1.25em 0 0.5em;
}
.rich-text h1 { font-size: 1.35em; }
.rich-text h2 { font-size: 1.2em; }
.rich-text h3, .rich-text h4 { font-size: 1.05em; }
.rich-text ul, .rich-text ol { margin: 0 0 0.75em; padding-inline-start: 1.4em; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin: 0.2em 0; }
.rich-text li::marker { color: var(--color-primary); }
.rich-text strong { font-weight: 600; color: var(--color-base-content); }
.rich-text a { color: var(--color-primary); text-decoration: underline; }
.rich-text hr { border: 0; border-top: 1px solid var(--color-base-300); margin: 1.25em 0; }
.rich-text blockquote {
    margin: 0 0 0.75em;
    padding: 0.5em 0.9em;
    border-inline-start: 3px solid var(--color-warning);
    background: color-mix(in oklab, var(--color-warning) 12%, transparent);
    border-radius: 0.25rem;
}
.rich-text blockquote p:last-child { margin-bottom: 0; }
.rich-text table { border-collapse: collapse; margin: 0 0 0.75em; }
.rich-text th, .rich-text td { border: 1px solid var(--color-base-300); padding: 0.3em 0.6em; text-align: start; }
.rich-text [dir="rtl"], .rich-text :lang(ar) { font-family: 'IBM Plex Sans Arabic', 'Outfit', sans-serif; }

/* Compact preview (tournament list cards) */
.rich-text-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rich-text-preview h1, .rich-text-preview h2, .rich-text-preview h3, .rich-text-preview h4 { font-size: 1em; margin: 0; }

/* WYSIWYG editor (Toast UI) on the tournament forms */
.markdown-editor { margin-top: 0.25rem; }
.markdown-editor .toastui-editor-defaultUI { border-radius: var(--radius-field, 0.5rem); border-color: var(--color-base-300); }
.markdown-editor .toastui-editor-contents,
.markdown-editor .toastui-editor-contents p {
    font-family: 'Outfit', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    font-size: 15px;
}
/* Let each paragraph take its own direction while editing (Arabic right-to-left) */
.markdown-editor .toastui-editor-contents :is(p, li, h1, h2, h3, h4, blockquote, td, th) {
    unicode-bidi: plaintext;
    text-align: start;
}
