#medien {
}

:root {
    --media-anim: 300ms;
}

.gallery {
    height: 300px;
}

.gallery .swiper-slide > * {
    height: 100%;
    width: auto;
    display: block;
    border-radius: 8px;
    transition: all var(--transition);
    transform: scale(0.95);
    border: 1px solid transparent;
}

.gallery .swiper-slide > *:hover {
    transform: scale(1);
    border: 1px solid var(--accent);
}

.swiper-wrapper {
    align-items: center;
}

.swiper-slide {
    width: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
}

.media-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px) saturate(30%);
    opacity: 0;
    transition: opacity var(--media-anim) ease;
    z-index: 1;
}

.media-backdrop.is-visible {
    opacity: 1;
}

.media-preview-layer {
    position: fixed;
    z-index: 2;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: top var(--media-anim) ease, left var(--media-anim) ease, width var(--media-anim) ease, height var(--media-anim) ease;
}

.media-full-layer {
    position: fixed;
    z-index: 3;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--media-anim) ease;
}

.media-full-layer.is-visible {
    opacity: 1;
}

.media-video-layer {
    position: fixed;
    z-index: 3;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--media-anim) ease;
    background: #000;
}

.media-video-layer.is-visible {
    opacity: 1;
}

.media-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4;
    padding: 0.35rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.media-close img {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .gallery {
        height: 220px;
    }

    .gallery .swiper-slide > * {
        max-width: 80vw;
    }

    .media-close {
        top: 12px;
        right: 12px;
    }
}
