/*
 *
 * Sidebar
 * ================================================
 * Special styles for the blue sidebar which
 * represents the base control unit in DFG viewer
 *
 */

.control-bar {
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        background: @base-blue;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 33%;
        z-index: 1100;
        .transition();
    }
    .fullscreen & {
        width: 0;
        overflow: hidden;
    }
    .static & {
        .transition(none);
    }
    @media screen and (min-width: @desktopViewportWidth) {
        width: 25%;
    }

/* ==============[ header bar (with logo, secondary navigation and language switch) ]===== */
    .header-bar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        min-height: 60px;
        background: @base-blue;
        z-index: 1100;
        overflow: hidden;
        .transition();
        h1 {
            position: absolute;
            top: 10px;
            left: 15px;
            width: 200px;
            height: 35px;
            a {
                position: relative;
                width: 100%;
                height: 100%;
                color: #fff;
                .text-hide();
                background: url('../Images/dfgviewerLogo.svg') no-repeat center center;
                background-size: 200px 35px;
                display: block;
            }
        }
        nav {
            .nav-toggle {
                position: absolute;
                top: 15px;
                right: 15px;
                width: 25px;
                height: 30px;
                padding: 0;
                border: 0 none;
                background: transparent;
                outline: none;
                .nav-label {
                    display: none;
                }
                .nav-button-bar {
                    position: relative;
                    width: 100%;
                    height: 2px;
                    border-radius: 2px;
                    margin-bottom: 4px;
                    background: #fff;
                    display: block;
                    .transition();
                }
                &.active {
                    .nav-button-bar {
                        &:nth-of-type(2) {
                            .transform(translateY(-40px));
                            opacity: 0;
                        }
                        &:nth-of-type(3) {
                            .transform(translateY(6px) rotate(45deg));
                        }
                        &:nth-of-type(4) {
                            .transform(rotate(-45deg));
                        }
                        &:nth-of-type(5) {
                            .transform(translateY(40px));
                            opacity: 0;
                        }
                    }
                }
            }
            .language-nav {
                position: absolute;
                right: 45px;
                top: 17px;
                font-size: 12px;
                li {
                    position: relative;
                    display: inline-block;
                    margin-right: 4px;
                    a {
                        position: relative;
                        padding: 6px;
                        color: #fff;
                        display: block;
                    }
                }
                &:before {
                    position: absolute;
                    top: 0;
                    left: 50%;
                    margin-left: -6px;
                    content: "/";
                    opacity: 0.2;
                    font-size: 24px;
                    color: #fff;
                    font-weight: 100;
                    text-align: center;
                    width: 10px;
                }
            }
            .viewer-nav {
                position: relative;
                top: 55px;
                width: 100%;
                text-align: left;
                padding-bottom: 0;
                max-height: 0;
                opacity: 0;
                overflow: auto;
                .transition(all .3s ease-out);
                li {
                    a {
                        padding: 15px;
                        display: block;
                        color: #fff;
                        border-bottom: 1px solid fade(#fff,10%);
                        line-height: 1.4;
                    }
                    &:first-child {
                        a {
                            border-top: 1px solid fade(#fff,10%);
                        }
                    }
                }
                &.open {
                    padding-bottom: 65px;
                    max-height: 320px;
                    opacity: 1;
                }
            }
        }
        .fullscreen & {
            min-height: 0;
        }
        @media screen and (min-width: @tabletLandscapeViewportWidth) {
            position: absolute;
            top: 6px;
            background: transparent;
            overflow: visible;
            h1 {
                top: 15px;
                left: 30px;
                max-width: 45%;
                a {
                    background-size: 100% auto;
                }
            }
            nav {
                .nav-toggle {
                    top: 20px;
                    right: 30px;
                }
                .language-nav {
                    right: 60px;
                    top: 20px;
                }
                .viewer-nav {
                    position: absolute;
                    top: 6px;
                    right: 0;
                    width: 200px;
                    background: fade(@base-blue,90%);
                    max-height: none;
                    font-size: 12px;
                    .transform(scaleX(0));
                    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
                    padding: 15px;
                    overflow: visible;
                    &:before {
                        position: absolute;
                        top: 20px;
                        left: -10px;
                        width: 0;
                        height: 0;
                        border: 10px solid transparent;
                        border-left-width: 0;
                        border-right-color: fade(@base-blue,90%);
                        content: " ";
                    }
                    li {
                        margin: 15px 0;
                        a {
                            padding: 0 10px;
                            border: 0 none;
                            .transition();
                            &:hover {
                                background: rgba(255,255,255,0.2);
                            }
                        }
                        &:first-child {
                            a {
                                border: 0 none;
                            }
                        }
                    }
                    &.open {
                        padding: 15px;
                        opacity: 1;
                        right: -220px;
                        max-height: none;
                        .transform(scaleX(1));
                    }
                }
            }
        }
        @media screen and (min-width: 1520px) {
            h1 {
                max-width: none;
            }
        }
    }

/* ==============[ metadata and table of contents (as offcanvas elements in mobile) ]===== */
    .metadata-wrapper, .toc-wrapper {
        position: absolute;
        top: 55px;
        bottom: 0;
        width: 90%;
        background: fade(lighten(desaturate(@base-blue,25%),25%), 95%);
        z-index: 1002;
        text-align: left;
        padding: 15px;
        font-size: 14px;
        .transition();
        .offcanvas-toggle {
            position: absolute;
            bottom: 5px;
            width: 30px;
            height: 60px;
            background: fade(lighten(desaturate(@base-blue,25%),25%), 95%) url(../Images/controlIcons.svg) no-repeat 0 0;
            border: 1px solid #fff;
        }
        &.open {
            .transform(translateX(0));
            z-index: 1003;
        }
    }
    .metadata-wrapper {
        right: 0;
        .transform(translateX(100%));
        border-left: 1px solid #fff;
        .offcanvas-toggle {
            left: -30px;
            border-radius: 30px 0 0 30px;
            background-position: -442px 9px;
            border-width: 1px 0 1px 1px;
        }

    }
    .toc-wrapper {
        left: 0;
        .transform(translateX(-100%));
        border-right: 1px solid #fff;
        .offcanvas-toggle {
            right: -30px;
            border-radius: 0 30px 30px 0;
            background-position: -447px -30px;
            border-width: 1px 1px 1px 0;
        }
    }
    @media screen and (min-width: @phoneLandscapeViewportWidth) {
        .metadata-wrapper, .toc-wrapper {
            width: 45%;
        }
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        .metadata-wrapper, .toc-wrapper {
            position: relative;
            .transform(translateX(0));
            text-align: left;
            background: transparent;
            color: #fff;
            padding: 30px;
            width: 100%;
            height: 45%;
            border: 0 none;
            a {
                color: #fff;
            }
            .offcanvas-toggle {
                display: none;
            }
        }
    }
}

