// Fonts
$Helvetica: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
$Consolas: Consolas, Menlo, "Courier New", monospace;

// Mixins
@mixin border-radius($radius: 5px) {
    -webkit-background-clip: padding-box;
    -webkit-border-radius: $radius;
    -moz-background-clip: padding-box;
    -moz-border-radius: $radius;
    border-radius: $radius;
    background-clip: padding-box;
}
@mixin box-shadow($horizontal: 0px, $vertical: 1px, $blur: 2px, $color: #CCC) {
  -webkit-box-shadow: $horizontal $vertical $blur $color;
  -moz-box-shadow: $horizontal $vertical $blur $color;
  box-shadow: $horizontal $vertical $blur $color;
}
@mixin inset-box-shadow($horizontal: 0px, $vertical: 1px, $blur: 2px, $color: #CCC) {
  -webkit-box-shadow: inset $horizontal $vertical $blur $color;
  -moz-box-shadow: inset $horizontal $vertical $blur $color;
  box-shadow: inset $horizontal $vertical $blur $color;
}
@mixin multi-color-border($top, $sides, $bottom) {
    border-top: 1px solid $top;
    border-left: 1px solid $sides;
    border-right: 1px solid $sides;
    border-bottom: 1px solid $bottom;
}
@mixin multi-border-radius($topLeft: 5px, $topRight: 5px, $bottomRight: 5px, $bottomLeft: 5px) {
    -webkit-border-top-left-radius: $topLeft;
    -webkit-border-top-right-radius: $topRight;
    -webkit-border-bottom-right-radius: $bottomRight;
    -webkit-border-bottom-left-radius: $bottomLeft;
    -moz-border-radius-topleft: $topLeft;
    -moz-border-radius-topright: $topRight;
    -moz-border-radius-bottomright: $bottomRight;
    -moz-border-radius-bottomleft: $bottomLeft;
    border-top-left-radius: $topLeft;
    border-top-right-radius: $topRight;
    border-bottom-right-radius: $bottomRight;
    border-bottom-left-radius: $bottomLeft;
}
@mixin vertical-gradient($start: #000, $stop: #FFF) { background: ($start);
    background: -webkit-gradient(linear, left top, left bottom, from($start), to($stop));
    background: -moz-linear-gradient(center top, $start 0%, $stop 100%);
    background: -moz-gradient(center top, $start 0%, $stop 100%);
}
@mixin vertical-gradient-with-image($image, $start: #000, $stop: #FFF) {
    background: ($start + $stop) / 2 $image;
    background: $image, -webkit-gradient(linear, left top, left bottom, from($start), to($stop));
    background: $image, -moz-linear-gradient(center top, $start 0%, $stop 100%);
    background: $image, -moz-gradient(center top, $start 0%, $stop 100%);
}
@mixin opacity($op) {
    -khtml-opacity: $op;
    -moz-opacity: $op;
    opacity: $op;
}

// Page
html, body {
    background: #FFF;
}
body {
    color: #666;
    font: normal 14px/16px $Helvetica;
    text-rendering: optimizeLegibility;
}
* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

// Utils
.group:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}
.hidden {
    display: none;
}

