/**
 * ==========================================================
 * Ueberdiek Ocean
 * Datei: videos.css
 * Version: 0.7.4
 * Video-Modul 1.0
 * ==========================================================
 */

/*
|--------------------------------------------------------------------------
| Videoübersicht
|--------------------------------------------------------------------------
*/

.videos {
    padding: 4rem 0;
}

.video-grid {
    display: grid;
    gap: 4rem;
}

.video-card {
    overflow: hidden;
}

.video-card__button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.video-card__button:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 6px;
    border-radius: 12px;
}

.video-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
}

.video-card__thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.video-card:hover .video-card__thumbnail,
.video-card__button:focus-visible .video-card__thumbnail {
    transform: scale(1.03);
}

.video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .88);
    color: #111;
    font-size: 2rem;
    line-height: 1;
    transform: translate(-50%, -50%);
    transition:
        transform .25s ease,
        background-color .25s ease;
    pointer-events: none;
}

.video-card:hover .video-card__play,
.video-card__button:focus-visible .video-card__play {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}

.video-card__content {
    margin-top: 1.5rem;
}

.video-card__title {
    margin: 0 0 .5rem;
}

.video-card__meta {
    margin: 0;
    opacity: .75;
}

/*
|--------------------------------------------------------------------------
| Overlay
|--------------------------------------------------------------------------
*/

body.video-overlay-open {
    overflow: hidden;
}

.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 3rem);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: #000;
    transition:
        opacity .25s ease,
        visibility 0s linear .25s;
}

.video-overlay--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.video-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: #000;
}

.video-overlay__content {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100vw - 2rem));
    max-width: 100%;
    padding: 0;
    background: #000;
    transform: translateY(10px) scale(.99);
    transition: transform .25s ease;
}

.video-overlay--open .video-overlay__content {
    transform: translateY(0) scale(1);
}

/*
|--------------------------------------------------------------------------
| Einheitlicher Player
|--------------------------------------------------------------------------
*/

.video-overlay__player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.video-overlay__video,
.video-overlay__embed,
.video-overlay__embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.video-overlay__video {
    object-fit: contain;
}

.video-overlay__embed iframe {
    aspect-ratio: 16 / 9;
}

.video-overlay__video[hidden],
.video-overlay__embed[hidden] {
    display: none !important;
}

/*
|--------------------------------------------------------------------------
| Schließen
|--------------------------------------------------------------------------
*/

.video-overlay__close {
    position: fixed;
    z-index: 100001;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    color: #111;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
    transition:
        transform .2s ease,
        background-color .2s ease;
}

.video-overlay__close:hover {
    background: #fff;
    transform: scale(1.06);
}

.video-overlay__close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 768px) {
    .videos {
        padding: 2.5rem 0;
    }

    .video-grid {
        gap: 2.5rem;
    }

    .video-card__play {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .video-overlay {
        padding: .5rem;
    }

    .video-overlay__content {
        width: min(100%, calc(100vw - 1rem));
    }

    .video-overlay__close {
        top: max(.75rem, env(safe-area-inset-top));
        right: max(.75rem, env(safe-area-inset-right));
        width: 44px;
        height: 44px;
        font-size: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-card__thumbnail,
    .video-card__play,
    .video-overlay,
    .video-overlay__content,
    .video-overlay__close {
        transition: none;
    }
}
