body {
    font-family: Ubuntu;
    font-weight: 300;
    margin: 0;
    padding: 0;
}

div.login {
    margin-top: 24px;
    padding: 24px;
    background-color: rgb(255 255 255 / .75);
    box-sizing: border-box;
    color: rgb(44, 46, 54);
    line-height: 1.7em;

    & hr {
        color: #c4c3c3;
        margin: 1rem 0;
        border: none;
        border-top: 1px solid;
    }

    & h1,
    & h2 {
        color: rgba(38, 114, 140, 1);
        font-weight: 500;
        margin-top: 0;
        margin-bottom: .5rem;
    }

    & label {
        display: block;
    }

    & input[type="text"],
    & input[type="password"] {
        font-family: inherit;
        box-shadow: 2px 2px 9px rgb(0 0 0 / .06);
        border: 1px solid #fdfdfd;
        display: block;
        width: 100%;
        padding: 10px .75rem;
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5;
        color: rgb(44, 46, 54);
        appearance: none;
        background-color: white;
        background-clip: padding-box;
        border: 1px solid #dee2e6;
        box-sizing: border-box;
        border-radius: 0.375rem;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

        &:invalid {
            border-color: #B94A48;
            background: #F2DEDE;
        }

        &:focus {
            color: rgb(44, 46, 54);
            background-color: white;
            border-color: #febf8a;
            outline: 0;
            box-shadow: 0 0 0 .25rem rgb(253 126 20 / .25);
        }

        &:read-only {
            background-color: silver;
            box-shadow: 2px 2px 9px rgb(0 0 0 / .06);
            border-color: #dee2e6;
        }
    }

    & input[type="submit"] {
        cursor: pointer;
        display: inline-block;
        padding: 0.5rem 2rem;
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.5;
        color: #fff;
        text-align: center;
        text-decoration: none;
        vertical-align: middle;
        user-select: none;
        border: 1px solid #fd7e14;
        border-radius: 0.375rem;
        background-color: #fd7e14;
        transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
        box-shadow: 2px 2px 9px rgb(0 0 0 / .06);
        margin-top: 1em;

        &:hover {
            color: #fff;
            background-color: #fd9137;
            border-color: #fd8b2c;
        }
    }
}


label.selector,
label.checkbox {
    height: 2rem;
    position: relative;
    width: 4rem;
}

label.selector input,
label.checkbox input {
    display: none;
}

label.checkbox .slider {
    border-radius: 2rem;
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

label.checkbox .slider:before {
    border-radius: 50%;
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: calc(2rem - 8px);
    left: 4px;
    position: absolute;
    transition: .4s;
    width: calc(2rem - 8px);
}

label.checkbox input:checked + .slider {
    background-color: #66bb6a;
}

label.checkbox input:checked + .slider:before {
    transform: translateX(2rem);
}

label.selector {
    display: inline-block;
    background-color: #ccc;
    cursor: pointer;
    transition: .4s;
}

label.selector .indicator {
    border-radius: 50%;
    background-color: #fff;
    bottom: 2px;
    height: calc(2rem - 4px);
    left: 0;
    position: absolute;
    transition: .4s;
    width: 4rem;
    text-align: center;
    vertical-align: middle;
    line-height: calc(2rem - 4px);
}

label.selector:first-of-type {
    border-radius: 2rem 0 0 2rem;

    & .indicator {
        left: 2px;
        width: calc(4rem - 2px);
        border-radius: 2rem 0 0 2rem;
    }
}

label.selector:last-of-type {
    border-radius: 0 2rem 2rem 0;

    & .indicator {
        width: calc(4rem - 2px);
        border-radius: 0 2rem 2rem 0;
    }
}


label.selector input:checked + .indicator {
    background-color: #66bb6a;
    color: white;
}

label.selector .indicator {
    font: var(--fa-font-solid);
    line-height: calc(2rem - 4px);
}

div.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;

    & > div.curtain {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        backdrop-filter: none;
        transition: backdrop-filtercolor 0.125s ease-in-out;
        z-index: 10;
    }

    & > div.scroller {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        z-index: 15;
    }

    &.languageSelect > div.scroller > div.buttons {
        position: relative;
        font-size: 1.2em;
        margin: 0 auto 0 auto;
        max-width: 1272px;
        padding: 24px;
        line-height: 1.7em;
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: var(--languageSelect-justify-content);
        z-index: 15;
        user-select: none;

        & > a {
            display: block;
            width: 220px;
            border-radius: 6px;
            background-color: rgb(255 255 255 / .9);
            box-shadow: rgba(0, 0, 0, 0.15) 0px 8px 16px 0px;
            box-sizing: border-box;
            color: black;
            text-decoration: none;

            & > div {
                font-weight: 500;
                text-align: center;
            }

            &.selected {
                background-color: rgb(178 178 178 / .9);
            }
        }
    }
}