// Global
div.frame {
    margin: 0 auto;
    position: relative;
    width: 980px;

    div.ruler {
        background: #EAEAEA;
        height: 100%;
        position: fixed;
        top: 0;
        width: 1px;
        z-index: 49;
    }
    div.left-y {
        margin-left: 40px;
    }
    div.right-y {
        margin-left: 760px;
    }
}
header.main {
    padding: 20px 0 55px 0;
    position: relative;
    z-index: 50;

    a.logo {
        display: inline-block;

        span.avatar {
            background: white;
            display: inline-block;
            height: 80px;
            width: 80px;
            @include border-radius(80px);
            -webkit-box-shadow: 0 0 0px 1px white, 0 0 10px 0px rgba(0, 0, 0, .6);
            -moz-box-shadow: 0 0 0px 1px white, 0 0 10px 0px rgba(0, 0, 0, .6);
            box-shadow: 0 0 0px 1px white, 0 0 10px 0px rgba(0, 0, 0, .6);
            -webkit-transition: box-shadow .05s linear;
            -moz-transition: box-shadow .05s linear;
            -o-transition: box-shadow .05s linear;
            transition: box-shadow .05s linear;
        }
        &:hover {
            span.avatar {
                -webkit-box-shadow: 0 0 0px 1px white, 0 0 15px 0px rgba(0, 0, 0, 1);
                -moz-box-shadow: 0 0 0px 1px white, 0 0 15px 0px rgba(0, 0, 0, 1);
                box-shadow: 0 0 0px 1px white, 0 0 15px 0px rgba(0, 0, 0, 1);
            }
        }
    }
    div.bio {
        display: inline-block;
        margin: 9px 0 0 12px;
        vertical-align: top;

        a.name {
            color: #666;
            font: 500 18px $Helvetica;
            text-decoration: none;
            -webkit-transition: color .05s linear;
            -moz-transition: color .05s linear;
            -o-transition: color .05s linear;
            transition: color .05s linear;

            &:hover {
                color: black;
            }
        }
        p {
            color: #B7B7B7;
            font: 500 12px $Helvetica;
            line-height: 18px;
            margin: 0;
            max-width: 340px;

            a {
                color: #B7B7B7;
                font-weight: bold;
                text-decoration: underline;
                -webkit-transition: color .05s linear;
                -moz-transition: color .05s linear;
                -o-transition: color .05s linear;
                transition: color .05s linear;

                &:hover {
                    color: #666;
                }
            }
            &:first-of-type {
                margin-top: 1px;
            }
        }
    }
}
section.main {
    section.content {
        float: left;
        width: 760px;

        div.gutter {
            float: left;
            width: 80px;
        }
        div.content-inner {
            float: right;
            margin-left: 16px;
            margin-right: 55px;
            width: 609px;
        }
    }
    aside.main {
        float: right;
        padding-left: 20px;
        width: 220px;

        h1, h2 {
            color: #666;
            font: bold 12px $Helvetica;
            margin-bottom: 10px;

            &:first-of-type {
                margin-top: 3px;
            }
        }
        p {
            color: #999;
            font: normal 12px $Helvetica;
            line-height: 18px;
            margin-bottom: 20px;
        }
        ul {
            margin-bottom: 20px;
            margin-left: 0;

            li {
                list-style-type: none;
                margin: 0;

                a {
                    color: #999;
                    display: block;
                    font: normal 12px $Helvetica;
                    line-height: 18px;
                    max-width: 220px;
                    overflow: hidden;
                    text-decoration: none;
                    text-overflow: ellipsis;
                    white-space: nowrap;

                    &:before {
                        background: #EEE;
                        content: "";
                        display: inline-block;
                        margin-right: 10px;
                        height: 9px;
                        width: 9px;
                        @include border-radius;
                    }
                    &:hover {
                        color: #666;

                        &:before {
                            background: #CCC;
                        }
                    }
                    &.more {
                        font-size: 10px;
                        margin-left: 19px;
                        margin-top: 5px;

                        &:after {
                            content: " »";
                        }
                        &:before {
                            display: none;
                        }
                    }
                }
            }
        }
    }
}
div.pagination {
    clear: left;
    margin-bottom: 55px;
    margin-left: 40px;
    text-align: center;

    a {
        color: #666;
    }
}
article {
    margin: 40px 0;

    div.gutter {
        a {
            time {
                background: #FFF;
                border: 1px solid #EAEAEA;
                display: block;
                height: auto;
                margin-top: -14px;
                position: relative;
                width: auto;
                z-index: 51;
                @include border-radius(3px);

                span {
                    display: block;
                    text-align: center;

                    &.id {
                        background: #F9F9F9;
                        border-bottom: 1px solid #EAEAEA;
                        color: #CCC;
                        font: normal 11px $Helvetica;
                        padding: 2px 0;
                    }
                    &.mon-day {
                        color: #999;
                        font: normal 17px $Helvetica;
                        letter-spacing: -1px;
                        padding-top: 10px;
                        text-transform: uppercase;
                    }
                    &.year {
                        color: #999;
                        font: normal 12px $Helvetica;
                        letter-spacing: -1px;
                        padding-bottom: 10px;
                        text-transform: uppercase;
                    }
                }
                &:after {
                    background: transparent url('/static/images/date-arrow.gif') top left no-repeat;
                    content: "";
                    display: block;
                    height: 11px;
                    position: absolute;
                    right: -6px;
                    top: 22px;
                    width: 6px;
                }
            }
            &:hover {
                text-decoration: none;
            }
        }
    }
    h1 {
        margin-bottom: 20px;
        margin-top: 0;

        a {
            color: #666;
            display: block;
            font: 500 20px/26px $Helvetica;
            text-decoration: none;
            -webkit-transition: color .05s linear;
            -moz-transition: color .05s linear;
            -o-transition: color .05s linear;
            transition: color .05s linear;

            &:hover {
                color: #000;
                text-decoration: none;
            }
        }
    }
    div.post-content {
        color: #666;
        font: normal 14px/22px $Helvetica;
        max-height: 150px;
        position: relative;
        overflow: hidden;

        p {
            margin: 20px 0;

            &:first-child {
                margin-top: 0;
            }
            &:last-child {
                margin-bottom: 0;
            }
        }
        a {
            color: #666;

            &:hover {
                color: #000;
            }
        }
        li {
            line-height: 20px;
            margin: 10px 0;

            p:first-of-type {
                margin-bottom: 0;
            }
        }
        table.highlighttable {
            height: 100%;
        }
        td {
            padding: 0;
            vertical-align: top;

            &.linenos {
                display: none;
            }
        }
        div.highlight, div.markdown {
            pre {
                background: #F7F7F7;
                border: 1px solid #EAEAEA;
                font: normal 12px/16px $Consolas;
                margin: 0;
                overflow-x: auto;
                padding: 10px;
                white-space: pre;
                word-wrap: normal;
                width: 609px;
                @include border-radius(5px);

                &::-webkit-scrollbar {
                    background: #F7F7F7;
                    height: 16px;
                    width: 16px;
                    -webkit-appearance: none;
                    @include border-radius(5px);
                }
                &::-webkit-scrollbar-thumb {
                    border: 4px solid #F7F7F7;
                    border-radius: 16px;
                    background-color: #C7C7C7;
                }
            }
        }
        div.markdown {
            h4 {
                border-top: 1px dashed #CCC;
                margin-bottom: 30px;
                padding-top: 30px;
                position: relative;

                a {
                    color: #0088CC;
                    text-decoration: none;
                }
                &:before {
                    background: #0088CC;
                    border: 4px solid #EAEAEA;
                    content: "";
                    display: block;
                    height: 20px;
                    left: -70px;
                    position: absolute;
                    top: 27px;
                    width: 20px;
                    z-index: 51;
                    @include border-radius(20px);
                }
            }
            p {
                strong {
                    font-weight: bold;
                }
            }
            a {
                text-decoration: underline;
            }
            pre {
                margin: 20px 0;

                &:first-child {
                    margin-top: 0;
                }
                &:last-child {
                    margin-bottom: 0;
                }
            }
            ul {
                margin-bottom: 20px;
            }
            img {
                border: 1px solid #D7D7D7;
                margin-bottom: 10px;
                @include border-radius(3px);
                @include box-shadow(0, 1px, 10px, #D7D7D7);
            }
        }
        &:after {
            bottom: 0;
            content: "";
            height: 60px;
            left: 0;
            position: absolute;
            width: 100%;
            @include vertical-gradient(rgba(255, 255, 255, 0), white);
        }
    }
    &:first-of-type {
        margin-top: 0;
    }
    &.detail {
        div.post-content {
            overflow: visible;
            max-height: none;

            &:after {
                display: none;
            }
        }
    }
}
div#disqus_thread {
    margin-top: 20px;

    * {
        -moz-box-sizing: content-box;
        -webkit-box-sizing: content-box;
        box-sizing: content-box;
    }
    #dsq-content {
        #dsq-sort-by {
            display: none;
        }
        .dsq-comment-text {
            color: #666;
        }
        h3 {
            display: none;
        }
        .dsq-textarea-wrapper {
            overflow: hidden;
        }
    }
    #dsq-footer {
        display: none;
    }
    button.dsq-button {
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }
}
