/*
 * Shell A — Fullscreen Video Layout
 * Used by: Home feed, Category feed, Post detail, Public profile feed
 * ------------------------------------------------------------------- */

/* Root container — fixed, fills viewport */
.shell-video {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #000;
    touch-action: none;
    /* feed.js owns all touch events */
}

/* ── Video element ── */
.shell-video__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* ── Gradient scrims ── */
.shell-video__scrim-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: var(--vp-overlay-scrim-top);
    pointer-events: none;
    z-index: 10;
}

.shell-video__scrim-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: var(--vp-overlay-scrim-bottom);
    pointer-events: none;
    z-index: 10;
}

/* ── Top bar ── */
.shell-video__top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-top: calc(var(--vp-safe-top) + 8px);
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.shell-video__top-bar.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Right-side action stack ── */
.shell-video__action-stack {
    position: absolute;
    right: var(--vp-action-stack-right);
    bottom: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.shell-video__action-stack.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Bottom metadata ── */
.shell-video__bottom-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    /* leave room for action stack */
    right: 72px;
    padding-bottom: calc(var(--vp-safe-bottom) + 16px);
    padding-left: 16px;
    padding-right: 16px;
    z-index: 20;
}

/* ── Expanded metadata sheet ── */
.shell-video__meta-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 60dvh;
    background: hsl(var(--card));
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 30;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(var(--vp-safe-bottom) + 24px);
    transform: translateY(100%);
    transition: transform 0.35s var(--vp-ease-swipe);
}

.shell-video__meta-sheet.is-open {
    transform: translateY(0);
}

.shell-video__meta-sheet__handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
}

.shell-video__meta-sheet__handle::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: hsl(var(--muted-foreground) / 0.4);
}

/* ── Loading state ── */
.shell-video__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 25;
}

/* ── Desktop centering ── */
@media (min-width: 640px) {

    .shell-video__video,
    .shell-video__scrim-top,
    .shell-video__scrim-bottom {
        left: 50%;
        transform: translateX(-50%);
        width: var(--vp-feed-max-width);
    }

    /* Desktop blurred background fill */
    .shell-video::before {
        content: '';
        position: absolute;
        inset: 0;
        background: inherit;
        filter: blur(40px) brightness(0.4);
        z-index: 0;
    }

    .shell-video__bottom-meta {
        left: 50%;
        transform: translateX(-50%);
        width: var(--vp-feed-max-width);
        right: auto;
        padding-right: calc(72px + 16px);
    }

    .shell-video__action-stack {
        right: calc(50% - var(--vp-feed-max-width) / 2 + var(--vp-action-stack-right));
    }
}