/* ==============[ toc (inside the respective wrap > see above) ]========================= */
ul.toc {
    position: relative;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    line-height: 1.2;
    a, span.a {
        position: relative;
        padding: 8px 36px 8px 18px;
        display: block;
        color: #fff;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        .pagination {
            position: absolute;
            right: 6px;
            font-weight: 700;
            opacity: 0.4;
            font-size: 12px;
            line-height: 16px;
            text-align: right;
        }
    }
    span.a {
        opacity: 0.5;
        font-weight: normal;
    }
    li {
        position: relative;
        &.submenu {
            &:before {
                position: absolute;
                top: 12px;
                left: 10px;
                width: 0;
                height: 0;
                content: " ";
                border: 5px solid transparent;
                border-right-width: 0;
                border-left-color: #fff;
            }
        }
        &.active {
            background: rgba(255,255,255,0.1);
            &:before {
                left: 8px;
                .transform(rotate(90deg));
            }
        }
        .current {
            & > a, & > span.a {
                background: rgba(255,255,255,0.6);
                color: @base-blue;
                font-weight: 700;
            }
        }
    }
    ul {
        position: relative;
        &:before {
            position: absolute;
            top: -5px;
            left: 10px;
            bottom: 0;
            width: 1px;
            background: #fff;
            content: " ";
        }
        li {
            position: relative;
            .meta-type-icon {
                // We have no type icons in DFG-Viewer, yet.
                display: none;
            }
            &.submenu {
                &:before {
                    position: absolute;
                    top: 12px;
                    left: 10px;
                    width: 0;
                    height: 0;
                    content: " ";
                    border: 5px solid transparent;
                    border-right-width: 0;
                    border-left-color: #fff;
                }
            }
            &.active {
                background: rgba(255,255,255,0.1);
                &:before {
                    left: 8px;
                    .transform(rotate(90deg));
                }
            }
            .current {
                & > a, & > span.a {
                    background: rgba(255,255,255,0.6);
                    color: @base-blue;
                    font-weight: 700;
                }
            }
        }
        a, span.a { padding-left: 30px; }
        ul {
            &:before, li.submenu:before { left: 30px; }
            a, span.a { padding-left: 50px; }
            ul {
                &:before, li.submenu:before { left: 50px; }
                a, span.a { padding-left: 70px; }
                ul {
                &:before, li.submenu:before { left: 70px; }
                    a, span.a { padding-left: 90px; }
                }
            }
        }
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        font-size: 14px;
    }
}

/* ==============[ metadata (inside the respective wrap > see above) ]==================== */

.tx-dlf-metadata {
    position: relative;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    line-height: 1.4;
    dl {
        color: #fff;
        a {
            color: #fff;
        }
        dt, dd {
            display: block;
        }
        dt {
            font-size: 12px;
            font-weight: 700;
            margin-top: 20px;
            &:first-child {
                margin-top: 0;
            }
        }
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        line-height: 1.6;
        dl {
            dt, dd {
                font-size: 14px;
                display: inline;
            }
            dt {
                &:after {
                    content: ": ";
                }
            }
            dd {
                &:after {
                    position: relative;
                    width: 100%;
                    height: 1px;
                    display: block;
                    content: " ";
                }
            }
            dt.tx-dlf-type {
                display: none;
            }
            dd.tx-dlf-type {
                font-size: 12px;
                font-weight: 400;
                opacity: 0.5;
                display: inline;
            }
            dt.tx-dlf-title {
                display: none;
            }
            dd.tx-dlf-title {
                font-weight: 700;
            }
        }
    }

    @media screen and (min-width: @desktopViewportWidth) {
        dl {
            dt.tx-dlf-type {
                display: inline;
            }

            dt.tx-dlf-title {
                display: inline;
            }
        }
    }
}
