/* Video and custom media player. Loaded after main.css and news.css on news/zbuild.html */

.post-video {
    margin: 0 0 48px;
    overflow: hidden;
    border-radius: 20px;
    background: #111;
}

.post-video video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
}

/* custom player (shown once main.js has taken over from the native controls) */
.player {
    position: relative;
    isolation: isolate;
}

.player-big,
.player-bar {
    display: none;
}

.player.is-ready video {
    cursor: pointer;
}

.player.is-ready .player-big {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

.player-big svg {
    width: 26px;
    height: 26px;
    margin-left: 2px;
}

.player.is-ready .player-big:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.06);
}

.player.is-playing .player-big {
    opacity: 0;
    pointer-events: none;
}

.player.is-ready .player-bar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 64px 22px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease);
}

.player.is-ready:not(.is-playing) .player-bar,
.player.is-ready.is-active .player-bar,
.player.is-ready:has(:focus-visible) .player-bar {
    opacity: 1;
    pointer-events: auto;
}

.player-track {
    position: relative;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    touch-action: none;
    transition: height 0.15s var(--ease);
}

.player-track::before {
    content: "";
    position: absolute;
    inset: -10px 0;
}

.player-track:hover,
.player.is-seeking .player-track {
    height: 6px;
}

.player-track:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.player-buffer,
.player-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    border-radius: inherit;
}

.player-buffer {
    background: rgba(255, 255, 255, 0.3);
}

.player-fill {
    background: rgba(255, 255, 255, 0.85);
}

.player-row {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
}

.player-bar button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s var(--ease);
}

.player-bar button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.player-bar button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.player-bar button[hidden] {
    display: none;
}

.player-bar svg {
    width: 22px;
    height: 22px;
}

.player-time {
    margin-left: auto;
    padding-right: 8px;
    color: #fff;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.player-play .i-pause,
.player.is-playing .player-play .i-play {
    display: none;
}

.player.is-playing .player-play .i-pause {
    display: block;
}

.player-mute .i-muted {
    display: none;
}

.player.is-muted .player-mute .i-vol {
    display: none;
}

.player.is-muted .player-mute .i-muted {
    display: block;
}

.player:fullscreen {
    display: flex;
    align-items: center;
    border-radius: 0;
    background: #000;
}

.player:fullscreen video {
    height: 100%;
    aspect-ratio: auto;
}

.player:-webkit-full-screen {
    display: flex;
    align-items: center;
    border-radius: 0;
    background: #000;
}

.player:-webkit-full-screen video {
    height: 100%;
    aspect-ratio: auto;
}

@media (max-width: 640px) {
    .player.is-ready .player-big {
        width: 56px;
        height: 56px;
        margin: -28px 0 0 -28px;
    }

    .player.is-ready .player-bar {
        padding: 48px 14px 8px;
    }

    .player-time {
        font-size: 13px;
    }
}