/******************************************************************************
 * Variables
 *****************************************************************************/

@serif: georgia, serif;
@sans: verdana, sans-serif;
@phpPurple: #8892BF;
@phpPurpleDark: #4F5B93;

/******************************************************************************
 * Basics
 *****************************************************************************/

*{
    box-sizing: border-box;
}

body{
    font-size: 24px;
    line-height: 32px;
    text-rendering: optimizeLegibility;
    word-wrap: break-word;
}

h1, h2, h3, h4{
    font-family: @serif;
}

h1, .alpha{
    position: relative;
    font-size: 48px;
    font-weight: normal;
    line-height: 50px;
    text-align: center;
}

h2, .beta{
    font-size: 32px;
    font-weight: normal;
    line-height: 36px;
}

h3, .gamma{
    font-size: 24px;
    font-weight: bold;
    line-height: 30px;
}

blockquote{
    border-left: 3px solid #CCC;
    padding-left: 20px;
    color: #777;
    font-style: italic;
    word-wrap: break-word;
}

a{
    color: @phpPurpleDark;

    &:hover{
        color: @phpPurple;
    }
}

.back-to-top{
    text-align: center;

    a{
        background: @phpPurpleDark;
        border-radius: 3px;
        display: inline-block;
        height: 40px;
        padding: 0 20px;
        transition: all 0.1s ease;
        color: white;
        font-family: @sans;
        font-size: 13px;
        line-height: 40px;
        text-decoration: none;
        text-transform: uppercase;

        &:hover{
            background: @phpPurple;
        }
    }
}

img{
    max-width: 100%;
}

pre, code{
    color: #444;
    font-family: "Source Code Pro", Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
    font-size: 90%;
}
a{
    pre, code{
        color: inherit;
    }
}

pre{
    background: #f7f7f7;
    border: 1px solid #EEE;
    border-radius: 3px;
    display: block;
    overflow: auto;
    padding: 20px;
    width: 100%;
}

@media (max-width: 767px) {
    body{
        font-size: 18px;
        line-height: 24px;
    }
    h1, .alpha{
        font-size: 36px;
        line-height: 38px;
    }

    h2, .beta{
        font-size: 24px;
        line-height: 28px;
    }

    h3, .gamma{
        font-size: 18px;
        line-height: 23px;
    }

    blockquote{
        margin-left: 0;
    }

    ul, ol{
        padding-left: 1em;
    }

    pre{
        padding: 5px 10px;
        white-space: pre-wrap;
        white-space: -moz-pre-wrap;
        white-space: -pre-wrap;
        white-space: -o-pre-wrap;
        word-wrap: break-word;
    }
}

@media (max-width: 360px) {
    body{
        font-size: 16px;
        line-height: 21px;
    }

    h1, .alpha{
        font-size: 28px;
        line-height: 30px;
    }

    h2, .beta{
        font-size: 20px;
        line-height: 23px;
    }

    h3, .gamma{
        font-size: 16px;
        line-height: 20px;
    }
}

/******************************************************************************
 * Header
 *****************************************************************************/

