@if(!empty($course->teacher))
@php
    $instructorHighlights = getWebinarInstructorHighlights($course, $lessonCount ?? 0);
@endphp
<section class="cp-section cp-instructor cp-animate" id="cp-instructor">
    <div class="container">
        @include('web.default.includes.premium.section_header', [
            'title' => trans('webinars.landing_instructor_title'),
            'align' => 'center',
            'class' => 'mb-30 cp-section-title-wrap',
        ])

        <div class="cp-panel cp-instructor__panel">
            <div class="cp-instructor__layout">
                <div class="cp-instructor__media">
                    <div class="cp-instructor__avatar">
                        <img
                            src="{{ $course->teacher->getAvatar(160) }}"
                            alt="{{ $course->teacher->full_name }}"
                            class="cp-instructor__photo"
                            width="128"
                            height="128"
                            loading="lazy"
                        />
                    </div>
                </div>
                <div class="cp-instructor__content">
                    <p class="cp-instructor__label">{{ trans('webinars.landing_instructor_label') }}</p>
                    <h3 class="cp-instructor__name">{{ $course->teacher->full_name }}</h3>
                    @if(!empty($course->teacher->certificate_additional) || !empty($course->teacher->bio))
                        <p class="cp-instructor__role">{{ $course->teacher->certificate_additional ?? $course->teacher->bio }}</p>
                    @endif
                    @if(!empty($course->teacher->about))
                        <div class="cp-instructor__bio">{!! nl2br(e($course->teacher->about)) !!}</div>
                    @endif
                    @if($instructorHighlights->count() > 0)
                        <ul class="cp-instructor__chips">
                            @foreach($instructorHighlights as $highlight)
                                <li>
                                    <span class="cp-instructor__chip-icon" aria-hidden="true">
                                        <i data-feather="{{ $highlight['icon'] }}" width="22" height="22"></i>
                                    </span>
                                    <span>
                                        @if(!empty($highlight['value']))
                                            <strong>{{ $highlight['value'] }}</strong>
                                        @endif
                                        @if(!empty($highlight['label']))
                                            {{ !empty($highlight['value']) ? ' ' : '' }}{{ $highlight['label'] }}
                                        @endif
                                    </span>
                                </li>
                            @endforeach
                        </ul>
                    @endif
                </div>
            </div>
        </div>
    </div>
</section>
@endif
