@import "~trix/dist/trix.css";

.ea-text-editor-wrapper {
    background: var(--form-control-bg);
    border: 1px solid var(--form-input-border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--form-input-shadow);
    padding: 7px;
}
.ea-text-editor-wrapper:focus,
.ea-text-editor-wrapper:focus-within {
    border-color: var(--form-input-hover-border-color);
    box-shadow: var(--form-input-hover-shadow);
    outline: 0;
}
trix-toolbar {
    background: var(--form-type-text-editor-toolbar-bg);
    border-block-end: 1px solid var(--form-input-border-color);
    border-start-start-radius: var(--border-radius);
    border-start-end-radius: var(--border-radius);
    margin: -7px -7px 10px;
    padding: 0;
}
trix-toolbar .trix-button-row {
    border-start-start-radius: var(--border-radius);
    border-start-end-radius: var(--border-radius);
}
trix-toolbar .trix-button-group {
    border: 0;
    margin-block-end: 0;
}
trix-toolbar .trix-button {
    border: 0;
    color: var(--form-type-text-editor-toolbar-button-color);
    margin: 0;
}
trix-toolbar .trix-button:not(:first-child) {
    border-inline-start: 0;
}
trix-toolbar .trix-button:hover {
    background: var(--form-type-text-editor-toolbar-button-hover-color);
}
trix-toolbar .trix-button.trix-active {
    background: var(--form-type-text-editor-toolbar-button-active-bg);
    color: var(--form-type-text-editor-toolbar-button-active-color);
}
trix-toolbar .trix-button.trix-button--icon {
    block-size: 32px;
    inline-size: 32px;
}
trix-toolbar .trix-button.trix-button--icon::before {
    background-size: 22px;
    background-position: center;
    float: left;
    block-size: 32px;
    inline-size: 32px;
    text-indent: -999em;
}
.ea-dark-scheme trix-toolbar .trix-button.trix-button--icon::before {
    filter: invert(1);
}
trix-editor {
    border: 0;
    padding: 3px;
}

trix-toolbar .trix-dialog {
    background: var(--form-type-text-editor-dialog-bg);
    box-shadow: var(--form-type-text-editor-dialog-box-shadow);
    border: 0;
    font-size: 12px;
}

trix-toolbar .trix-dialog .trix-input {
    background: var(--form-control-bg);
}

.trix-content pre {
    background-color: var(--form-type-text-editor-content-pre-bg);
    border-radius: var(--border-radius);
    color: var(--form-type-text-editor-content-pre-color);
    font-family: var(--font-family-monospace);
}

/* there's no way to disable buttons from the Trix toolbar except by hiding them via CSS
   see https://github.com/basecamp/trix/issues/402 */
trix-toolbar .trix-button-group--file-tools,
trix-toolbar .trix-button-group--history-tools {
    display: none;
}
@media (min-width: 1200px) {
    trix-toolbar .trix-button-group--history-tools {
        display: flex;
    }
}
