
.mv {
    --mv-radius: var(--neo-radius);
    display: grid;
    gap: 1.25rem;
    font-family: var(--font-iransans);
}

.mv > * {
    min-width: 0;
}


.mv-single {
    width: 100%;
    max-width: 58rem;
    margin-inline: auto;
}

@media (min-width: 1024px) {
    .mv {
        grid-template-columns: minmax(0, 1fr) 19rem;
        align-items: start;
    }
}


.mv-viewport {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--neo-surface-soft);
    overflow: hidden;
    outline-offset: -2px;
}

@media (min-width: 640px) {
    .mv-viewport {
        aspect-ratio: 16 / 10;
    }
}

.mv-viewport:focus-visible {
    outline: 3px solid var(--neo-accent);
    outline-offset: 3px;
}

.mv-skeleton {
    position: absolute;
    inset: 0;
    background: color-mix(in oklab, var(--neo-primary) 8%, transparent);
    background-size: 200% 100%;
    animation: mv-shimmer 1.4s linear infinite;
    pointer-events: none;
}

.mv-viewport.is-loaded .mv-skeleton {
    display: none;
}

@keyframes mv-shimmer {
    from {
        background-position: 180% 0;
    }
    to {
        background-position: -80% 0;
    }
}

.mv-media {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

video.mv-media {
    background: var(--neo-ink);
}

.mv-nav,
.mv-expand {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--neo-radius);
    background: var(--neo-surface);
    border: var(--neo-border) solid var(--neo-ink);
    box-shadow: var(--neo-shadow-small);
    backdrop-filter: blur(6px);
    transition: transform 0.16s ease, background 0.16s ease;
    z-index: 2;
}

.mv-nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.3rem;
}

.mv-nav:hover,
.mv-expand:hover {
    transform: scale(1.07);
}

.mv-prev {
    inset-inline-start: 0.75rem;
}

.mv-next {
    inset-inline-end: 0.75rem;
}

.mv-expand {
    top: auto;
    bottom: 0.75rem;
    inset-inline-end: 0.75rem;
    translate: none;
    width: 2rem;
    height: 2rem;
    font-size: 1.05rem;
}

.mv-countbadge {
    position: absolute;
    bottom: 0.75rem;
    inset-inline-start: 0.75rem;
    z-index: 2;
}

.mv-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: var(--neo-border) solid var(--neo-ink);
}

.mv-bar > * {
    min-width: 0;
}

.mv-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.5;
}

.mv-title {
    margin-top: 0.15rem;
    font-weight: 900;
    font-size: 1.15rem;
    line-height: 1.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mv-caption {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    opacity: 0.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mv-actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

@media (max-width: 639px) {
    .mv-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .mv-actions {
        width: 100%;
    }
    .mv-actions > * {
        flex: 1 1 0;
    }
}


.mv-stripwrap {
    padding: 1rem;
}

.mv-striphead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.mv-striptitle {
    font-weight: 900;
}

.mv-stripicon {
    font-size: 1.2rem;
    color: var(--neo-primary);
}

.mv-strip {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

@media (min-width: 1024px) {
    .mv-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 30rem;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

.mv-thumb {
    position: relative;
    flex: 0 0 6.5rem;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--neo-radius);
    border: var(--neo-border) solid transparent;
    background: var(--neo-surface-soft);
    scroll-snap-align: start;
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.mv-thumb:hover {
    transform: translateY(-2px);
}

.mv-thumb.is-active {
    border-color: var(--neo-primary);
    box-shadow: var(--neo-shadow-small);
}

.mv-thumbimg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
    transition: opacity 0.16s ease;
}

.mv-thumb:hover .mv-thumbimg,
.mv-thumb.is-active .mv-thumbimg {
    opacity: 1;
}

.mv-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--color-primary-content);
    text-shadow: var(--neo-shadow-small);
    pointer-events: none;
}

.mv-thumbcap {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 0.2rem 0.4rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--neo-surface);
    background: color-mix(in oklab, var(--neo-ink) 60%, transparent);
    pointer-events: none;
}


.mv-lightbox[hidden] {
    display: none;
}


.mv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60000;
}

.mv-lb-backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in oklab, var(--neo-ink) 92%, transparent);
}

.mv-lb-box {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3.5rem 1rem 1rem;
}

.mv-lb-mediawrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    max-width: min(72rem, 100%);
    width: 100%;
    flex: 1 1 auto;
    overflow: auto;
}

.mv-lb-mediawrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--neo-radius);
    cursor: zoom-in;
}

.mv-lb-mediawrap.is-zoomed img {
    max-width: none;
    width: 160%;
    max-height: none;
    cursor: zoom-out;
}

.mv-lb-mediawrap video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--neo-radius);
    background: var(--neo-ink);
}

