@extends('layouts.site', ['title' => '課程介紹'])

@php
    $courseImage = $course['image'] ?? null;
@endphp

@section('seo_title', ($course['title'] ?? '課程介紹') . '｜' . config('app.name'))
@section('seo_description', $course['subtitle'] ?? '課程介紹')
@section('seo_keywords', trim(implode(', ', array_filter([
    $course['title'] ?? null,
    '課程介紹',
    '團課',
    config('app.name'),
]))))
@section('canonical', route('pages.courses.show', ['slug' => $course['slug'] ?? '']))
@section('og_image', $courseImage)
@section('og_image_alt', $course['title'] ?? '課程介紹')

@push('structured_data')
    @php
        $schema = [
            '@context' => 'https://schema.org',
            '@type' => 'Course',
            'name' => $course['title'] ?? '課程介紹',
            'description' => $course['description'] ?? $course['subtitle'] ?? '課程介紹',
            'provider' => [
                '@type' => 'Organization',
                'name' => config('app.name'),
            ],
        ];
        if (filled($courseImage)) {
            $schema['image'] = [$courseImage];
        }
    @endphp
    <script type="application/ld+json">{!! json_encode($schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) !!}</script>
@endpush

@section('body_class', 'home-page')

@push('head')
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Mr+Dafoe&display=swap" rel="stylesheet">
@endpush

@section('content')
    <section id="hero-section" class="relative bg-[#0e0e0e] px-6 pt-36 md:pt-48 lg:pt-56 pb-8 lg:pb-12 md:px-12">
        <div class="mx-auto max-w-7xl">
            <div class="flex items-end justify-end">
                <div class="text-right">
                    <nav aria-label="Breadcrumb" class="flex justify-end">
                        <ol class="flex items-center gap-x-1 text-xs font-semibold tracking-[0.2em] text-white/60">
                            <li>
                                <a href="{{ route('pages.home') }}" class="uppercase hover:text-white/85 transition-colors">HOME</a>
                            </li>
                            <li aria-hidden="true" class="inline-flex items-center">
                                <svg viewBox="0 0 24 24" fill="none" class="h-4 w-4 text-white/60">
                                    <path d="M9 18l6-6-6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
                                </svg>
                            </li>
                            <li>
                                <a href="{{ route('pages.courses.week') }}" class="uppercase hover:text-white/85 transition-colors">COURSES</a>
                            </li>
                            <li aria-hidden="true" class="inline-flex items-center">
                                <svg viewBox="0 0 24 24" fill="none" class="h-4 w-4 text-white/60">
                                    <path d="M9 18l6-6-6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
                                </svg>
                            </li>
                            <li>
                                <span aria-current="page">課程介紹</span>
                            </li>
                        </ol>
                    </nav>
                    <h1 class="mt-1 lg:mt-3 text-4xl md:text-5xl font-bold tracking-tight text-white">
                        {{ $course['title'] ?? '課程介紹' }}
                    </h1>
                </div>
            </div>
        </div>
    </section>

    <section class="py-12 bg-[#131313]">
        @include('pages.courses._content', ['course' => $course])
    </section>
@endsection
