<?php

declare(strict_types=1);

/**
 * SportsClub-Schema aus data/club.json — auf jeder Seite identisch (NAP-Konsistenz für SEO/GEO).
 */
$club = json_load('club');

$schema = [
    '@context'      => 'https://schema.org',
    '@type'         => 'SportsClub',
    'name'          => $club['name'],
    'alternateName' => $club['legal_name'],
    'foundingDate'  => $club['founded'],
    'description'   => $club['description'],
    'sport'         => $club['departments'],
    'email'         => $club['email'],
    'url'           => abs_url(),
    'logo'          => rtrim((string) config('base_url'), '/') . '/assets/img/logo.svg',
    'address'       => [
        '@type'           => 'PostalAddress',
        'streetAddress'   => $club['address']['street'],
        'postalCode'      => $club['address']['zip'],
        'addressLocality' => $club['address']['city'],
        'addressCountry'  => $club['address']['country'],
    ],
    'sameAs'        => array_values(array_filter($club['social'])),
];
?>
    <script type="application/ld+json"><?= json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) ?></script>
