/*
 *
 * Structure
 * ================================================
 * Basic definition of body, containers and other
 * structural elements
 *
 * Author: Thomas Jung <thomas@jung.digital>
 *
 */

/* ==============[ basic html element settings ]========================================== */
* {
    box-sizing: border-box;
}

html, body {
    position: relative;
    height: 100%;
}

body {
    text-align: center;
    font-family: @font-serif-normal;
    background: @secondary-color-light;
    line-height: 1;
}

a {
    color: @primary-color;
    text-decoration: none;
}

:focus {
    position: relative;
    outline: 1px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

/* ==============[ 'window' structure with small offset ]================================= */
.main-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 12px;
    left: 0;
    background: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    .transition();
    .hidden & {
        opacity: 0;
    }
    .static & {
        .transition(none);
    }
    .fullscreen & {
        bottom: 0;
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        top: 5px;
        right: 5px;
        bottom: 5px;
        left: 5px;
        .fullscreen & {
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
        }
    }
    @media screen and (min-width: @desktopViewportWidth) {
        top: 20px;
        right: 20px;
        bottom: 25px;
        left: 20px;
    }
}

.document-view {
    position: absolute;
    top: 55px;
    right: 0;
    bottom: 0;
    left: 0;
    .transition();
    .fullscreen & {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    .static & {
        .transition(none);
    }
    #tx-dlf-map,
    .tx-dlf-map {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    .tx-dlf-logobar {
        position: absolute;
        pointer-events: none;
        right: 0;
        bottom: 80px;
        left: 0;
        height: 30px;
        opacity: .15;
        display: flex;
        align-items: center;
        justify-content: center;
        li {
            position: relative;
            flex: 0 0 auto;
            padding: 0 15px;
            height: 40px;
            img {
                max-height: 30px;
                -webkit-filter: grayscale(100%);
                filter: grayscale(100%);
            }
        }
    }
    .document-functions {
        .provider {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            text-align: left;
            background: rgba(white, 92%);
            display: flex;
            align-items: center;
            padding: 10px;
            border-bottom: 1px solid @lightgrey-color;
            .transition();
            > a {
                flex: 0 0 85px;
                img {
                    margin-top: 5px;
                    width: 70px;
                    height: 33px;
                }
            }
            // > a {
            //     display: none; // Kill the logo inside the control bar in order to use the new logobar (.tx-dlf-logobar)
            // }
            .mobile-meta {
                position: relative;
                font-size: 12px;
                line-height: 1.3;
                flex: 0 1 auto;
                dt {
                    display: none;
                }
                dd {
                    &.tx-dlf-title a {
                        position: relative;
                        font-weight: bold;
                        color: @basegrey-color;
                        font-size: 16px;
                    }
                }
            }
            .mobile-controls {
                position: absolute;
                bottom: -50px;
                right: 15px;
                display: flex;
                form { // The goto page button
                    position: relative;
                    width: 40px;
                    height: 40px;
                    flex: 0 0 40px;
                    margin-right: 5px;
                    label {
                        display: none;
                    }
                    select {
                        position: relative;
                        width: 40px;
                        height: 40px;
                        padding-left: 40px;
                        background: white url('@{control-icons}') no-repeat -600px -80px;
                        background-size: auto 120px;
                        outline: none;
                        border-radius: 20px;
                        -webkit-appearance: none;
                        border: 0 none;
                        &[disabled] {
                            display: none;
                        }
                    }
                }
                .fullscreen { // The fullscreen button
                    position: relative;
                    flex: 0 0 40px;
                    width: 40px;
                    height: 40px;
                    border-radius: 20px;
                    .text-hide();
                    z-index: 98;
                    background: white;
                    &:before,
                    &:after {
                        position: absolute;
                        width: 12px;
                        height: 12px;
                        background: url('@{control-icons}') no-repeat -574px -54px;
                        background-size: auto 120px;
                        display: block;
                        content: " ";
                        .transition();
                        pointer-events: none;
                        .static & {
                            .transition(none);
                        }
                    }
                    &:before {
                        top: 9px;
                        right: 9px;
                    }
                    &:after {
                        bottom: 9px;
                        left: 9px;
                        .transform(rotate(180deg));
                    }
                    &.active {
                        &:before {
                            .transform(rotate(180deg));
                        }
                        &:after {
                            .transform(rotate(0));
                        }
                    }
                }
                .fulltext-search-toggle {
                    position: absolute;
                    top: 0;
                    right: 90px;
                    width: 40px;
                    height: 40px;
                    background: white url('@{control-icons}') no-repeat -560px 0;
                    background-size: auto 120px;
                    border-radius: 20px;
                    cursor: pointer;
                    &:after {
                        position: absolute;
                        top: 0;
                        right: 0;
                        height: 40px;
                        width: 40px;
                        text-align: center;
                        content: "+";
                        font-size: 42px;
                        line-height: 32px;
                        color: @secondary-color;
                        .transition();
                        opacity: 0;
                    }
                    .search-indocument-active & {
                        background: lighten(@secondary-color-light, 40%);
                        &:after {
                            .transform(rotate(45deg));
                            opacity: 1;
                        }
                    }
                    &.disabled {
                        opacity: .5;
                        pointer-events: none;
                    }
                    .no-touchevents & {
                        .transition();
                        &:hover {
                            .transform(scale(1.2));
                        }
                    }
                }
            }
            .fullscreen & {
                .transform(translateY(-100%));
            }
        }
        &.missing-provider-image {
            .provider {
                > a {
                    display: none;
                    img {
                        display: none;
                    }
                }
                .mobile-meta {
                    padding-left: 10px;
                }
            }
        }
    }
    @media screen and (min-width: @phoneLandscapeViewportWidth) {
        .tx-dlf-logobar {
            top: 5px;
            right: 5px;
            bottom: auto;
            left: auto;
            width: 40%;
            height: 40px;
            z-index: 200;
            justify-content: flex-end;
            li {
                flex: 0 1 auto;
                height: auto;
                img {
                    max-width: 100%;
                }
            }
        }
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        top: 0;
        left: 33%;
        padding: 0;
        #tx-dlf-map {
            top: 0;
        }
        .tx-dlf-logobar {
            top: auto;
            right: 15px;
            bottom: 15px;
            z-index: auto;
        }
        .document-functions {
            .provider {
                top: 10px;
                left: 10px;
                right: auto;
                background: transparent;
                padding: 0;
                .mobile-meta,
                .mobile-controls {
                    display: none;
                }
            }
            &.missing-provider-image {
                ul {
                    left: 20px;
                }
            }
        }
    }
    @media screen and (min-width: @desktopViewportWidth) {
        left: 25%;
    }
    @media screen and (min-width: 1600px) {
        left: 22%;
    }
    @media screen and (min-width: 2000px) {
        left: 20%;
    }
}

/* ==============[ empty pageview element message ]======================================= */
.tx-dlf-empty {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 30px;
    font-family: @font-sans-bold;
    line-height: 1.4;
    a {
        position: relative;
        color: @secondary-color;
        padding-bottom: 60px;
        .error-arrow {
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 40px;
            height: 40px;
            margin-left: -20px;
            text-align: center;
            font-size: 40px;
            line-height: 40px;
            font-family: @font-sans-normal;
            .transform(rotate(-45deg));
            opacity: .3;
        }
    }
    @media screen and (min-width: @phoneLandscapeViewportWidth) {
        padding: 30px 20%;
        a {
            padding: 0;
            .error-arrow {
                display: none;
            }
        }
    }
    @media screen and (min-width: @tabletViewportWidth) {
        a {
            padding-top: 300px;
            &:before {
                position: absolute;
                top: 0;
                left: 50%;
                width: 260px;
                height: 260px;
                border-radius: 130px;
                margin-left: -130px;
                border: 1px solid @lightgrey-color;
                content: " ";
            }
            &:after {
                position: absolute;
                top: 30px;
                left: 50%;
                width: 1px;
                height: 200px;
                background: @lightgrey-color;
                content: " ";
                .transform(rotate(-45deg));
            }
        }
    }
}

// EOF