.mv-lb-foot {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    color: var(--neo-surface);
    max-width: 100%;
    min-width: 0;
}

.mv-lb-count {
    font-size: 0.8rem;
    opacity: 0.7;
    white-space: nowrap;
}

.mv-lb-title {
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.mv-lb-tools {
    position: absolute;
    top: 0.9rem;
    inset-inline-end: 0.9rem;
    display: flex;
    gap: 0.5rem;
}

.mv-lb-btn {
    background: var(--neo-surface);
    border: var(--neo-border) solid var(--neo-ink);
    color: var(--neo-text);
    box-shadow: var(--neo-shadow-small);
}

.mv-lb-btn:hover {
    background: var(--neo-accent);
    color: var(--neo-ink);
}

.mv-lb-nav {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    background: var(--neo-surface);
    border: var(--neo-border) solid var(--neo-ink);
    color: var(--neo-text);
    box-shadow: var(--neo-shadow-small);
}

.mv-lb-prev {
    inset-inline-start: 0.75rem;
}

.mv-lb-next {
    inset-inline-end: 0.75rem;
}

@media (max-width: 639px) {
    .mv-lb-nav {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mv-skeleton {
        animation: none;
    }
    .mv-thumb,
    .mv-nav,
    .mv-expand {
        transition: none;
    }
}


.mv,
.mv * {
    -webkit-tap-highlight-color: transparent;
}

.mv button:focus-visible,
.mv a:focus-visible,
.mv [tabindex]:focus-visible,
.mv-lightbox button:focus-visible,
.mv-lightbox a:focus-visible {
    outline: 3px solid var(--neo-accent, #facc15);
    outline-offset: 3px;
    z-index: 5;
}

.mv-nav,
.mv-expand,
.mv-lb-btn,
.mv-lb-nav {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.mv-nav:active,
.mv-expand:active,
.mv-lb-btn:active,
.mv-lb-nav:active {
    transform: translateY(2px);
    box-shadow: none;
}

.mv-viewport {
    isolation: isolate;
    touch-action: pan-y;
}

.mv-skeleton {
    z-index: 0;
    background-image: linear-gradient(
        100deg,
        transparent 20%,
        color-mix(in oklab, var(--neo-primary) 12%, transparent) 45%,
        transparent 70%
    );
}

.mv-media {
    z-index: 1;
}

.mv-viewport.is-loaded .mv-skeleton {
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.mv-thumb {
    cursor: pointer;
    flex-shrink: 0;
}

.mv-thumb:focus-visible {
    outline-offset: 2px;
}

.mv-strip {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.mv-lb-mediawrap {
    overscroll-behavior: contain;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
}

.mv-lb-mediawrap img,
.mv-lb-mediawrap video {
    display: block;
    flex-shrink: 0;
}

.mv-lb-mediawrap img {
    max-width: 100%;
    max-height: 100%;
    transition: width .2s ease, max-width .2s ease;
}

.mv-lb-mediawrap.is-zoomed {
    justify-content: flex-start;
    align-items: flex-start;
    cursor: grab;
}

.mv-lb-mediawrap.is-zoomed img {
    width: 160%;
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.mv-lb-mediawrap.is-error::after {
    content: "بارگذاری ویدئو ناموفق بود";
    color: var(--neo-surface, #fff);
    font-weight: 800;
    text-align: center;
    padding: 1rem;
}

.mv-lightbox {
    overscroll-behavior: contain;
}

.mv-lb-box {
    min-height: 0;
    min-width: 0;
}

.mv-lb-tools,
.mv-lb-nav {
    z-index: 3;
}

.mv-lb-btn,
.mv-lb-nav {
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.mv-lb-foot {
    z-index: 2;
}

@media (max-width: 639px) {
    .mv {
        gap: .85rem;
    }

    .mv-viewport {
        aspect-ratio: 4 / 3;
        min-height: 12rem;
    }

    .mv-bar {
        padding: .85rem;
        gap: .75rem;
    }

    .mv-title {
        font-size: 1rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .mv-caption {
        white-space: normal;
    }

    .mv-stripwrap {
        padding: .75rem;
    }

    .mv-thumb {
        flex-basis: 5.5rem;
    }

    .mv-lb-box {
        padding: 4rem .5rem 1rem;
        gap: .5rem;
    }

    .mv-lb-mediawrap {
        max-width: 100%;
    }

    .mv-lb-tools {
        top: .65rem;
        inset-inline-end: .65rem;
    }

    .mv-lb-btn {
        min-width: 2.5rem;
        min-height: 2.5rem;
    }

    .mv-lb-foot {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (min-width: 1024px) {
    .mv-strip {
        overscroll-behavior: contain;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mv *,
    .mv-lightbox *,
    .mv *::before,
    .mv *::after,
    .mv-lightbox *::before,
    .mv-lightbox *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
