/**
 * CodeMirror plugin for DokuWiki
 *
 * The rules below override the template styles that would otherwise apply to
 * the editor. CodeMirror's own stylesheets are linked separately, see
 * action.php.
 *
 * @author Albert Gasset <albertgasset@fsfe.org>
 * @license GNU GPL version 2 or later
 */

form#dw__editform .CodeMirror {
    font-size: 14px;
    margin-bottom: 7px;
    border: 1px solid #ccc;
    border-radius: 2px;
    word-wrap: normal;
    text-align: left;
}

form#dw__editform .CodeMirror pre {
    border: none;
    box-shadow: none;
    line-height: 1.25;
    padding-left: 7px;
}

form#dw__editform .CodeMirror-scrollbar-filler {
    background: transparent;
}

.picker, .tools {
    z-index: 1000;
}

div.dokuwiki div#size__ctl {
    width: auto;
}

.cm-settings-button {
    cursor: pointer;
    margin-left: 20px;
}

#size__ctl > .cm-settings-button {
    margin-left: 0;
}

.cm-settings-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    font-size: 1em;
}

.cm-settings-menu .ui-menu {
    z-index: 1001;
    max-height: 400px;
    overflow-x: hidden;
    overflow-y: auto;
}

.cm-settings-menu .ui-menu-item {
    white-space: nowrap;
    padding-right: 20px;
}

.cm-settings-menu .ui-icon {
    margin-top: 0.2em;
    top: 0.05em;
}

.cm-settings-menu .ui-menu-item a {
    cursor: pointer;
}

.cm-underline {
    text-decoration: underline;
}

/*
 * Task lists ("- [ ]" / "- [x]")
 *
 * The Markdown mode tags the brackets as meta (open) or property (done)
 * and leaves the text behind them plain, so open and done items used to
 * look the same in the editor. mdmode.js adds own classes to both, styled
 * here. CodeMirror prefixes every token style with "cm-", so the classes
 * read cm-md-task-*. The specificity beats the theme rules
 * (.cm-s-default .cm-meta) without pinning to one theme. Colors are for
 * the default light theme: done items fade out and get struck through,
 * open items keep full weight.
 */

/* brackets, both states: stand out from the text behind them */
span.cm-md-task-mark {
    font-weight: bold;
}
span.cm-md-task-open.cm-md-task-mark {
    color: #a05000;
}
span.cm-md-task-done.cm-md-task-mark {
    color: #0f6e56;
}

/* text of a done item: faded and struck through */
span.cm-md-task-done:not(.cm-md-task-mark) {
    color: #8a8a8a;
    text-decoration: line-through;
}
