<?php
header('Content-Type: application/xml; charset=utf-8');
$host = $_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '');
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$base = $host ? $scheme . '://' . $host : '';
$paths = ['/', '/brand-industrial/', '/loft-space/', '/creative-video/', '/ai-workshop/', '/creator-warehouse/', '/contact/', '/industrial-photography/', '/loft-renovation/', '/creative-darkroom/', '/metal-art-space/', '/warehouse-stories/'];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
foreach ($paths as $p) {
  echo "  <url><loc>" . htmlspecialchars(rtrim($base, '/') . $p, ENT_QUOTES, 'UTF-8') . "</loc><lastmod>" . date('Y-m-d') . "</lastmod><changefreq>daily</changefreq><priority>" . ($p==='/' ? '1.0' : '0.8') . "</priority></url>\n";
}
echo "</urlset>\n";
?>
