/* Unfallmeldungen DE -- /video/ shorts feed
 *
 * Was inline in page-video.php. Enqueued as "umde-page-video" only when that
 * template renders, so no other page pays for it.
 */
/* Shorts feed (video page only)
   -----------------------------
   was page-video.php:157-335 */
.video-shorts-main {
    margin: 0;
    padding: 0;
}

/* ---- Mobile (default): feed pinned below the header, the only scroller.
   Fixed box => the page can't scroll behind it (iOS-safe) and the header
   stays visible above, so the title + sound are never hidden under it. ---- */
.shorts-stage {
    position: fixed;
    top: var(--shorts-hh, 110px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.shorts-feed {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    background: #000;
}

.shorts-feed::-webkit-scrollbar {
    display: none;
}

.shorts-item {
    position: relative;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.shorts-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
}

.shorts-back {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    z-index: 100000000;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    color: #fff;
    text-decoration: none;
    background: rgba(0, 0, 0, .45);
    border-radius: 50%;
}

.shorts-playpause {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 2;
}

.shorts-item.is-paused .shorts-playpause::after {
    content: "\25B6";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

/* Title + time + CTA: top-left corner. */
.shorts-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    line-height: 1.3;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 64px 26px 14px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .42) 55%, transparent 100%);
    color: #fff;
    pointer-events: none;
}

.shorts-headline {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
    pointer-events: auto;
}

.shorts-time {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
}

.shorts-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 11px 20px;
    background: #e3000f;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border-radius: 26px;
    text-decoration: none;
    pointer-events: auto;
}

.shorts-cta:hover {
    background: #c00;
}

/* Big, thumb-friendly sound control. */
.shorts-sound {
    position: absolute;
    right: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    z-index: 4;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.shorts-sound:active {
    transform: scale(.94);
}

.shorts-item--ad {
    flex-direction: column;
    background: #000;
}

.shorts-ad-label {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    font-size: 11px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
    background: rgba(0, 0, 0, .4);
    padding: 2px 8px;
    border-radius: 4px;
}

.shorts-rail {
    display: none;
}

.shorts-empty-wrap {
    background: #fff;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-empty {
    padding: 24px;
    color: #666;
}

/* ---- Desktop: same fixed-below-header stage, plus side ad rails ---- */
@media (min-width: 1025px) {
    .shorts-stage {
        gap: 24px;
        padding: 0 16px;
    }

    .shorts-feed {
        flex: 0 0 auto;
        width: clamp(700px, 62vw, 1040px);
        height: 100%;
    }

    .shorts-item {
        height: 100%;
    }

    .shorts-back {
        display: none;
    }

    .shorts-item--ad {
        display: none;
    }

    /* desktop uses the side rails */
    .shorts-rail {
        display: flex;
        flex: 1 1 0;
        max-width: 300px;
        align-items: center;
        justify-content: center;
    }

    .shorts-rail-ad {
        min-height: 250px;
    }
}

