@php
    $playerImage = $backdropUrl ?: $posterUrl;
    $playerTarget = optional($playerAd)->target_url;
@endphp

<section class="catalog-player" aria-label="{{ $title }} sponsored player">
    <img class="catalog-player-image" src="{{ $playerImage }}" alt="{{ $title }} backdrop">
    <span class="catalog-player-shade" aria-hidden="true"></span>

    @if ($playerTarget)
        <a class="catalog-player-link" href="{{ $playerTarget }}" target="_blank" rel="sponsored nofollow noopener" aria-label="Watch {{ $title }}">
            <span class="catalog-play-button" aria-hidden="true"><i></i></span>
            <span class="catalog-player-caption">Click to watch</span>
        </a>
    @else
        <div class="catalog-player-link is-disabled" aria-label="Player sponsored action link is not configured">
            <span class="catalog-play-button" aria-hidden="true"><i></i></span>
            <span class="catalog-player-caption">Player link is not configured</span>
        </div>
    @endif

    <div class="catalog-player-bottom">
        <div>
            <small>{{ $typeLabel ?? 'Now showing' }}</small>
            <strong>{{ $title }}</strong>
        </div>
        @if ($playerTarget)
            <span class="catalog-watch-pill">Watch now <b>↗</b></span>
        @endif
    </div>
</section>