.site-header{
    padding-top: 40px;
    margin-bottom: 40px;
    text-align: center;

    h1{
        margin: 0;
        font-size: 72px;
        line-height: 60px;

        em{
            display: block;
            font-size: 34px;
            font-style: normal;
        }

        a{
            color: #333;
            text-decoration: none;

            &:hover{
                color: @phpPurple;
            }
        }
    }

    .build-date{
        margin-bottom: 10px;
        color: #999;
        font-family: @sans;
        font-size: 11px;
        text-transform: uppercase;
    }

    .btn-share{
        background: @phpPurple;
        border-radius: 3px;
        display: inline-block;
        height: 30px;
        padding: 0 20px;
        vertical-align: baseline;
        color: white;
        font-family: @sans;
        font-size: 12px;
        line-height: 30px;
        text-decoration: none;
        text-transform: uppercase;
    }

    .fork-me{
        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAACVCAMAAABmfEh9AAAAMFBMVEXr6+wSFiH////U1NT09PSRk5hucHb5+flMT1f8/Py+v8EtMDpXWWE8P0hgY2rg4OD5mIG8AAAFoElEQVR4AbSb0W4sKQxEyxfMdAyG///b1bCt3MSZ1CKth4coj0fVVp0GevDnc318POqj9cvlv1efl9taC6j18fj4+JO7AlWtrY9LDtblboVg5VKh9XkdpTUIVjIVsJqcPUSSVi7VowJ4pjWOHuKViUWodljlcOR9XN1KCVhpVOERPrHGOBz5gJVJFcN6Yp2NfHiIiVQxrI0l1xFWXlqE6vMZltOCGCGtbKqIdVgQI6SVRMXS6m9teUJFsI6dGNLKp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ZVn+qxPzqchm31FcFGvtAVv+uxPzqUha0/bj87UsjFb4aiSfijqx7Ygc4Ddk+VTciebPP4CJk31iPhV34iara+5p/7Xl86m4E3dSu7mM/LogUr3fid3Wbq4u+55T24u03kZFnOjSlu3jNxGF/fx1wduo+FcjBbK9+ITq8tOJ76LiX1Jabe2GelUQ76QiTuyGuqFg80VBvJeKONE21KsTm+G9vJWKOFE21OeJTTgaeTMVSasBl0jI6nYip8qfrW9O1AY0+bneTMW/GrEKqLxYPZ+KpBWPRmb7p307SEEoBoIoqBAlIOj9byt/9rUT3yaeoGhhGkmL/2VY9ZdOvBcqdGKtQifWKnRircILWa3CaiRX+cr3KndiqvIvn1TlJWWqcidaVV/5QIUl5baqTytXuROtKjqxVqETaxU6sVahE1uVNzaxCp0Yqny33jtVeUmZqnzlU5WvfKpyWqnKaaUqr0ZSlVcjqcqrkVqFTsxVeCFrVE7rM51oVZTWsLZVRVrjur5Eq4K0xnXtcaEKWbf1fEFVsca1HlBFrHEtvKWGrIFBlbHGheVA6ZoPVK2rV/18dX9UR3VUR3VUX8Uz94M6xyeLAAAAAElFTkSuQmCC);
        background-position: top right;
        background-repeat: no-repeat;
        background-size: contain;
        height: 100px;
        width: 100px;
        position: absolute;
        top: 0;
        right: 0;
        z-index: 100;
        width: 120px;
    }
}

/******************************************************************************
 * Navigation
 *****************************************************************************/

.site-navigation,
.site-content,
.site-footer{
    margin: 0 auto;
    max-width: 840px;
    width: 92%;
}

.site-navigation{
    columns: 3;
    column-gap: 40px;

    input[type="checkbox"],
    label{
        display: none;
    }

    ul{
        list-style: none;
        margin: 0;
        padding: 0;

        li{
            margin-bottom: 20px;
            font-size: 22px;
            line-height: 23px;

            a{
                display: block;
                color: #444;
                font-weight: 700;
                text-decoration: none;

                &:hover{
                    color: @phpPurple;
                }
            }

            ul{
                padding-top: 8px;
            }

            li{
                margin-bottom: 6px;
                font-size: 18px;

                a{
                    border: none;
                    color: #777;
                    font-weight: normal;
                }
            }
        }
    }
    li{
        break-inside: avoid;
    }
}

@media (max-width: 820px) {
    .site-navigation{
        columns: 2;
    }
}

@media (max-width: 560px) {
    .site-navigation{
        columns: 1;
    }
}

@media (max-width: 375px) {
    .site-navigation{
        background: fade(white, 95%);
        columns: 1;
        max-height: 100vh;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 100;

        label{
            background: @phpPurpleDark;
            box-sizing: border-box;
            display: block;
            height: 40px;
            padding: 0 10px;
            width: 100vh;
            position: absolute;
            bottom: 0;
            left: 0;
            color: white;
            font-family: @sans;
            font-size: 13px;
            line-height: 40px;
            text-transform: uppercase;
            z-index: 2;
        }

        > ul{
            background: fade(white, 96%);
            border-top: 3px solid @phpPurple;
            box-shadow: fade(black, 25%) 0 -5px 10px;
            box-sizing: border-box;
            padding: 20px;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            position: absolute;
            left: 0;
            bottom: 40px;
            height: 50vh;
            width: 100vh;
            transform: translate(0,100vh);
            transition: all 0.2s ease;
            z-index: 1;
        }

        input[type="checkbox"]:checked ~ ul {
            transform: translate(0,0);
        }
    }
}

/******************************************************************************
 * Content
 *****************************************************************************/