header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    background-color: rgb(0 126 169 / .75);

    & > * {
        display: block;
    }

    & > a {
        text-decoration: none;
        width: 3.5em;
        margin-right: 1em;
    }

    & > search > form {
        display: flex;

        & > input {
            min-width: 0;
            display: block;
            margin: 0.2em;
            border-radius: 0.3em;
            font-size: 1.7rem;
            box-sizing: border-box;
            border: 1px inset #50aeef;

            &[type="text"] {
                flex-grow: 1;
            }

            &[type="submit"] {
                cursor: pointer;
            }
        }
    }

    & > div {
        font: var(--fa-font-solid);
        font-size: 2rem;
        margin: 0.5rem;
        color: white;
        cursor: pointer;
        transition: color 0.125s ease-in-out;

        &:hover {
            color: rgb(226 105 3);
        }
    }
}

header,
section {
    margin: 0;
    padding: 0 calc((100vw - 1500px) / 2);
}

section {
    margin-top: 1em;
}

section.preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2em;

    & > h1 {
        grid-column-end: span 2;
    }

    & > div {
        display: grid;
        grid-template-columns: repeat(3, auto);

        & > a {
            display: grid;
            grid-template-columns: subgrid;
            grid-column: 1 / span 6;

            text-decoration: none;
            color: #4b64ff;
            border-bottom: 1px solid #CCCCCC;

            &:hover {
                text-decoration: underline;
            }

            & > * {
                align-self: center;
                padding: 0.65em 0;
            }
        }

    }
}

section.record {
    display: flex;
    flex-direction: column;

    & > div.tBox {
        flex-grow: 1;
        flex-shrink: 1;
        display: flex;
        flex-direction: row;

        & > div.tlBox {
            flex-grow: 6;
            flex-shrink: 6;
            display: flex;
            flex-direction: column;

            & > div.title {
                flex-grow: 0;
                flex-shrink: 0;
                display: flex;
                flex-direction: column;
            }

            & > div.description {
                flex-grow: 1;
                flex-shrink: 1;
                display: flex;
                flex-direction: column;
            }

            & h2 {
                color: gray;
                font-weight: 400;
                font-size: 0.8em;
                user-select: none;
                display: flex;
                margin: 0;

                & span {
                    margin-right: 1em;
                }
            }

            & h1,
            & p {
                margin: 0 0 1em 0;
                margin-right: 0.5em;
            }

            & h1 {
                font-size: 2em;

                & a {
                    font: var(--fa-font-solid);
                    font-size: 0.8em;
                    margin-left: 0.5em;
                    padding: 0.2em;
                    cursor: pointer;
                    text-decoration: none;
                    color: black;

                    &:hover {
                        border-radius: 0.4em;
                        background-color: black;
                        color: white;
                    }
                }
            }

            & p {
                font-size: 1.2em;
                font-weight: 400;
            }
        }

        & > div.trBox {
            flex-grow: 1;
            flex-shrink: 1;
            display: flex;
            flex-direction: column;

            & > div {
                margin: 0 0 1em 0;
                margin-right: 0.5em;
            }

            & > div.meta {
                flex-grow: 1;
                flex-shrink: 1;

                & h1 {
                    font-size: 1.3em;
                    font-weight: 500;
                    margin: 0 0 0.2em 0;
                }

                & label {
                    display: block;
                    font-weight: 500;
                }

                & > div > div {
                    padding-bottom: 0.5em;
                    font-weight: 400;
                }
            }

            & > div.related {
                flex-grow: 1;
                flex-shrink: 1;

                grid-template-columns: 1.75em 1fr;
                display: grid;

                & h1 {
                    grid-column: 1 / span 2;
                    font-size: 1.3em;
                    font-weight: 500;
                    margin: 0 0 0.2em 0;
                }

                & h2 {
                    grid-column: 1 / span 2;
                    font-size: 1.1em;
                    font-weight: 500;
                    margin: 0 0 0.1em 0;
                }

                & h2::before {
                    font: var(--fa-font-solid);
                    font-size: 0.9em;
                    margin-right: 0.5em;
                    content: '\e51e';
                }

                & > span,
                & > a {
                    grid-column: 1 / span 2;
                    display: grid;
                    grid-template-columns: subgrid;

                    & > span:first-of-type {
                        min-width: 1.75em;
                    }
                }

                & > span {
                    font-weight: 500;
                    font-style: italic;
                }

                & > a {
                    text-decoration: none;
                    color: black;
                }

                & > a:hover {
                    color: gray;
                }
            }

        }
    }

    & > div.bBox {
        flex-grow: 1;
        flex-shrink: 1;

        & table {
            & th {
                text-align: left;
            }

            & tr:not(.type):not(.language) th {
                width: 0.75em;
            }

            & tr.language {
                &:not(:first-child) th {
                    padding-top: 0.5em;
                }

                font-size: 1.2em;

                & span {
                    line-height: 1.2em;
                }

                & img {
                    margin-left: 0.1em;
                    height: 1.2em;
                    vertical-align: middle;
                }
            }

            & tr.type {
                & th {
                    padding-top: 0.125em;
                }

                & span::before {
                    font: var(--fa-font-solid);
                    margin-right: 0.5em;
                }

                &.video span::before {
                    content: '\f008';
                }

                &.audio span::before {
                    content: '\f025';
                }

                &.text span::before {
                    content: '\f02d';
                }
            }

            & tr.media {
                & td {
                    padding-top: 0.125em;
                }

                & a {
                    text-decoration: none;
                    color: black;
                }

                & a:hover {
                    color: gray;
                }

                & td.type span {
                    margin-right: 1em;
                }

                & td.link {
                    & span::after {
                        font: var(--fa-font-solid);
                        margin-left: 0.5em;
                        content: '\f0c1';
                    }
                }

                & td.download {
                    text-align: right;

                    & span::after {
                        font: var(--fa-font-solid);
                        margin-left: 0.5em;
                        content: '\f019';
                    }
                }

                & td.view span::after {
                    font: var(--fa-font-solid);
                    margin-left: 0.5em;
                    content: '\f144';
                }
            }
        }
    }
}

