@import "~susy/sass/susy";
@import "variables.scss";
@import "functions.scss";
@import "fonts.scss";
@import "mixins.scss";

@include border-box-sizing;

$large: (
    columns: 18,
    container-position: center,
    global-box-sizing: content-box,
    gutter-position: inside,
    gutters: 0.03,
    debug: (
        image: show,
    ),
);

@include layout($large);

body {
    @include container;

    font-family: Junicode, Times, serif;
    background: $base-backgroundImage;
    margin: 0;
    padding: 0;
    min-height: $base-minHeight;
    overflow: hidden;
    position: absolute;
    font-size: $base-fontSize;
    height: 100%;
    width: 100%;
    min-width: 800px;

    >header,
    >footer,
    >section {
        @include span(20 of 20);
    }

    >header,
    >footer {
        height: 54px;
        padding: 10px;

        @include colors($base-color-light, $base-color-dark);
    }

    >header {
        .logo {
            height: 34px;
            float: left;
            margin-right: 1rem;
        }

        .webSiteLink {
            color: #f5f5f5;
            font-size: 1.2rem;
            margin-left: 0.4rem;
            opacity: .7;

            opacity: 0.7;
            &:hover {
                opacity: 1;
                cursor: pointer;
            }
        }
    }
}

footer {
    display: setVisibility($base-footer);
}

#global-container-ext {
    height: 100%;
}

#global-container {
    @include calc(height, unquote("#{setGlobalFrameHeight()} + 1px"));

    padding: 1px 0 0;
    overflow: hidden;
    width: 100%;
}

div#global-container-ext.navbar-opened #global-container {
    @include calc(height, unquote("#{setGlobalFrameHeightWithNavbar()} + 1px"));
}

section>div {
    height: 100%;
    display: block;
    vertical-align: middle;
}

#left-nav {
    @include mainNavArrow;
}

#main-container {
    @include main-frame;
    line-height: 22px;
}

#main-container>div {
    white-space: nowrap;
}

#right-nav {
    @include mainNavArrow;
}

@import "apparatuses.scss";
@import "selector.scss";
@import "bibliography.scss";
@import "buttonSwitch.scss";
@import "box.scss";
@import "popover.scss";
@import "criticalApparatusEntry.scss";
@import "sourcesApparatusEntry.scss";
@import "analoguesApparatusEntry.scss";
@import "reading.scss";
@import "quote.scss";
@import "analogue.scss";
@import "dialog.scss";
@import "ref.scss";
@import "tabsContainer.scss";
@import "list.scss";
@import "namedEntity.scss";
@import "sourceSeg.scss";
@import "versionReading.scss";
@import "versionApparatusEntry.scss";
@import "navBar.scss";
@import "visColl.scss";
@import "searchBox.scss";
@import "toc.scss";
@import "diplomaticEdition.scss";
@import "interpretativeEdition.scss";
@import "osdViewer.scss";
@import "collation.scss";
@import "tei.scss";
@import "tdhop.scss";
@import "3DHpanels.scss";

.secondary-container {
    position: absolute;
}

.btnGroup {
    display: inline;

    .fontSizeBtnGroup {
        position: absolute;
        font-size: 1.6em;
        float: left;
        bottom: 45px;
        left: 147px;
        padding: 10px;
        background: rgb(38, 50, 56) none repeat scroll 0% 0%;
        text-align: center;
        box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.6);
    }
}

