@php
$projects = $block->projects()
    ->full()
    ->where('status', 'published')
    ->where('lang_status', 'published')
    ->orderBy('block_project.position')
    ->get();
$projectOne = $projects->get(0);
$projectTwo = $projects->get(1);
$projectThree = $projects->get(2);
@endphp
<div class="featured-projects featured-three-items block-margin-top--{{ $block->margin_type_top }} block-margin-bottom--{{$block->margin_type_bottom}}">
    @if ($block->anchor_id )
        <div id="{{ $block->anchor_id }}" class="anchor-offset"></div>
    @endif
    <div class="featured-three-items__container">
        <div class="featured-three-items__featured">
            {{-- <div class="featured-three-items__background"></div> --}}
            <div class="featured-three-items__background-white" data-aos="simplefade" data-aos-once="true" data-aos-delay="500"></div>

            <div class="featured-three-items__wrapper" data-aos="fade-up" data-aos-once="true" data-aos-delay="700">
                <h2 class="featured-three-items__title">
                    @title($block->block_title)
                </h2>
                <p class="featured-three-items__subtitle">
                    @title($block->block_subtitle)
                </p>

                @isset($projectOne)
                    <div class="featured-three-items__container-info" data-role="cta-block">
                        <div class="featured-three-items__featured-image" data-action="click-cta">
                            @if($projectOne->overviewImage)
                                <picture>
                                    <source media="(min-width: 768px)" srcset="{{ getMediaUrl($projectOne->overviewImage->filename, '1180x640') }}.webp" type="image/webp">
                                    <source media="(min-width: 768px)" srcset="{{ getMediaUrl($projectOne->overviewImage->filename, '1180x640') }}">
                                    <source srcset="{{ getMediaUrl($projectOne->overviewImage->filename, '600x600') }}.webp" type="image/webp">
                                    <img src="{{ getMediaUrl($projectOne->overviewImage->filename, '600x600') }}" alt="{{ htmlentities($projectOne->title) }}">
                                </picture>
                                <!--
                                <img src="{{ getMediaUrl($projectOne->overviewImage->filename, '1180x640') }}" alt="{{ htmlentities($projectOne->title) }}" />
                                -->
                            @endif
                        </div>
                        <div class="featured-three-items__featured-block">
                            <span class="featured-three-items__featured-pretitle">
                                @if(!empty($projectOne->country->title))
                                    {{ $projectOne->country->title }}
                                @endif
                            </span>

                            <h2 class="featured-three-items__featured-title" data-action="click-cta">
                                {!! strip_tags($projectOne->title, '<b><sup><strong><sub><i><span><u>') !!}
                            </h2>

                            @isset($projectOne->objective)
                                <p class="featured-three-items__featured-summary">
                                    {!! strip_tags($projectOne->objective, '<b><sup><strong><sub><i><span><u>') !!}
                                </p>
                            @endisset
                            <a class="link-left-arrow link-animation-arrow" href="{{ lang_url($projectOne->lang_uri) }}">@lang('frontend.read_more')</a>
                        </div>
                    </div>
                @endisset
            </div>

        </div>
        <div class="featured-three-items__slide" data-aos="fade-up" data-aos-once="true" data-aos-delay="700">
            @include('frontend.templates.blocks.project-slide', ['projectOne' => $projectTwo, 'projectTwo' => $projectThree, 'container_class' => 'project-slide--single' ])
            @if($block->cta1)
                <div class="featured-three-items__container-button">
                    {!! generateLink($block->cta1, 'square-button square-button--arrow') !!}
                </div>
            @endif
        </div>
    </div>
</div>
