/*
 * EasyMDE ships its own typography; pin the parts that clash with the site
 * font size and with Pico's 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);
}

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

/*
 * Side-by-side and preview go fullscreen and cover the page, submit button
 * included. EasyMDE uses ::after only for a gradient fade, so spend it on the
 * way back out instead.
 */
.editor-toolbar.fullscreen::after {
    content: "Press Esc to exit";
    width: auto;
    padding-right: 10px;
    background: #fff;
    color: var(--muted-color);
    line-height: 50px;
}

/* Pico styles every button; undo that 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;
}
