/* Domain feature: video preview card and accessible player modal. */
.video-preview-card {
    overflow: hidden;
}

.video-preview-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    width: calc(100% + 2.75rem);
    margin: -1.375rem -1.375rem 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    aspect-ratio: 16 / 9;
    background: var(--color-accent-light);
    cursor: pointer;
}

.video-preview-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.video-preview-card__media:hover img {
    transform: scale(1.035);
}

.video-preview-card__placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-accent), var(--color-text-primary));
}

.video-preview-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border-radius: 50%;
    background: var(--color-bg-card-strong);
    color: var(--color-accent);
    box-shadow: var(--shadow-card);
    transform: translate(-50%, -50%);
}

.video-preview-card__play svg {
    width: 1.65rem;
    height: 1.65rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.video-preview-card__action {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.video-modal[hidden] {
    display: none;
}

.video-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    padding: 1.5rem;
    place-items: center;
}

.video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 19, 29, 0.82);
}

.video-modal__dialog {
    position: relative;
    width: min(960px, 100%);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    background: var(--color-text-primary);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

.video-modal__title {
    margin: 0.2rem 3rem 0.8rem 0.25rem;
    color: var(--color-text-inverse);
    font-size: 1rem;
}

.video-modal__close {
    position: absolute;
    top: 0.55rem;
    right: 0.7rem;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-inverse);
    cursor: pointer;
}

.video-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.video-modal__close svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.video-modal__player {
    display: block;
    width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-sm);
    background: #000;
}

.video-modal-open {
    overflow: hidden;
}

html.a11y .video-preview-card__media:hover img {
    transform: none;
}

@media (max-width: 639px) {
    .video-modal {
        padding: 0.75rem;
    }

    .video-modal__dialog {
        padding: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-preview-card,
    .video-preview-card__media img,
    .video-preview-card .material-card__link {
        transition: none;
    }

    .video-preview-card:hover,
    .video-preview-card__media:hover img {
        transform: none;
    }
}
