<div class="w-full p-0 m-0">
    @if($posts->isEmpty())
        <p class="text-theme-primary dark:text-theme-muted">
            {{ __('No page available in your language at the moment') }}
        </p>
    @else
        @foreach($posts as $post)
            <div class="relative w-full p-0 m-0 overflow-hidden">
                @if($post->hasMedia('*'))
                    @php
                        $media = $post->getFirstMedia('*');
                        $mediaOwner = $media ? $media->getCustomProperty('owner', '') : '';
                    @endphp
                    <img src="{{ $post->getFirstMediaUrl('*', 'half_hero') }}" alt="{{ $media->getCustomProperty('caption') }}" class="w-full object-cover min-h-[700px] md:min-h-[1024px]">

                    <!-- Media owner overlay -->
                    @if (!empty($mediaOwner))
                        <div class="absolute bottom-0 w-full">
                            <div class="w-full mx-auto max-w-7xl px-6 md:px-10 lg:px-14 py-14 md:py-14 lg:py-28">
                                <div class="flex flex-col items-end gap-1">
                                    <h6 class="inline-block items-center rounded-sm bg-theme-brand px-1.5 pb-0.5 pt-0.5 text-[10px] lg:text-xs font-normal text-white">
                                        {{ $mediaOwner }}
                                    </h6>
                                </div>
                            </div>
                        </div>
                    @endif
                @endif

                <!-- Title Landing Post-->
                @if (isset($post->translations[0]) && isset($post->translations[0]->title))
                    <div class="absolute inset-0 flex items-center justify-center">
                        <h2 class="text-center text-xl md:text-2xl lg:text-4xl xl:text-6xl 2xl:text-7xl font-semibold text-theme-text-background dark:text-white bg-theme-brand p-6 m-8">
                            {{ $post->translations[0]->title }}
                        </h2>
                    </div>
                @endif
            </div>

            <!-- Content Landing Post-->
            @if (isset($post->translations[0]->content) && strlen(trim(strip_tags($post->translations[0]->content))) > 0)
                 <div class="text-theme-primary max-w-2xl mx-auto my-12 p-4 post mb-6 bg-white dark:bg-theme-primary">
                    <div class="content font-base font-normal leading-loose">
                        {!! \App\Helpers\StringHelper::sanitizeHtml($post->translations[0]->content) !!}
                    </div>
                </div>
            @endif
        @endforeach
    @endif
</div>