/* Snippets (MGCS-344): a vertical pager of short videos, one per screen.
   The pager is the scroll container and snaps a slide at a time; the page itself never
   scrolls, so a flick moves exactly one snippet on a phone and with a wheel. */
.snip-page { position: relative; }
.snip-pager {
    height: calc(100vh - var(--snip-chrome, 64px));
    height: calc(100dvh - var(--snip-chrome, 64px));
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
    outline: none;
}
.snip-pager::-webkit-scrollbar { display: none; }

.snip-slide {
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--mu-space-md);
    padding: var(--mu-space-sm);
    box-sizing: border-box;
}

/* The video's box keeps the snippet's own shape and never exceeds the slide. */
.snip-stage {
    position: relative;
    height: 100%;
    max-width: 100%;
    aspect-ratio: var(--snip-ratio, 9 / 16);
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    flex: 0 1 auto;
}
.snip-stage video, .snip-stage .snip-poster {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; display: block; background: #000;
}
.snip-stage .snip-poster { object-fit: cover; }

/* Canvas elements drawn over the video: a fixed 720x1280 drawing, scaled to the stage. */
.snip-overlay { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }

.snip-tap { position: absolute; inset: 0; background: none; border: 0; padding: 0; cursor: pointer; }
.snip-tap:focus-visible { outline: 3px solid var(--mu-primary); outline-offset: -3px; }
.snip-paused { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; font-size: 3rem; color: rgba(255, 255, 255, 0.85); }
.snip-slide[data-paused="1"] .snip-paused { display: flex; }

.snip-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.2); }
.snip-progress > span { display: block; height: 100%; width: 0; background: var(--mu-primary); }

.snip-caption {
    position: absolute; left: 0; right: 0; bottom: 3px;
    padding: 2.5rem 0.9rem 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
    color: #fff; pointer-events: none;
}
.snip-caption a { pointer-events: auto; color: #fff; font-weight: 700; text-decoration: none; }
.snip-caption a:hover, .snip-caption a:focus-visible { text-decoration: underline; }
.snip-caption h2 { font-size: 1rem; margin: 0.15rem 0 0; color: #fff; overflow-wrap: anywhere; }
.snip-caption p { font-size: 0.85rem; margin: 0.15rem 0 0; opacity: 0.9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

.snip-actions { display: flex; flex-direction: column; gap: var(--mu-space-sm); align-items: center; flex: 0 0 auto; }
.snip-act {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 48px; min-height: 48px; padding: 6px;
    background: rgba(10, 12, 30, 0.6); border: 1px solid var(--mu-border-color); border-radius: 12px;
    color: var(--mu-text-muted, #9a9abf); cursor: pointer; font-size: 0.75rem;
}
.snip-act i { font-size: 1.15rem; }
.snip-act:hover, .snip-act:focus-visible { border-color: var(--mu-primary); color: var(--mu-text); }
.snip-act[data-liked="1"] { color: var(--mu-primary); }
.snip-views { font-size: 0.75rem; color: var(--mu-text-muted, #9a9abf); text-align: center; }

.snip-nav { position: absolute; right: var(--mu-space-md); bottom: var(--mu-space-md); display: flex; flex-direction: column; gap: 6px; }
.snip-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--mu-space-sm); padding: var(--mu-space-lg); }

/* A phone: the actions sit over the video's right edge so the video keeps the full width. */
@media (max-width: 640px) {
    .snip-slide { padding: 0; gap: 0; position: relative; }
    .snip-stage { border-radius: 0; width: 100%; height: 100%; aspect-ratio: auto; }
    .snip-actions { position: absolute; right: 8px; bottom: 96px; }
    .snip-caption { padding-right: 4.5rem; }
    .snip-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .snip-pager { scroll-behavior: auto; }
}

/* The upload page. */
.snip-upload { max-width: 560px; }
.snip-drop { border: 2px dashed var(--mu-border-color); border-radius: 12px; padding: var(--mu-space-lg); text-align: center; }
.snip-drop:focus-within, .snip-drop[data-over="1"] { border-color: var(--mu-primary); }
.snip-bar { height: 8px; border-radius: 4px; background: var(--mu-surface); overflow: hidden; }
.snip-bar > span { display: block; height: 100%; width: 0; background: var(--mu-primary); transition: width 200ms linear; }
.snip-mine { display: flex; flex-wrap: wrap; gap: var(--mu-space-sm); align-items: center; padding: var(--mu-space-sm) 0; border-top: 1px solid var(--mu-border-color); }
.snip-mine > div { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
