/*
 * Header video (EconcessVideoTagRenderer, mode "hero"), start page spacing and mobile header.
 */

/* ---------- Header video ---------- */

/* Placeholder colour until the poster image is there, instead of an empty/black box */
.video-hero .embed {
    background-color: #26303b;
}

.video-hero .video-hero-poster,
.video-hero .video-hero-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.video-hero .video-hero-video {
    object-fit: cover;
}

/* The class on <html> is set by the inline script next to the video. Without JavaScript
   the video is simply shown from the start. */
.econcess-media-js .video-hero .video-hero-video {
    opacity: 0;
    transition: opacity .6s ease;
}

.econcess-media-js .video-hero .video-hero-video.is-playing {
    opacity: 1;
}

/* Safety net: never show native controls on the background video */
.video-hero .video-hero-video::-webkit-media-controls,
.video-hero .video-hero-video::-webkit-media-controls-enclosure {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .econcess-media-js .video-hero .video-hero-video {
        transition: none;
    }
}

/* No empty space below the banner: the textmedia element has no text, only the video */
.textmedia:has(.video-hero) {
    gap: 0;
    margin-bottom: 0;
}

.textmedia:has(.video-hero) > .textmedia-text:not(:has(*)) {
    display: none;
}

.textmedia:has(.video-hero) .gallery-row,
.textmedia:has(.video-hero) .gallery-item,
.textmedia:has(.video-hero) figure.video {
    margin-bottom: 0;
}

/* ---------- Mobile ---------- */

@media (max-width: 767.98px) {
    /* First content element directly below the banner: no extra outer space on small screens */
    .backendlayout-start_page .main-section > .frame:first-child {
        margin-top: 0;
    }
}

/* Mobile header (shown below 1400px): readable logo with some distance to the search field */
@media (max-width: 1399.98px) {
    html body .mobileHeader .mobileLogoSm {
        flex: 0 0 90px;
        width: 90px;
        min-width: 90px;
        display: flex;
        align-items: center;
    }

    html body .mobileHeader .mobileSearchSm {
        flex: 1 1 auto;
        min-width: 0;
    }

    html body .mobileHeader .mobileLogoSm .navbar-brand-image {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        height: auto;
        width: auto;
    }

    /* Logo SVG is 300x107: 32px high = approx. 90px wide (before: 16px high) */
    html body .mobileHeader .mobileLogoSm .navbar-brand-image img {
        position: static;
        top: auto;
        transform: none;
        flex: 0 0 auto;
        height: 32px;
        width: 90px;
        max-height: none;
        max-width: none;
    }

    html body .mobileHeader .mobileSearchSm form {
        flex: 1 1 auto;
        width: 100%;
        justify-content: flex-end;
    }

    /* Search field takes the remaining width, with a clear distance to the logo */
    html body .mobileHeader .mobileSearchSmSearch {
        flex: 1 1 auto;
        display: flex;
        margin-left: 14px;
        min-width: 0;
        max-width: 280px;
    }

    /* The submit button sits next to the field (not on top of it), so the 40px right padding
       from the general header styles only takes away typing space. */
    html body .mobileHeader .mobileSearchSmSearch input {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        padding-right: 8px !important;
    }
}

@media (max-width: 359.98px) {
    html body .mobileHeader .mobileLogoSm {
        flex-basis: 76px;
        width: 76px;
        min-width: 76px;
    }

    html body .mobileHeader .mobileLogoSm .navbar-brand-image img {
        height: 27px;
        width: 76px;
    }

    html body .mobileHeader .mobileSearchSmSearch {
        margin-left: 10px;
    }
}
