{namespace media=Neos\Media\ViewHelpers}
{namespace neos=Neos\Neos\ViewHelpers}
{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<neos:contentElement.wrap node="{node}">
    <figure class="c-hero">
        <video class="c-hero__video" sizes="(max-width: 1920px) 100vw, 1920px" autoplay loop muted preload="auto"
            poster="{neos.media:uri.image(image: heroVideoPoster, maximumWidth: 1600)}">
            <source src="{f:uri.resource(resource: heroVideo.resource)}" type="video/mp4">
        </video>

        <f:if condition="{neos:rendering.inBackend()} || {heroTitle}">
            <figcaption class="c-hero__text">
                {neos:contentElement.editable(property: 'heroTitle', tag: 'h2', class: 'c-hero__title')}
                <f:if condition="{neos:rendering.inBackend()} || {heroSubtitle}">
                    {neos:contentElement.editable(property: 'heroSubtitle', tag: 'p', class: 'c-hero__subtitle')}
                </f:if>
            </figcaption>
        </f:if>
    </figure>
</neos:contentElement.wrap>
