/* Rich text editor used by the mail templates and the one-off send form. */

.rte {
    margin-bottom: 1rem;
}

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    padding: .35rem .4rem;
    border: 1px solid #ced4da;
    border-bottom: 0;
    border-radius: .375rem .375rem 0 0;
    background: #f8f9fa;
}

.rte-group {
    display: flex;
    align-items: center;
    gap: .15rem;
    padding-right: .35rem;
    border-right: 1px solid #dee2e6;
}

.rte-group:last-child,
.rte-group-end {
    border-right: 0;
}

.rte-group-end {
    margin-left: auto;
}

.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .4rem;
    border: 1px solid transparent;
    border-radius: .25rem;
    background: transparent;
    color: #343a40;
    font-size: .95rem;
    line-height: 1;
}

.rte-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.rte-btn.is-active {
    background: #dbe4ff;
    border-color: #b6c6ff;
    color: #1c3faa;
}

.rte-btn-wide {
    font-size: .8rem;
    padding: 0 .55rem;
}

/* A struck-through link icon stands in for "remove link"; Bootstrap Icons has no glyph for it. */
.rte-strike {
    position: relative;
}

.rte-strike::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    border-top: 1.5px solid currentColor;
    transform: rotate(-20deg);
}

.rte-select {
    height: 2rem;
    max-width: 9rem;
    padding: 0 .4rem;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    background: #fff;
    font-size: .8rem;
}

.rte-select-sm {
    max-width: 6.5rem;
}

.rte-color {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 2rem;
    height: 2rem;
    border-radius: .25rem;
    cursor: pointer;
}

.rte-color:hover {
    background: #e9ecef;
}

.rte-color input[type="color"] {
    position: absolute;
    inset: auto 0 .1rem 0;
    width: 100%;
    height: .45rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.rte-surface,
.rte-source {
    border: 1px solid #ced4da;
    border-radius: 0 0 .375rem .375rem;
    background: #fff;
}

.rte-surface {
    padding: .85rem 1rem;
    overflow-y: auto;
    max-height: 60vh;
    color: #212529;
    line-height: 1.5;
}

.rte-surface:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .2);
}

.rte-surface img {
    max-width: 100%;
    height: auto;
}

.rte-surface blockquote {
    margin: 0 0 1rem;
    padding-left: .9rem;
    border-left: 3px solid #c8a24a;
    color: #555;
}

.rte-surface table {
    border-collapse: collapse;
}

.rte-surface:empty::before {
    content: attr(data-placeholder);
    color: #adb5bd;
}

.rte-source {
    font-family: Consolas, Menlo, monospace;
    font-size: .85rem;
    border-radius: 0 0 .375rem .375rem;
}

.rte-prompt {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem;
    border-left: 1px solid #ced4da;
    border-right: 1px solid #ced4da;
    background: #eef2f7;
}

.rte-prompt-label {
    font-size: .8rem;
    color: #495057;
    white-space: nowrap;
}

.rte-footer {
    display: flex;
    justify-content: space-between;
    padding-top: .3rem;
}

.rte-hint {
    font-size: .75rem;
    color: #6c757d;
}

.rte-placeholder-menu {
    max-height: 60vh;
    overflow-y: auto;
    min-width: 20rem;
}

.rte-placeholder {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
}

.rte-placeholder code {
    color: #b3591b;
}

.rte-placeholder-desc {
    font-size: .75rem;
    color: #6c757d;
}

.rte-preview-frame {
    display: block;
    width: 100%;
    height: 65vh;
    border: 0;
    background: #f2f2f2;
}
