/* Styling for the <rich-text-editor> web component.
   Self-hosted and served from 'self', so it satisfies the app's strict CSP
   without a nonce. Designed to sit on top of Bootstrap 5 but has no hard
   dependency on it beyond the toolbar button classes supplied in markup. */

rich-text-editor {
    display: block;
}

.rich-text-editor-shell {
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
}

.rich-text-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--bs-border-color, #ced4da);
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.rich-text-editor-btn.active {
    background-color: var(--bs-secondary, #6c757d);
    color: #fff;
    border-color: var(--bs-secondary, #6c757d);
}

.rich-text-editor-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.125rem 0.25rem;
    background: var(--bs-border-color, #ced4da);
}

.rich-text-editor-content {
    min-height: 8rem;
    max-height: 28rem;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    outline: none;
    line-height: 1.5;
}

.rich-text-editor-content:focus {
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* Node theme classes (applied to the editable DOM by Lexical). */
.re-paragraph {
    margin: 0 0 0.5rem;
}

.re-paragraph:last-child {
    margin-bottom: 0;
}

.re-bold {
    font-weight: 700;
}

.re-italic {
    font-style: italic;
}

.re-underline {
    text-decoration: underline;
}

.re-strikethrough {
    text-decoration: line-through;
}

.re-ul {
    margin: 0 0 0.5rem 1.25rem;
    list-style: disc;
}

.re-ol {
    margin: 0 0 0.5rem 1.25rem;
    list-style: decimal;
}

.re-li {
    margin: 0.125rem 0;
}

.re-link {
    color: var(--bs-link-color, #0d6efd);
    text-decoration: underline;
}

.re-quote {
    margin: 0 0 0.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--bs-border-color, #ced4da);
    color: var(--bs-secondary-color, #6c757d);
}
