/**
 * Video with Title Widget
 *
 * The card shape (white area + frayed edge) is a PNG stretched over the whole
 * card via background-size: 100% 100%, so the card can grow with its content.
 */

/* 1. Layout */
.jscew-video {
    --jscew-video-text: #1a1a1a;
    --jscew-video-gap: 24px;
    --jscew-video-gap-sm: 12px;
    --jscew-video-overlay: rgba(0, 0, 0, 0.3);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--jscew-video-gap);
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 24px;
    background-image: url('video-frame.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
}

/* 2. Components */
.jscew-video__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #000;
    flex: 0 0 auto;
}

.jscew-video__player {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jscew-video__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0 !important;
    background-color: var(--jscew-video-overlay) !important;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* 160px at the design width of 790px - kept proportional on smaller cards */
.jscew-video__play-icon {
    display: block;
    width: clamp(56px, 20%, 160px);
    height: auto;
    aspect-ratio: 1 / 1;
}

.jscew-video__text {
    display: flex;
    flex-direction: column;
    gap: var(--jscew-video-gap-sm);
    width: 100%;
}

.jscew-video__title {
    margin: 0;
    color: var(--jscew-video-text);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.jscew-video__description {
    margin: 0;
    color: var(--jscew-video-text);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.25px;
    overflow-wrap: break-word;
}

.jscew-video__description p {
    margin: 0 0 0.75em;
}

.jscew-video__description > :last-child {
    margin-bottom: 0;
}

/* 3. States */
.jscew-video__play:hover,
.jscew-video__play:focus-visible {
    background-color: rgba(0, 0, 0, 0.45);
}

.jscew-video__play:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.jscew-video--playing .jscew-video__play {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .jscew-video__play {
        transition: none;
    }
}

/* 4. Responsive */
@media (max-width: 767px) {
    .jscew-video {
        padding: 16px;
    }

    .jscew-video__title {
        font-size: 22px;
    }

    .jscew-video__description {
        font-size: 17px;
    }
}
