@import "dynamic.less";
@import "fonts/fontawesome-free-5.13.1/less/solid.css";
@import "fonts/fontawesome-free-5.13.1/less/brands.css";

@font-face {
    font-family: "PT Serif";
    src: url("fonts/PT_Serif/PTSerif-Regular.ttf");
}

@font-face {
    font-family: "PT Serif";
    src: url("fonts/PT_Serif/PTSerif-Bold.ttf");
    font-weight: bold;
}

@font-face{
    font-family: 'Source Code Pro';
    font-weight: 400;
    font-style: normal;
    font-stretch: normal;
    src: url('fonts/SourceCodePro/SourceCodePro-Regular.eot') format('embedded-opentype'),
    url('fonts/SourceCodePro/SourceCodePro-Regular.ttf.woff2') format('woff2'),
    url('fonts/SourceCodePro/SourceCodePro-Regular.otf.woff') format('woff'),
    url('fonts/SourceCodePro/SourceCodePro-Regular.otf') format('opentype'),
    url('fonts/SourceCodePro/SourceCodePro-Regular.ttf') format('truetype');
}
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
}

body
{
    font-family: "PT Serif";
    background-color: #f4f4f4;
    -moz-font-feature-settings: "lnum";
    -webkit-font-feature-settings: "lnum";
    font-feature-settings: "lnum";
    display: flex;
    flex-flow: column;
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl
{
    font-family: "PT Serif";
    margin: 0;
    word-wrap: break-word;
}

a
{
    font-family: "PT Serif";
    color: @orange-color;
    text-decoration: none;
}

header {
    &:after {
        .clearAfter;
    }

    background-color: #558f40;
    border-bottom: 1px solid #ffffff;

    background-image: -webkit-linear-gradient(#72ba57 0%, #558f40 98%);
    background-image: -moz-linear-gradient(#72ba57 0%, #558f40 98%);
    background-image: -o-linear-gradient(#72ba57 0%, #558f40 98%);
    background-image: linear-gradient(#72ba57 0%, #558f40 98%);

    h1 {
        float: left;
        color: #fff;
        font-size: 32px;
        text-shadow: 1px 2px 1px rgba(52, 74, 44, 0.75);

        line-height: 34px;
        padding: 26px 0;
    }

    img.logo {
        float: left;
        height: 76px;
        margin: 3px 6px 0 0;
    }

    img.companyLogo {
        float: right;
        height: 32px;

        padding: 27px 20px;
    }
}

#breadcrumb
{
    background-color: #f4f4f4;
    border-top: 1px solid @thin-border-color;
    border-bottom: 1px solid #ffffff;
    height: 30px;

    nav ul
    {
        list-style: none;
        padding: 0;
        font-size: 14px;
        line-height: 30px;
    }

    nav li
    {
        color: #6e6f71 !important;
        float: left;
        margin-right: 5px;
        position: relative;
    }

    nav li a
    {
        color: #6e6f71 !important;
    }

    nav li:after
    {
        content: '>';
        margin-left: 5px;
    }

    nav li:last-child:after
    {
        display: none;
    }
}

footer
{
    font-family: "PT Serif";
    font-size: 14px;
    clear: both;
    border-top: 1px solid @thin-border-color;
    background-color: #f4f4f4;

    .copyright {
        margin: 22px 0;
    }

    .copyright {
        float: left;
    }
}
#content
{
    flex-grow : 1;
    padding: 22px;

    p, ul, ol, pre {
        margin-bottom: 15px;
    }

    h3, h4, h5, h6 {
        margin-bottom: 8px;
    }

    h2, h3, h4, h5, h6 {
        color: @green-color;

        a.anchor {
            color: transparent;
            margin-left: 6px;
        }

        &:hover a.anchor {
            color: gray;
        }
    }

    h2 {
        color: @green-color;
        font-size: 32px;
        line-height: 36px;
        margin-bottom: 8px;

        & + p {
            margin-top: 8px;
        }
    }

    h3 {
        font-size: 20px;
    }

    h4 {
        font-size: 18px;
    }

    h5 {
        font-size: 16px;
    }

    h6 {
        font-size: 14px;
    }

    p {
        font-size: 14px;
        line-height: 130%;
    }

    blockquote {
        color: #868686;
        font-style: italic;
        display: block;
        font-size: 14px;
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;

        &:before {
            content: '»';
            color: #656565;
        }

        &:after {
            content: '«';
            color: #656565;
        }
    }

    code {
        padding: 1px 1px 0;
        background-color: #fff;
        white-space: pre;
        border: 1px solid #DDD;
    }

    dl {
        font-size: 14px;
    }

    ul, ol {
        padding: 5px 0 10px 0;

        background-color: #fff;
        font-family: "PT Serif";
        font-size: 14px;
        line-height: 2em;
        list-style-position: outside;

        li {
            margin: 0 24px;
        }

        ul, ol {
            margin: 0;
            padding: 0;
        }
    }

    ul {
        list-style-type: square;
        /* http://www.patternify.com/ */
        list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAFklEQVQImWNgIAZETXP9j44HVBIbAADn3jcVxmILQwAAAABJRU5ErkJggg==);
    }

    ul.buttons {
        background-color: transparent !important;
        list-style: none !important;
        padding: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        height: 25px;

        li {
            list-style: none !important;
            float: left;
            padding: 0 5px 0 0;
            position: relative;
            margin: 0 !important;
            font-size: 12pt;

            a {
                -webkit-border-radius: 15px;
                -moz-border-radius: 15px;
                -ms-border-radius: 15px;
                -o-border-radius: 15px;
                border-radius: 15px;
                background-color: #e69e04;
                border: 1px solid #e69e04;
                color: #fff;
                margin: 0;
                padding: 0 14px 3px;
                line-height: 20px;
                text-align: center;
                text-shadow: 1px 2px 1px rgba(187,127,0,.75);

                &:hover,
                &:active {
                    -moz-box-shadow: 0 2px 2px #777;
                    -webkit-box-shadow: 0 2px 2px #777;
                    box-shadow: 0 2px 2px #777;
                }
            }
        }
    }

    a[target^="_blank"]:after {
        content: '\f35d';
        font-family: "Font Awesome 5 Free";
        margin-left: 3px;
        font-size: 80%;
        line-height: 80%;
    }

    a[target^="_blank"].img:after {
        content: '';
        font-family: "Font Awesome 5 Free";
        margin-left: 0;
    }

    a.github {
        float: right;
        display: block;

        &:after {
            font-family:'Font Awesome 5 Brands';
            content: '\f09b';
            color: #777;
        }

        &:hover:after {
            color: #e69e04;
        }
    }

    // flex handling
    .wrapper {
        display: flex;
        flex-flow: column;
        height: 100%;

        .demo {
            flex-grow : 1;
            display: flex;
            flex-flow: column;

            .setapdf-demo {
                flex-grow : 1;
                display: flex;
                flex-flow: column;

                .demoTabPanel {
                    flex-grow : 1;
                    display: flex;
                    flex-flow: column;


                    .step {
                        flex-grow : 1;
                        display: flex;
                        flex-flow: column;
                        height: 0; // fix for FF

                        div.code {
                            height: 0;
                            flex-grow : 1;
                            display: flex;
                            flex-flow: column;

                            pre.code {
                                flex-grow : 1;
                            }
                        }

                    }
                }
            }
        }
    }

    .setapdf-demo
    {
        margin-left: 30px;

        &.extended {
            margin-left: 0;

            div.run {
                display: none;

                &.bottom {
                    display: block;
                }
            }

            .demoTabPanel {
                border-left: 0 !important;
            }
        }

        .demoTabPanel {
            border-left: 2px solid #DDDDDD;
            border-bottom: 2px solid #DDDDDD;

            background-color: #fff;
            padding: 9px;
            margin-bottom: 0 !important;

            & > div.step {
                min-height: 600px;

                &.execute {
                    font-size: 0;
                }
            }

            button.run {
                float: none;
            }

            pre.code, iframe {
                border: 0;
                margin: 0;
                padding: 0;
                overflow: auto;
            }
        }
    }

    div.demoTeaserWrapper, div.directoriesWrapper {
        display:flex;
        flex-direction:row;
        flex-wrap: wrap;
    }

    div.demoTeaser,
    div.demoDirectory
    {
        width: 47%;
        &:nth-child(odd) {
            margin-right: 3%;
        }

        &:nth-child(even) {
            margin-left: 3%;
        }
    }

    div.demoTeaser
    {
        min-height: 90px;
        border-top: 1px solid @thin-border-color;
        padding-top: 1.3em;

        img, a.teaserIcon {
            display: block;
            float: left;
            width: 58px;
            height: 58px;
            border: 1px solid #c6c6c6;
            margin: 0 18px 30px 0;
        }

        a.teaserIcon {
            background-color: #fff !important;
            position: relative;

            &:before, &:after {
                position: absolute;
                display: block;
                font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands";
            }

            &:before {
                color: @thin-border-color;
                content: attr(data-faIcon);
                font-size: 28px;
                text-align: center;
                line-height: 58px;
                width: 58px;
                height: 58px;
            }

            &:after {
                color: #9A9A9A;
                height: 28px;
                width: 50px;
                bottom: 0;
                text-align: right;
                line-height: 22px;
                opacity: .7;
                content: attr(data-faIcon2);
                font-size: 22px;
            }
        }

        h3 {
            padding: 0 !important;
            margin: 0 !important;
            line-height: 1.4em;
            clear: none !important;
        }

        p {
            width: auto !important;
            background-color: transparent !important;
            clear: none !important;
        }
    }

    div.demoDirectory
    {
        img, a.teaserIcon {
            display: block;
            float: left;
            width: 200px;
            height: 200px;
            margin: 0 18px 30px 0;
        }

        a.teaserIcon {
            width: 100px;
            height: 100px;
            border: 1px solid #c6c6c6;
            background-color: #fff !important;
            position: relative;

            &:before, &:after {
                position: absolute;
                display: block;
                font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands";
            }

            &:before {
                width: 100%;
                height: 100%;
                text-align: center;
                line-height: 100px;
                color: @thin-border-color;
                content: attr(data-faIcon); // \f07c
                font-size: 65px;
            }

            &:after {
                color: #9A9A9A;
                height: 48px;
                width: 90%;
                bottom: 0px;
                text-align: right;
                line-height: 42px;
                opacity: .7;
                content: attr(data-faIcon2);
                font-size: 42px;
            }
        }
    }

    .missingRequire a {
        color: gray;
    }

    .missingRequireTip {
        font-family: "Font Awesome 5 Free";
        font-size: 16px;
        cursor: help;
        color: gray;
    }

    div.run
    {
        ul {
            margin: 0 0 0 -35px;
            padding: 0;
            list-style: none;
            background-color: transparent;
            position: absolute;
            width: 35px;
            text-align: right;

            li {
                margin: 0;
                padding: 0;
                width: 35px;

                a {
                    span {
                        display: none;
                    }
                }
            }
        }

        a {
            display: block;
            background-color: #DDD;
            font-family: "Font Awesome 5 Free";
            font-size: 18px;
            line-height: 35px;
            width: 100%;
            height: 35px;
            text-align: center;
            color: #777;

            span {
                display: inline-block;
                font-family: "PT Serif";
                font-size: 90%;
                line-height: 100%;
            }
        }

        a.inactive {
            width: 85%;
            margin-left: 15%;
            background-color: #c4c4c4;
        }

        a.disabled {
            background-color: #e8e8e8;
            color: #d9d9d9;
            cursor: not-allowed;

            &:hover {
                color: #d9d9d9;
            }
        }

        a:hover {
            color: @orange-color;
        }

        &.bottom {
            height: 35px;
            margin-bottom: .3em;

            ul {
                margin-left: 0;
                width: auto;

                li {
                    float: left;
                    width: auto;
                    height: 35px;
                }
            }

            a {
                width: auto !important;
                white-space: nowrap;
                padding: 0 8px;
                font-size: 18px;

                &.inactive {
                    margin-left: 0;
                    height: 80%;
                    line-height: 26px;
                }

                span {
                    display: inline-block;
                    font-size: 90%;
                    line-height: 100%;
                }
            }
        }
    }

    div.code
    {
        position: relative;
        min-height: 220px;

        & ul.buttons {
            position: absolute;
            right: 26px;
            top: 9px;

            width: auto;
            list-style: none;

            li {
                padding: 0 5px 0 0;
            }

            a {
                visibility: hidden;
                opacity: 0;
                -webkit-transition: all .2s ease-in-out;
                -moz-transition: all .2s ease-in-out;
                -ms-transition: all .2s ease-in-out;
                -o-transition: all .2s ease-in-out;
                transition: all .2s ease-in-out;
                cursor: pointer;
            }

            a.copied:after {
                content: '\f00c';
                font-family: "Font Awesome 5 Free";
                margin-left: 4px;
            }
        }

        &:hover .buttons a
        {
            visibility: visible !important;
            opacity: 1 !important;
        }

        .phpInfo {
            position: absolute;
            right: 0;
            top: -20px;
            font-family: 'Source Code Pro';
            font-style: italic;
            color: #c4c4c4;
        }
    }

    pre.code
    {
        border-left: 2px solid #DDDDDD;
        font-family: 'Source Code Pro';
        padding: 9px;
        font-weight: normal;
        font-size: 0.9em;
        background-color: white;
        margin-top: 0;
        margin-bottom: 1em;
        overflow: auto;
        width: auto;
        white-space: pre;

        span.highlight {
            background-color: yellow;
        }
    }

    .demo pre.code
    {
        padding-top: 0;
    }

    div.pageNavigation
    {
        position: relative;
        color: #1d1d1b;
        font-size: 14px;
        vertical-align: center;

        border-bottom: 1px solid @thin-border-color;
        padding-top: 1em;
        padding-bottom: 1.7em;
        margin-bottom: 1.3em;
        .clearAfter;

        &.bottom
        {
            border-bottom: none;
            border-top: 1px solid @thin-border-color;
            padding-top: 1.7em;
            padding-bottom: .3em;
            margin-top: 1.7em;
            margin-bottom: .3em;
        }

        .emptyNext
        {
            float: right;
        }

        .emptyPrev
        {
        }

        a {
            color: #000;
            font-weight: bold;
            line-height: 25px;

            &:hover,
            &:active {
                color: @orange-color;
            }

            &.next {
                float: right;
            }

            &.prev:before,
            &.next:before {
                content: '';
                width: 7px;
                height: 25px;
                display: block;
                background: transparent url(img/page-navi-arrow.png) no-repeat 0 center;
            }

            &.next:before {
                float: right;
                margin-left: 10px;
                background-position: 0 center;
            }

            &.next:hover:before {
                background-position: -14px center;
            }

            &.prev:before {
                float: left;
                margin-right: 10px;
                background-position: -7px center;
            }

            &.prev:hover:before {
                background-position: -21px center;
            }
        }

        .others {
            position: absolute;
            display: none;
            bottom: 24px;
            z-index: 10;
            width: 250px;
            padding: 0 20px;

            ul {
                background-color: #FAFAFA !important;
                list-style: none !important;
                line-height: 20px !important;

                margin: 0 0 !important;
                padding: 0 5px !important;
                width: 100% !important;
                .shadow(2px, 3px, 2px, 0, #777);

                li {
                    margin: 5px 0 !important;
                }

                a {
                    font-weight: normal;
                    font-size: 14px;
                }
            }
        }

        a.next + .others {
            right: 0;
            text-align: right;
        }

        span:hover .others {
            display: block;
        }
    }
}