@red:           #ff0000;
@black:         #000000;
@white:         #ffffff;
@light-grey:    #eeeeee;
@lighter-grey:  #fbfbfb;
@med-grey:      #999999;
@dark-grey:     #4d4d4d;
@blue:          #0e94ec;

@accent:        @blue;

@normal_text_size:     1em;
@normal_text_line-height: 175%;

@button_link_border: 0.1em;
@button_link_size: 1em;

@padding_for_content_part: 2em 1em 2em;

@min-height: 600px;

html {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-y: scroll;
}

body {
    margin: 0;
    padding: 0;
    background-color: @white;
    color: @dark-grey;
    font-family: 'Proxima Nova', 'Open Sans', sans-serif;
    font-size: 1.125em;
    line-height: 100%;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a {
    color: @black;
    text-decoration: none;
    border-bottom: 1px dotted @med-grey;
    &:link {
        color: @dark-grey;
    }
    &:hover {
        color: @accent;
        outline: 0;
    }
    &:active {
        color: @accent;
        outline: 0;
    }
    &:focus {
        outline: thin dotted;
    }
}

.title {
    margin: 2em 0 0;
    padding: 0;
    color: @black;
    a {
        border: none;
    }
}

.background-clip() {
    background-clip: padding-box;
    -moz-background-clip: padding;
    -webkit-background-clip: padding-box;
}

.border-radius (@radius: 5px) {
    border-radius: @radius;
    -moz-border-radius: @radius;
    -webkit-border-radius: @radius;
}

.clearfix {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    //visibility: hidden; // causes problems with Disqus commenting
}

.wrap() {
    text-wrap: wrap;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    word-wrap: break-word;
}

.abbr {
    margin-top: 2em;
    padding: 0;
    text-transform: uppercase;
    font-weight: 300px;
    font-size: 0.75em;
}

section#navbar {
    width: 100%;
    display: none;
    padding-bottom: 1em;
    border-bottom: @light-grey 1px solid;

    h1 {
        margin: 0;
        padding: 1em 0 .5em .5em;
        display: block;
        font-family: 'Proxima Nova', 'Open Sans', sans-serif;
        font-weight: 900;
        font-size: 2em;
        a {
            border: none;
        }
    }

    h2 {
        margin: 0;
        padding: 0 1em 0 1em;
        font-size: 1em;
        font-weight: 300;
    }

    ul {
        margin: 0;
        padding: 1em 0 0 1em;
        zoom: 0.7;
    }

    li {
        margin: 0;
        padding:  .2em .1em;
        display: inline-block;

        a {
            display: block;
            color: @med-grey;
            font-size: @button_link_size;
            line-height: 100%;
            border: @button_link_border solid @light-grey;
            .border-radius(3em);
            padding: 0.4em 1em;
            
            &:hover {
                color: @accent;
                border: @button_link_border solid @accent;
            }
            
        }
    }
}

section#sidebar {
    width: 25%;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    min-height: @min-height;
    z-index: 0;
    position: fixed;

    h1 {
        margin: 0;
        padding: 1em 0 .1em 1em;
        display: block;
        font-family: 'Proxima Nova', 'Open Sans', sans-serif;
        font-weight: 900;
        font-size: 2em;
        line-height: 100%;
        a {
            border: none;
        }
    }

    h2 {
        margin: 0;
        padding: 0 0 0 2em;
        font-size: 1em;
        font-weight: 300;
    }

    ul {
        margin: 0;
        padding: 2.5em 0 0 2em;
    }

    li {
        margin: 0 0 0.3em;
        float:left;
        clear: both;
        display: block;
        
        a {
            color: @med-grey;
            font-size: @button_link_size;
            line-height: 100%;
            border: @button_link_border solid @light-grey;
            .border-radius(3em);
            padding: 0.5em 1em;
            display: block;

            &:hover {
                color: @accent;
                border: @button_link_border solid @accent;
            }
        }
    }

    footer {
        margin: 0;
        padding-left: 1em;
        position: absolute;
        bottom: 1em;

        color: @med-grey;
        font-size: 0.75em;
        font-weight: 300;
    }
}

@media screen and (min-width: 880px) {
    section#posts {
        margin-left:25%;
        min-height: @min-height;
        max-width: 1024px;
        background-color: rgba(255,255,255,.9);
        border-left: @light-grey 1px solid;

        h1 {
            margin: 1.5em 0 0.75em;
        }

        h2.title {
            margin: 3em 0 0.75em 2em;
        }

        article {
            width: 70%;
            padding: 2em 1em 2em 2em;
        }

        a.button_accent {
            margin: 2em;
        }
    }


    section#posts ul.article-list{
        padding: 1em 2.5em 2em 2em;

        li {
            line-height: 2.5em;
            display: block;
        }

        dt {
            display: inline;
            color: @med-grey;
            font-weight: lighter;
            font-size: small;
            vertical-align: top;
        }

        dd {
            display: inline-block;
            margin-left: 1em;
        }

    }
    section#posts dl ol {
        margin: 0 0 0 1em;
    }
}

