.video {
    position: relative;
    min-width: 0;
    padding: 0 var(--container-padding) 2.5rem;
    color: var(--color-background);
    background: var(--color-accent-dark) url("../../images/gallery-decoration.png") center / cover no-repeat;
}

.video__player {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 320 / 426;
    overflow: hidden;
    background-color: var(--color-text);
}

.video__media {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center 15%;
    transform: scale(1.64);
    transform-origin: center 20%;
}

.video--started .video__media {
    object-fit: contain;
    object-position: center;
    transform: none;
}

.video__media:fullscreen {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background-color: var(--color-text);
}

.video__embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background-color: var(--color-text);
    transform: none;
}

.video__play {
    z-index: 1;
    display: grid;
    grid-area: 1 / 1;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 0;
    background: linear-gradient(transparent 80%, rgb(117 91 28 / 60%));
    border: 0;
    cursor: pointer;
    opacity: 1;
    transition:
        opacity var(--transition-panel),
        visibility var(--transition-panel);
}

.video__play-icon {
    width: clamp(7.344rem, 14vw, 12.5rem);
    height: auto;
    transition: transform var(--transition-base);
}

.video__play:focus-visible .video__play-icon {
    transform: scale(1.05);
}

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

.video__content {
    display: grid;
    gap: 1.5rem;
    padding-top: 1.25rem;
}

.video__title {
    font-size: var(--font-size-heading);
    font-weight: var(--font-weight-extrabold);
    line-height: 1.2;
}

.video__text {
    display: none;
    font-size: var(--font-size-small);
    line-height: 1.4;
    text-align: justify;
    opacity: 0.64;
}

.video__error {
    position: absolute;
    inset: auto 1rem 1rem;
    z-index: 2;
    padding: 0.75rem;
    font-size: var(--font-size-small);
    background-color: var(--color-text);
}

.video--standalone {
    padding-bottom: 0;
}

.video--standalone .video__play {
    background: transparent;
}

.video[data-video-embed] .video__player {
    aspect-ratio: 16 / 9;
}

.video[data-video-embed] .video__media {
    object-fit: contain;
    object-position: center;
    transform: none;
}

.video[data-video-embed] .video__play-icon {
    width: clamp(4rem, 10vw, 8rem);
}

@media (hover: hover) and (pointer: fine) {
    .video__play:hover .video__play-icon {
        transform: scale(1.05);
    }
}

@media (min-width: 48rem) {
    .video__player {
        aspect-ratio: 1400 / 640;
    }

    .video__media {
        transform: scale(1.27);
    }

    .video__content {
        padding-top: 2.5rem;
    }

    .video__text {
        display: block;
    }

    .video--standalone .video__player {
        aspect-ratio: 1400 / 879;
    }

    .video--standalone .video__media {
        object-position: center;
        transform-origin: center 25%;
    }
}

@media (min-width: 64rem) {
    .video {
        padding-bottom: 3.5rem;
    }

    .video--standalone {
        padding-bottom: 0;
    }

    .video__content {
        grid-template-columns: 3fr 5fr;
        align-items: center;
        gap: 1.25rem;
    }
}