section.search {
    display: grid;
    grid-template-columns: 25fr 75fr;
    gap: 0 1em;

    & div.filters {
        & > * {
            display: block;
        }

        & > div.title {
            display: flex;
            align-items: center;
            justify-content: left;
            gap: 1em;
        }

        & input#apply {
            font: var(--fa-font-solid);
        }

        & > div:not(.title) {
            overflow-y: auto;
            max-height: 14.5em;
        }

        & h2 {
            & > span {
                border-bottom: 1px solid #555555;
            }

            font-size: 1.2em;
            margin: 0.5em 0;
        }

        & h3 {
            font-size: 1em;
            font-weight: 400;
            margin: 0.2em 0;
            font-style: italic;
        }

        & > select {
            height: 14em;
            width: 100%;
        }

        & > select#originator {
            height: 4em;
        }
    }

    & div.results {
        & > div.title {
            display: flex;
            align-items: center;
            justify-content: space-between;

            & > div {
                display: flex;
                flex-direction: column;
                gap: 0.5em;

                & div {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                }

                & label {
                    font-weight: 500;
                }

                & input {
                    font: var(--fa-font-solid);
                }
            }
        }

        & > div.table {
            display: grid;
            grid-template-columns: 2fr 0.85fr 0.85fr 1fr 1fr;

            & > a,
            & > div {
                display: grid;
                grid-template-columns: subgrid;
                grid-column: 1 / span 6;

                & > * {
                    align-self: center;
                    padding: 0.65em 0;
                }
            }

            & > div {
                font-weight: bold;
                border-bottom: 1px solid black;
            }

            & > a {
                text-decoration: none;
                color: #4b64ff;
                border-bottom: 1px solid #CCCCCC;

                &:hover {
                    text-decoration: underline;
                }
            }
        }

    }
}

div.mediapreview {
    &.curtain {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        backdrop-filter: blur(5px) brightness(0.5);
        display: flex;
        justify-items: center;
        align-items: center;
    }

    & div.stage {
        width: 90%;
        margin: 5%;
        max-height: 90%;

        &.centered {
            & > * {
                border-radius: 1em;
                top: 0;
                left: 0;
                width: 100%;
            }

            &.forceHeight > * {
                height: 100%;
            }
        }

        &.ebook {
            display: flex;
            gap: 0 1.5em;
            margin: 0 1.5em;
            width: 100%;
            height: 100%;

            & embedpdf-container,
            & div.content,
            & div.sections {
                background-color: white;
                border-radius: 1em;
            }

            & div.sections {
                display: none;

                & div {
                    cursor: pointer;
                    padding: 0.25em;
                    background: #eeeeee;
                }

                & div:nth-child(2n) {
                    background: #cccccc;
                }

                & div:first-child {
                    border-radius: 1em 1em 0 0;
                }

                & div:hover {
                    color: #eeeeee;
                    background: #111111;
                }
            }

            & div.content {
                flex-grow: 1;

                foliate-view::part(head) {
                    visibility: visible;
                    border-top: 1px solid black;
                    border-left: 1px solid black;
                    border-right: 1px solid black;
                    height: 10px;
                }

                foliate-view::part(foot) {
                    visibility: visible;
                    border-bottom: 1px solid black;
                    border-left: 1px solid black;
                    border-right: 1px solid black;
                    height: 10px;
                }
            }

            & div.flip {
                height: 100%;
                display: flex;
                align-items: center;
                justify-items: center;
                cursor: pointer;

                &:hover polygon {
                    fill: white;
                }

                & > svg {
                    width: 2.5em;

                    & > polygon {
                        fill: silver;
                    }
                }
            }
        }
    }
}