@php
    $bodyClass = 'solutions-detail';
    $layout_path = 'frontend.layouts.content-sidebar';
    if($solution->layout_type == 'blocks') {
        $bodyClass .= ' solutions-detail--blocks';
        $layout_path = 'frontend.layouts.main';

        if($solution->header_overlap) {
            $bodyClass .= ' header-over';
        }
    } else {
        if (!$solution->slides->isEmpty()) {
            $bodyClass .= ' header-over';
        }
    }
@endphp

@extends($layout_path, [
    'body_class' => $bodyClass,
    'objectEmbeds' => $solution->codeEmbeds
])

@if($solution->layout_type == 'blocks')

    @section('content')
        <div class="solutions-detail__content">
            @include('frontend.templates.components.blocks_section', ['blocks' => $solution->blocks])
        </div>
    @stop

@else
    
    @if(!$solution->slides->isEmpty())
        @section('content-header')
            <div class="solutions-detail__header">
                @include('frontend.templates.components.gallery-slider', array(
                    "slides" => $solution->slides,
                    "overlayId" => "solution-overlay-container"
                ))
                <div id="solution-overlay-container" class="solutions-detail__header-overlay">
                    @include('frontend.templates.components.default_header_content', [
                        'headerTitle' => $solution->title,
                        'headerTagline' => $solution->tagline
                    ])
                </div>
            </div>
        @stop
    @endif
    @section('content-toolbar')
        @if(!empty($solution->factSheet->pardot_url))
            <a
                href="#"
                class="download-btn download-btn--simple"
                data-download_id="{{ $solution->factSheet->id }}"
                data-download="{{ base64_encode(json_encode(["title" => $solution->factSheet->title, "url" => $solution->factSheet->pardot_url ])) }}"
                data-controller="components/form-modal"
                data-popupid="download-modal"
            >
            </a>
        @endif
        @include('frontend.templates.components.share_buttons')
    @stop
    @if ($solution->slides->isEmpty())
        @section('content-top')
            <div class="rich-content">
                <h1>{{$solution->title}}</h1>
            </div>
        @stop
    @endif
    @section('content-left')
        @if($solution->objective)
            <div class="rich-content rich-content__objective">
                <div class="heading3">{!! strip_tags($solution->objective, '<b><sup><strong><sub><i><span><u>') !!}</div>
            </div>
        @endif
        @if($solution->content)
            <div class="rich-content">
                {!! $solution->content !!}
            </div>
        @endif
        @if($solution->in_depth)
            <div class="rich-content solutions-detail__in-depth">
                {!! $solution->in_depth !!}
            </div>
        @endif
    @stop
    @section('content-footer')
        @if($solution->solutions->count())
            @include(
                'frontend.templates.components.generic_related_slider',
                [
                    'title' => trans('frontend.related_solutions'),
                    'items' => $solution->solutions,
                    'itemImageField' => 'overviewImage',
                    'itemImageSize' => '400x400'
                ]
            )
        @endif
        @include('frontend.templates.components.simple_related_items', array('title' => trans('frontend.further_reading')))
    @stop

@endif
