<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <link rel="icon" href="{{ asset('assets/favicon.png') }}" />

    {{-- Preload de l'image hero (LCP) --}}
    @isset($reglage)
        <link rel="preload" as="image" href="{{ $reglage->heroImageUrl() }}" fetchpriority="high" />
    @endisset

    <x-seo
        :title="$seoTitle ?? null"
        :description="$seoDescription ?? null"
        :og-type="$ogType ?? null"
        :og-image="$ogImage ?? null"
        :url-fr="$urlFr ?? null"
        :url-en="$urlEn ?? null"
        :article-schema="$articleSchema ?? null"
    />

    @if (config('services.google_analytics.measurement_id'))
        <script async src="https://www.googletagmanager.com/gtag/js?id={{ config('services.google_analytics.measurement_id') }}"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', '{{ config('services.google_analytics.measurement_id') }}');
        </script>
    @endif

    @vite(['resources/css/site.css', 'resources/js/site.js'])
</head>
<body class="relative min-h-screen overflow-x-clip bg-background text-foreground">
    {{ $slot }}
</body>
</html>
