/* Editor de emails. Segue as variáveis do Bootstrap para acompanhar o tema. */

.editor {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
  background: var(--bs-body-bg);
}

.editor-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  position: sticky;
  top: 0;
  z-index: 3;
}

.editor-botao {
  border: 0;
  background: transparent;
  color: var(--bs-body-color);
  border-radius: var(--bs-border-radius-sm);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.editor-botao:hover,
.editor-botao:focus-visible {
  background: var(--bs-secondary-bg);
}

.editor-separador {
  width: 1px;
  height: 1.25rem;
  margin: 0 .25rem;
  background: var(--bs-border-color);
}

.editor-variaveis {
  margin-left: auto;
  width: auto;
  max-width: 12rem;
}

.editor-area {
  min-height: 20rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  outline: none;
  font-size: .95rem;
  line-height: 1.55;
}

.editor-area:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--bs-primary-rgb), .25);
}

.editor-area img {
  max-width: 100%;
  height: auto;
}

.editor-area p { margin: 0 0 .85em; }
.editor-area h2 { font-size: 1.35rem; margin: 0 0 .6em; }
.editor-area h3 { font-size: 1.15rem; margin: 0 0 .6em; }

.editor-area:empty::before,
.editor-area > p:only-child:empty::before {
  content: attr(data-vazio);
  color: var(--bs-secondary-color);
}

.editor-fonte {
  border: 0;
  border-radius: 0;
  font-family: var(--bs-font-monospace);
  font-size: .82rem;
  min-height: 20rem;
}

/* Pré-visualização: caixa branca fixa, para o email se ver como o
   destinatário o vai ver e não como o tema escuro do CRM o pinta. */
.previsualizacao {
  background: #ffffff;
  color: #212529;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 1.25rem;
  max-height: 32rem;
  overflow-y: auto;
}

.previsualizacao img { max-width: 100%; height: auto; }
.previsualizacao a { color: #0d6efd; }

.previsualizacao-cabecalho {
  border-bottom: 1px solid #dee2e6;
  padding-bottom: .6rem;
  margin-bottom: .9rem;
  font-size: .85rem;
  color: #6c757d;
}