@media screen and (max-width: 880px) {
    section#sidebar {
        display: none;
    }
    section#navbar {
        display: block;
    }
    section#posts {
        margin-left: 0;
        width: 99%;
        background-color: white;

        article {
            padding: .5em 1em 2em;
        }

        h1 {
            margin: .5em 0 0.75em;
        }

        h2.title { 
            margin: 1em 0 0.25em 1em;
        }

        ul.article-list{
            padding: 1em;
            
            li {
                line-height: 2.5em;
                display: flex;
            }

            dt {
                display: inline;
                color: @med-grey;
                font-weight: lighter;
                font-size: small;
                vertical-align: top;
            }
            
            dd {
                display: inline-block;
                margin-left: 1em;
            }
            
        }
    }
     .entry-content {
         p, ul, ol {
             width: 100%;
         }
     }
     section#posts a.button_accent {
         margin: 2em 1em 2em;
     }
     section#posts dl {
         padding: 0;
     }
     section#posts dl ol {
         margin: 0;
     }
     section#posts dl ol li{
         padding: 0 1em 1em 0;
     }
}

section#posts {
    top: 0;
    float:left;
    height: 100%;
    position: relative;
    z-index: 1;
    line-height: 100%;

    h1 {
        color: @black;
        font-size: 1.65em;
        line-height: 130%;
    }

    h2 {
        color: @black;
        font-size: 1.35em;
        line-height: 110%;
    }
    
    ul, ol {
        margin: 0 0 0 .3em;
        padding: 0;
        list-style-position: outside;
        li {
            margin-left: 1em;
            p {
                margin-top: 0.5em;
                margin-bottom: 0.5em;
            }
        }
    }

    blockquote {
        margin: 0;
        padding: 0 2em 0;
        display: inline-block;
        border-left: 20px solid @accent;
    }

    code {
        margin: 0;
        padding: 2px 4px;
        color: @black;
        background-color: @lighter-grey;
        font-family: 'Inconsolata', monospace, serif;
    }

    pre {
        margin: 0;
        padding: 1em 2em;
        display: inline-block;
        border-left: 10px solid @accent;
        color: @black;
        background-color: @lighter-grey;
        font-family: 'Inconsolata', monospace, serif;
        overflow-x: auto;
    }

    hr {
        color: @light-grey;
        background-color: @light-grey;
        height: 1px;
        width: 100%;
        border: none;
        margin: 1.35em 0;
    }

        footer {
                margin: 0;
                padding: 0;
                border-top: @light-grey 1px solid;
        }

        td.linenos {
                pre {
                        margin: 0;
                        padding: 0 2px;
                        width: 20px;
                        border: none;
                        text-align: right;
                }
        }

        a.button_accent {
                padding: 0.5em 1.15em;
                display: inline-block;
                border: 0.1em solid @accent;
                .border-radius(2em);
                text-transform: uppercase;
                color: @accent;
                font-size: 0.9em;
                font-weight: 400;
                &:link {
                        color: @accent;
                }
                &:hover {
                        color: @white;
                        background-color: @accent;
                        outline: 0;
                }
                &:active {
                        color: @white;
                        background-color: @accent;
                        outline: 0;
                }
        }

        p.paginator {
                margin: 0;
                padding: 0;
                min-height: 122px;
                width: 100%;
                border-top: @light-grey 1px solid;
        }

        article {
                margin: 0;
                position: relative;
                font-size: @normal_text_size;
                line-height: @normal_text_line-height;
                overflow-x: hidden;
                overflow-y: hidden;

                #title{
                        padding: 0;
                        color: @black;
                        a {
                          border: none;
                        }
                }

                #article_meta {
                        margin: 3em 0 0 0;
                        padding: 0;
                        font-size: 0.9em;
                }
        }

        #comments {
                margin: 0;
                padding: @padding_for_content_part;
                position: relative;
                border-top: @light-grey 1px solid;
                font-size: 15px;
                line-height: 25px;
                min-height: 600px; // does not draw left border properly after AJAX load

                h2 {
                        color: @black;
                }

        }

        #disqus_thread {
                width: 100%;
        }

        dl#tag_list {
                        margin: 0;
                        padding: 40px 40px 40px 50px;
                        font-size: 14px;
                        line-height: 18px;
                        ul {
                                margin: 0;
                                padding: 0;
                                li {
                                        margin: 0;
                                        padding: 0;

                                }
                        }
                }


}
