/*
 * EasyMDE ships its own typography; pin the parts that clash with the site
 * font size and form element spacing.
 */
.EasyMDEContainer {
    margin-bottom: 0.75rem;
}

.EasyMDEContainer .CodeMirror {
    border-color: var(--light-grey);
    border-radius: 3px;
    font-family: var(--main-font);
    font-size: var(--font-size);
    resize: vertical;
    overflow: hidden;
    transition: border-color 0.2s ease-in-out;
}

.EasyMDEContainer .editor-toolbar {
    border-color: var(--light-grey);
    border-radius: 3px 3px 0 0;
}

.EasyMDEContainer .CodeMirror-focused {
    border-color: var(--focus-color);
}

.EasyMDEContainer .editor-statusbar .help {
    float: left;
    margin-left: 0;
    min-width: 0;
}

/*
 * Side-by-side stays in the page (sideBySideFullscreen: false). Width is 90vw;
 * editor.js shifts `left` so the box is centered in the viewport.
 */
.EasyMDEContainer.sided--no-fullscreen {
    width: 90vw;
    max-width: 90vw;
    position: relative;
    z-index: 2;
    background: #fff;
}

.EasyMDEContainer.sided--no-fullscreen .editor-preview-active-side {
    align-self: stretch;
}

/* Preview still goes fullscreen; EasyMDE uses ::after only for a gradient fade. */
.editor-toolbar.fullscreen::after {
    content: "Press Esc to exit";
    width: auto;
    padding-right: 10px;
    background: #fff;
    color: var(--muted-color);
    line-height: 50px;
}

/* Undo site button styles inside the markdown toolbar. */
.editor-toolbar button {
    width: auto;
    min-width: 30px;
    height: 30px;
    margin: 0;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    box-shadow: none;
    color: inherit;
    font-size: inherit;
    line-height: 1;
}

.editor-toolbar button:hover,
.editor-toolbar button.active {
    background: #fcfcfc;
    border-color: #95a5a6;
}

.EasyMDEContainer .editor-preview {
    font-family: var(--main-font);
}

/* EasyMDE defaults are huge (h1 ~200%); keep edit-mode headers modest. */
.cm-s-easymde .cm-header-1 { font-size: 1.35em; }
.cm-s-easymde .cm-header-2 { font-size: 1.25em; }
.cm-s-easymde .cm-header-3 { font-size: 1.15em; }
.cm-s-easymde .cm-header-4,
.cm-s-easymde .cm-header-5,
.cm-s-easymde .cm-header-6 { font-size: 1.05em; }

.cm-s-easymde .cm-header-1,
.cm-s-easymde .cm-header-2,
.cm-s-easymde .cm-header-3,
.cm-s-easymde .cm-header-4,
.cm-s-easymde .cm-header-5,
.cm-s-easymde .cm-header-6 {
    line-height: 1.3;
}