.site-content{
    h1{
        padding-top: 40px;
        position: relative;

        &:after{
            border: 1px solid #DDD;
            border-bottom: none;
            content: "";
            display: block;
            height: 8px;
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
        }
    }

    &.chapters{
        counter-reset: chapter;

        h1{
            counter-increment: chapter;
            padding-top: 60px;

            &:before{
                display: inline-block;
                content: "Chapter " counter(chapter) ".";
                position: absolute;
                top: 30px;
                left: 50%;
                transform: translateX(-50%);
                color: #999;
                font-size: 12px;
                letter-spacing: 1px;
                line-height: 20px;
                text-transform: uppercase;
                text-align: center;
            }
        }
    }

    #welcome{
        ul{
            columns: 3;
            column-gap: 30px;
            list-style-position: inside;
        }
    }

    .back-to-top{
        margin-bottom: 60px;
    }
}

@media (max-width: 870px) {
    .site-content #welcome ul{
        columns: 2;
    }
}

@media (max-width: 600px) {
    .site-content #welcome ul{
        columns: 1;
    }
}

/******************************************************************************
 * Footer
 *****************************************************************************/

.site-footer{
    border-top: 1px solid #CCC;
    margin: 60px auto 0 auto;
    padding: 40px 20px;
    font-family: @sans;
    font-size: 16px;
    text-align: center;

    .cc-badge{
        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAw1BMVEX///8AAAAAAACrsar///8oKSjR1NAODg4jHyDLz8pAPz/f399wcHBQUFBgYGDJzcjEyMN5fHkwMDC9wry4vbeAgIDw8PDBxcDO0c3M0MyUmJPGysW6v7q/v7+fn5/T1tKvtK61urSxt7C/w76zuLKhpKDk5OSRk5F2c3RQUVAbGxuts6yEhoR9fnxDREMgICDW1dXJyMirq6qvr68wLS3Pz8+Rj4+Pj4+LioqEgYJaV1i6ubmbl5meoJ1dXl06NjcZGRmWw6QEAAAAAnRSTlMMANomgjQAAAMCSURBVHjatZYJc6JAEIWznWFmOAQDguAdjUqMd0yi5vz/v2q7GTmkNusWW3kxNfJkPts3TMPVFfyIfiH3ttHwRs1623F0PYp03XHa9ebI6zRu74aDwcPDdQUBXCG3440Qq4ec91GchzqhM/J1FSEYuVguYudLASixnBM6JVPJNxqgtJts2mWHwMh1Ij6dQabZlEeKfDccDlo4xbAsA6e11KzLDoG9EXHvqVbb73Z9m+q+r4dEppLHAmomQ5k1EMmsi44CY74JV/gBU+ohWqtjzSMMY6iBjR4AfQAaTVLO87HkTDabiXIUuNnWieuaLFPgYs1cb1PJC6itUzCrwQ2mCe4bcr9EPEkdOmcsUa+Jo8B1J5wiF8s9J0/DpGQNCt9ogkbladKwwZ/DNnNMtpGfdizlMzkKjAXPQDyxMwUCZqpkMOjYBrBpNADnGDESZDxZ5w4L3uQec5A7chTYCecAPiupBzDHkr0OWHQIKBotwqCzidGI17kTSKlhzFJOyFFgvgSBQXRrhuGr4QUnCFhyzOIbMDLinZTH18y523UTsJmBdS7ARiCQjEcg2fTjBdfrzc6foqCsemwtUUbqvI43jG2lxHMyMACW6MLK7K56Lrjm46qXZNGnkE+LB5AvHjlHudtBvF3MUqcn5eGgybd88aI+AP4KlbMaSF0ERwj2ocZKlxs5k8OXeA6KzkGirICcfwI3ChvEKm6Q/bHkbLbbtXLKUQRPKx+joCGPorGttKXzxTutWrZ41mnxGrdjDcC1LTdvOZcddbndg2DZ5fZoJANbqcuNGtygWttMdvTLtxsE+1uFXp9vafO7LV0ZTE3o/S9NqBqXwLDQ+QeSC23IVG1zDtVFYLD0s0Yf+ALgk0cL+F8wLCL+Ubo18agFqdT+oDeZo/7RL53EzsGUxnvpZtoqzDm9WO6o49JXKaMIpjRCPk1v/1Me6sUc0rZZcE5/BaXtpAQGd4Bozul5BbEDAwoqB6GcrOLcLFesZOw99Yjl7Ql7oeIUXjynBP4h/djT5m+nuF33PcPucwAAAABJRU5ErkJggg==);
        background-position: top left;
        background-repeat: no-repeat;
        background-size: contain;
        display: inline-block;
        height: 31px;
        width: 88px;
    }

    h2{
        .gamma;
        margin-bottom: 10px;
    }

    ul{
        list-style: none;
        margin: 0 0 20px 0;
        padding: 0;
    }

    .license{
        color: #777;
        font-size: 13px;
    }
}