.filters-in-box {
    text-align: center;
    position: absolute;
    bottom: 44px;
    width: 100%;
    height: auto;
    padding: 5px;
    left: 3px;
    right: 2px;
    width: calc(100% - 21px);
    background: #fff;

    @include set(box-shadow, 0px -7px 6px -4px #fff);

    span.filter-group {
        display: inline;

        &::after {
            content: "-";
        }

        &:last-child::after {
            content: "";
        }

        span.filter-value {
            display: inline-block;
            background: #cf00ff;
            border-radius: 2px;
            font-size: 85%;
            margin: 4px;
            padding: 0px 5px;
            font-variant: small-caps;
            cursor: pointer;
            min-width: 50px;
            text-align: center;

            @include set(box-shadow, 0px 1px 3px rgba(0, 0, 0, 0.3));

            &:hover {
                opacity: 0.9;
            }

            &::after {
                content: "x";
                color: #333;
                font-weight: lighter;
                font-size: 80%;
                top: -1px;
                position: relative;
            }
        }
    }
}

.pinnedTypeTitle {
    display: block;
    font-variant: small-caps;
    font-weight: bold;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.alert-msg {
    background: rgba(0, 0, 0, 0.1);
    display: block;
    font-size: 90%;
    text-align: center;
    padding: 10px;

    &-error {
        background: rgba(255, 0, 0, 0.1);
    }
}

.globalMenu {
    width: auto;
    display: inline-flex;
    align-items: center;
    position: absolute;
    right: 8px;
    top: 0px;
    height: 54px;
    padding: 10px;
    font-size: 100%;
    > button-switch {
        &:first-child {
            position: relative;
            top: -1px;
        }
    }

    button-switch {
        margin: 0;

        .buttonSwitch {
            height: 0;
            display: block !important;
            padding: 0 3px;
            background: none;
            box-shadow: none;
            border-radius: 0;
            width: auto;

            &-label {
                font-variant: small-caps;
                font-size: 80%;
                top: 0;
                color: $base-color-light;
            }

            &-icon {
                color: $base-color-light;
                font-size: 1em;
                top: -1px;
            }

            &:hover,
            &:hover > * {
                color: $buttonSwitch-active-background-color;
            }
        }

        &.mode-view {
            margin: 0px 1px;

            &[data-icon="reading-txt"] {
                margin-right: -2px;
            }

            .buttonSwitch {
                width: auto;
                padding: 0;

                &-active,
                &:hover {
                    .icon {
                        color: $base-color-active-background;
                    }
                }

                &-icon {
                    font-size: 1.2em;
                    margin-right: 3px;
                    top: 0;
                }

                .iconbis-evt_versions,
                .iconbis-evt_srctxt {
                    font-size: 0.85em;
                    top: -4px;
                }
            }
        }

        &:last-child {
            margin-right: 0;
        }
    }
    .viewModeMenu {
        display: flex;
    }
}

.global-loading-container,
.global-msg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #e5e5e5;
    font-size: 60%;

    .global-msg {
        h1 {
            font-size: 2.5em;
        }

        height: auto;
        text-align: center;
        padding: 20px;
    }
}

.popup-container {
    @include calc(height, unquote("#{setPopupContainerFrameHeight()}"));
    overflow-y: auto;
    position: absolute;
    width: 100%;
    left: 0;
    bottom: $base-slider-height;
    background-color: #607d8b;
    border: 1px solid #ffffff;
    border-left: none;
    border-right: none;
    z-index: 999;
    top: $base-header-height;
    &.noNavBar {
        top: #{$base-header-height + $base-slider-height + 1};
        bottom: 0;
        border: none;
        left: #{$mainContainer-border-width * 2};
        @include calc(height, unquote("#{setPopupContainerFrameHeight()} - #{$mainContainer-border-width * 2} - 1px"));
        &.thumb_cont {
            @include calc(width, unquote("50% - #{$mainContainer-border-width * 4}"));
        }
        &.viscoll_cont {
            top: #{$base-header-height + $base-slider-height};
            @include calc(width, unquote("100% - #{$mainContainer-border-width * 3 + 1}"));
            @include calc(height, unquote("#{setPopupContainerFrameHeight()} - 1px"));
        }
    }
}

.global-loading-container {
    display: block;
}

.viewMode,
.global-loading-container {
    .loading {
        background: rgba(0, 0, 0, 0.1);

        .loader {
            font-size: 2.5em;
            color: $base-color-dark;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    }

    box:last-child .box {
        margin: 0;
    }
}

pre {
    white-space: pre-wrap;
    font-size: 80%;
}

.colorLegend {
    padding: 15px;

    &-filter {
        &-name {
            display: block;
            margin: 10px 0 5px;
            font-weight: bold;
            font-variant: small-caps;
            text-transform: uppercase;
        }

        &-value {
            display: block;
        }

        &-color {
            display: inline-block;
            min-height: 15px;
            min-width: 15px;
            margin-right: 10px;
            vertical-align: top;
        }
    }
}

.availableWitnesses-selector,
.availableVersions-selector {
    position: absolute;
    z-index: 9999;
    display: block;
    right: 0;
    background: #fff;
    height: auto;
    top: 50%;
    margin-right: 9px;
    transform: translate(0, -50%);
    min-width: 150px;
    max-height: 80%;
    overflow-x: hidden;
    overflow-y: auto;

    @include set(box-shadow, 0px 0px 4px 0px rgba(0, 0, 0, 0.6));

    >span {
        display: block;
        padding: 10px;
        border-bottom: 1px solid #f0f0f0;
        cursor: pointer;

        &:hover {
            background: #f0f0f0;
        }
    }

    &.left75 {
        position: absolute;
        right: auto;
        left: 75%;
        transform: translate(-50%, -45%);
    }
}

.mainMenu {
    position: absolute;
    text-align: left;
    background-color: white;
    padding: 9px 0px;
    z-index: 9999;
    max-width: 340px;
    overflow: hidden;
    border-radius: 3px;
    top: $base-header-height;
    right: 4px;

    @include set(box-shadow, "0 2px 5px 0 rgba(0,0,0,0.26), 0 2px 10px 0 rgba(0,0,0,0.16)");

    ul {
        margin: 0;
        list-style: none;
        padding: 0;
        color: #4b4b4b;

        li {
            >span {
                color: #444444;
                font-size: 1.1rem;
                height: 40px;
                padding-top: 13px;
                padding-right: 58px;
                padding-left: 20px;
                display: block;
                cursor: pointer;
                box-sizing: border-box;
                white-space: nowrap;

                .icon {
                    margin-right: 14px;
                }
            }

            &:hover {
                background-color: #f4f5f5;
                cursor: pointer;
            }

            &.inactive * {
                background-color: #f5f5f5;
                color: #ccc;
                cursor: default;
            }

            a {
                color: #444444;
                text-decoration: none;
            }
        }
    }

    img.flag {
        height: 18px;
        width: 18px;
        border-radius: 100px;
        border: 1px solid #4e443c;
        display: inline-block;
        margin: 0px 4px;
        position: relative;
        top: 2px;
        cursor: pointer;
        opacity: 0.5;

        &.active {
            cursor: default;
            opacity: 1;
        }

        &:hover {
            opacity: 1;
        }
    }
}

.projectInfo {
    &-sectionHeader {
        font-weight: bold;
        display: block;
        margin: 15px 0 5px;
        font-variant: small-caps;
        text-align: center;
    }

    &-sectionSubHeader {
        display: block;
        border-bottom: 1px dotted #666;
        margin-bottom: 5px;
        font-variant: small-caps;
        color: #000000;
        font-size: 90%;
        display: block;
        margin-top: 14px;
    }

    &-blockLabel,
    &-inlineLabel {
        font-variant: small-caps;
        color: #666;
        font-size: 90%;
    }

    &-blockLabel {
        display: block;
        margin-bottom: 2px;
    }

    &-inlineLabel {
        display: inline;

        +.p {
            display: inline;
        }
    }
}

.p {
    .projectInfo-inlineLabel {
        display: none;
    }
}

// Generic style
.hidden {
    display: none;
}

.noPadding {
    padding: 0 !important;

    >* {
        padding: 0 !important;
    }
}

.evtlb {
    display: block;

    .l {
        display: inline !important;
    }
}

.zoneInImg {
    display: none;

    &.lineHover {
        border: 1px solid #4c2f2f !important;
        background-color: #c67261 !important;
        opacity: 0.4;
    }

    &.lineSelected,
    &.lineSelected.lineHover {
        border: 1px solid #4c2f2f !important;
        background-color: #9c4837 !important;
        opacity: 0.5;
    }
}

.ITLactive {
    &.box-image {
        img {
            display: none;
        }

        .zoneInImg {
            display: block;
        }
    }

    .lineHover,
    .lineHover:after {
        cursor: pointer;
        background-color: rgba(230, 206, 160, 0.8) !important;
        color: #000000;
    }

    .lineSelected,
    .lineSelected:after {
        cursor: pointer;
        background-color: rgba(213, 177, 125, 0.9) !important;
        color: #000000;
    }
}

.italic {
    font-style: italic;
}

.highlighted {
    background: #ffc !important;
}

.emptyText {
    padding: 0 0.4rem;
    &::after {
        content: "\00a0";
    }
}

.front [data-type="footer"] {
    font-size: 95%;
    padding: 10px 0;
    border-top: 1px solid;
}

/* Critic and Comment Notes (notes with numeric and alphabetical exponent) */
.evt_note {
    color: #fff;
}
.evt_note span {
    padding: 2px 5px 2px 3px!important;
    opacity: 10!important;
    border-radius: 4px!important;
    font-size: 13px!important;
    top: -8px!important;
    position: relative!important;
    text-align: center;
}
.evt_note span.generic {
    color: #fff;
    background-color: maroon!important;
}
evt-popover[data-n=""] .evt_note span.generic:before {
    content: "";
    padding: 0px 4px 4px 4px !important;
    font-size: 1px !important;
}
evt-popover[data-n=""] .evt_note span.generic {
    margin-right: 4px;
    font-size: 10px !important;
    padding: 0px 1px !important;
    border-radius: 100px !important;
    background-color: #4e443c;
}
.popover_trigger.active:hover {
    opacity: 0.5;
}
.popover_trigger {
    color: #263238 !important;
    opacity: 10 !important;
}
.evt_note span.comment {
    color: #fff;
    background-color: rgb(87, 14, 105) !important;
}
.evt_note span.critic {
    color: #fff;
    background-color: rgb(24, 70, 155) !important;
}

.thumbnail {
    display: inline-block;
    padding: 9px 3px;
    margin: 3px;
    cursor: pointer;

    img {
        height: 150px;
        width: 100px;
        border: 2px solid black;
    }

    &.active img {
        border-color: $base-color-active-background;
    }

    figcaption {
        color: white;
        position: relative;
        margin-top: -52px;
        background: rgba(0, 0, 0, 0.2);
        font-size: 0.7em;
        width: 100px;
        text-align: center;
    }

    &:hover figcaption {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    &.active {
        cursor: default;

        figcaption {
            background: rgba($base-color-active-background, 0.7) !important;
            color: #000;
        }
    }
}
