@extends('student.layouts.app')
@section('title', 'Tipe Kepribadian | Career Development and Consultation (CDC)')
@section('header')
    <div class="py-5 toolbar py-lg-5" id="kt_toolbar">
        <div id="kt_toolbar_container" class="flex-wrap container-xxl d-flex flex-stack">
            <div class="page-title d-flex flex-column me-3">
                <h1 class="my-1 d-flex text-dark fw-bolder fs-3">Tipe Kepribadian</h1>
                <ul class="my-1 text-gray-600 breadcrumb breadcrumb-dot fw-bold fs-7">
                    <li class="text-gray-600 breadcrumb-item">
                        <a href="{{ route('student.dashboard') }}" class="text-gray-600 text-hover-primary">Dashboard</a>
                    </li>
                    <li class="text-gray-600 breadcrumb-item">Tipe Kepribadian</li>
                </ul>
            </div>
        </div>
    </div>
@endsection
@section('content')
    <div class="card">
        <div class="card-body p-lg-20">
            <div class="mb-17">
                <div class="mb-5 d-flex flex-stack">
                    <h3 class="text-black">Tipe Kepribadian</h3>
                </div>
                <div class="separator separator-dashed mb-9"></div>
                <div class="row g-10">
                    @foreach ($personalities as $personality)
                        <div class="col-md-4">
                            <div class="card-xl-stretch me-md-6">
                                <a class="d-block overlay" data-fslightbox="lightbox-hot-sales"
                                    href="{{ route('student.personality.detail', $personality->slug) }}">
                                    <div class="overlay-wrapper bgi-no-repeat bgi-position-center bgi-size-contain card-rounded min-h-175px"
                                        style="background-image:url('{{ $personality->image_url ? asset('storage/illustrations/' . $personality->image_url) : asset('assets/archive/images/default.png') }}'); background-size: contain;">
                                    </div>
                                    <div class="bg-opacity-25 overlay-layer card-rounded bg-dark">
                                        <i class="text-white bi bi-eye-fill fs-2x"></i>
                                    </div>
                                </a>
                                <div class="mt-5">
                                    <a href="{{ route('student.personality.detail', $personality->slug) }}"
                                        class="fs-4 text-dark fw-bolder text-hover-primary lh-base">{{ $personality->personality }}</a>
                                    <div class="my-4 text-justify text-gray-600 fw-bold fs-5 text-dark">
                                        {!! mb_strimwidth($personality->desc, 0, 100, '...') !!}</div>
                                    <div class="fs-6 fw-bolder">
                                        <span
                                            class="text-muted">{{ \Carbon\Carbon::parse($personality->created_at)->format('M d Y') }}</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>
            </div>
        </div>
    </div>
@endsection
