﻿.layerbox {
    max-height: 500px;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    overflow: hidden;
    margin-top: -26px;
}

/* Apply a negative margin in "mobile mode" to compensate for the fact that our
   CSS template is a useless pile of garbage. */
@media (max-width: 769px) {
    .layerbox {
        margin-left: -15px;
        margin-right: -15px;
    }
}
@media (min-width: 770px) and (max-width: 799px) {
    .layerbox {
        margin-left: -30px;
        margin-right: -30px;
    }
}

.layerbox video {
    display: block;
}

.layerbox>*:first-child {
    position: relative;
    left: 50%;
    top: 50%;
    transform: translate(-50%, 0);
}

.layerbox>*:not(:first-child) {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

.fade-in-layer {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadein 5s;
}

.fade-in-layer * {
    animation: fadein 2s;
}

@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}