@charset "UTF-8";

@import "variables";
@import "prefixes";
@import "font-awesome";

@import "editormd.logo";

// github-markdown.css
@import "markdown-theme-github.scss";  

.editormd-preview-container, .editormd-html-preview {
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    padding: 20px;
    overflow: auto;
    width: 100%;
    background-color: #fff;

    blockquote {
        color: $color;
        border-left: 4px solid $borderColor;
        padding-left: 20px;
        margin-left: 0;
        font-size: 14px;
        font-style: italic;
    }

    p code {
        margin-left: 5px;
        margin-right: 4px;
    }
        
    abbr {
        background: #ffffdd;
    }

    hr {
        height: 1px;
        border: none;
        border-top: 1px solid $borderColor;
        background: none;
    }

    code {
        border: 0px solid $borderColor;
        background: #f6f6f6;
        padding: 3px;
        border-radius: 3px;
        font-size: 14px;
    }

    pre {
        border: 0px solid $borderColor;
        background: #f6f6f6;
        padding: 10px;
        @include border-radius(3px);

        code {
            padding: 0;
        }
    }
    
    pre, code, kbd {        
        font-family:  "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
    }

    table thead tr {
        background-color: #F8F8F8;
    }

    .markdown-toc {
    }

    .markdown-toc-list {
    } 
    
    p.editormd-tex {
        text-align: center;
    }
    
    span.editormd-tex {
        margin: 0 5px;
    }
    
    .emoji {
        width: 24px;
        height: 24px;
    }
    
    .katex {
        font-size: 1.4em;
    }

    .sequence-diagram, .flowchart {
        margin: 0 auto;
        text-align: center;
        
        svg {
            margin: 0 auto;
        }

        text {
            font-size  : 15px !important;
            font-family: "YaHei Consolas Hybrid", Consolas, "Microsoft YaHei", "Malgun Gothic", "Segoe UI", Helvetica, Arial !important;
        }
    }
}

//Pretty printing styles. Used with prettify.js.

@import "prettify";

.editormd-preview-container, .editormd-html-preview {
    pre.prettyprint { 
        padding: 10px; 
        border: 1px solid $borderColor; 
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    ol.linenums { 
        color: #999; 
        padding-left: 0; 
    
        li { 
            list-style-type: decimal;
            margin: 0;
            padding: 2px;
        
            code {
                border: none;
                background:none;  
                padding: 0;
            }
        }
    }

    /*

    ol.linenums { 
        color: #999;
        margin-left: 20px;
        padding-left: 0px; 
        counter-reset: item;
        list-style-type: none;

        li:after { 
            content: counter(item) "  "; 
            counter-increment: item;
            position: absolute;
            left: -20px;
            top: 2px;
        }

        li {
            position: relative;
            display: block;
            padding: 0;
            margin: 0;
        
            code {
                border: none;
                background:none;  
                padding: 0;
            }
        }
    }
    */
}    

.editormd-preview-container, .editormd-html-preview {

    .editormd-toc-menu {
        margin: 8px 0 12px 0;
        display: inline-block;

        > .markdown-toc {
            position: relative;
            @include border-radius(4px);
            border: 1px solid #ddd;
            display: inline-block;
            font-size: 1em;

            > ul {
                width : 160%;
                min-width: 180px;
                position: absolute;
                left: -1px;
                top: -2px;
                z-index: 100;
                padding: 0 10px 10px;    
                display: none;
                background: #fff;
                border: 1px solid #ddd;
                @include border-radius(4px);
                @include box-shadow(0 3px 5px rgba(0, 0, 0, 0.2));

                > li ul {
                    width: 100%;
                    min-width: 180px;
                    border: 1px solid #ddd;
                    display: none;
                    background: #fff;
                    @include border-radius(4px);
                }

                > li a {
                    color: #666;
                    padding: 6px 10px;
                    display: block;
                    @include transition(background-color 500ms ease-out);  

                    &:hover {
                        background-color: #f6f6f6;
                    }       
                }
            }

            li {
                position: relative;

                > ul {
                    position: absolute;
                    top: 32px;
                    left: 10%;
                    display: none;
                    @include box-shadow(0 3px 5px rgba(0, 0, 0, 0.2));

                    &:before, &:after {
                        pointer-events: pointer-events;
                        position: absolute;
                        left: 15px;
                        top: -6px;
                        display: block;
                        content: "";
                        width: 0;
                        height: 0;
                        border: 6px solid transparent;
                        border-width: 0 6px 6px; 
                        z-index: 10; 
                    }

                    &:before {
                        border-bottom-color: #ccc; 
                    }

                    &:after {
                        border-bottom-color: #ffffff;  
                        top: -5px;
                    }
                }
            }
        }

        ul {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        h1 {
            font-size: 16px;
            padding: 5px 0 10px 10px;
            line-height: 1;
            border-bottom: 1px solid #eee;

            .fa {
                padding-left: 10px;
            }
        }

        .toc-menu-btn {
            color: #666;
            min-width: 180px;
            padding: 5px 10px;
            border-radius: 4px;
            display: inline-block;
            @include transition(background-color 500ms ease-out);

            &:hover {
                background-color: #f6f6f6;
            }

            .fa {
                float: right;
                padding: 3px 0 0 10px;
                font-size: 1.3em;
            }
        }
    }
}

.markdown-body {
    .editormd-toc-menu {
        ul {
            padding-left: 0; 
        }
    }

    .highlight pre, pre {
      line-height: 1.6;
    }
}

hr.editormd-page-break {
    border: 1px dotted #ccc;
    font-size: 0;
    height: 2px;
}

@media only print {
    hr.editormd-page-break {
        background: none;
        border: none;
        height: 0;
    }
}

.editormd-html-preview {
    textarea {
        display : none;
    }

    hr.editormd-page-break {
        background: none;
        border: none;
        height: 0;
    }
}

.editormd-preview-close-btn {
    color: #fff;
    padding: 4px 6px;
    font-size: 18px;
    @include border-radius(500px);
    display: none;
    background-color: #ccc;
    position: absolute;
    top: 25px;
    right: 35px;
    z-index: 19;
    @include transition(background-color 300ms ease-out);

    &:hover {
        background-color: #999;
    }
}

.editormd-preview-active {
    width: 100%;
    padding: 40px;
}