<?php
require_once dirname(__DIR__) . '/version.php';
if (!isset($page) || !is_array($page)) {
    http_response_code(404);
    exit;
}
$esc = static function ($value) {
    return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
};
$schema = [
    '@context' => 'https://schema.org',
    '@type' => 'WebPage',
    'name' => $page['title'],
    'description' => $page['meta'],
    'url' => $page['canonical'],
    'inLanguage' => $page['lang'],
    'isPartOf' => [
        '@type' => 'WebSite',
        'name' => 'MS Manufacturing Solutions',
        'url' => 'https://msmanuf.com/wp/'
    ]
];
?>
<!DOCTYPE html>
<html lang="<?php echo $esc($page['lang']); ?>">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="<?php echo $esc($page['meta']); ?>">
  <meta name="robots" content="index, follow">
  <title><?php echo $esc($page['title']); ?> | MS</title>
  <link rel="canonical" href="<?php echo $esc($page['canonical']); ?>">
  <?php foreach ($page['alternates'] as $code => $url): ?>
  <link rel="alternate" hreflang="<?php echo $esc($code); ?>" href="<?php echo $esc($url); ?>">
  <?php endforeach; ?>
  <meta property="og:type" content="website">
  <meta property="og:title" content="<?php echo $esc($page['title']); ?> | MS">
  <meta property="og:description" content="<?php echo $esc($page['meta']); ?>">
  <meta property="og:url" content="<?php echo $esc($page['canonical']); ?>">
  <meta property="og:image" content="https://msmanuf.com/wp/img/og-ms-solutions.png">
  <script type="application/ld+json"><?php echo json_encode($schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?></script>
  <link rel="icon" href="../img/ms-logo-192.png" type="image/png" sizes="192x192">
  <link rel="apple-touch-icon" href="../img/ms-logo-192.png">
  <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/agency.min.css?v=20260902-2" rel="stylesheet">
  <link href="../css/seo.css?v=3.5.0" rel="stylesheet">
</head>
<body class="legal-page">
  <a class="sr-only sr-only-focusable" href="#main-content"><?php echo $esc($page['skipLabel']); ?></a>
  <nav class="navbar navbar-dark fixed-top" id="mainNav">
    <div class="container">
      <a class="navbar-brand" href="<?php echo $esc($page['homeUrl']); ?>"><img src="../img/logos/logoMS.png" alt="MS Manufacturing Solutions" width="200" height="30" decoding="async" fetchpriority="high"></a>
      <a class="btn btn-outline-light" href="<?php echo $esc($page['homeUrl']); ?>"><?php echo $esc($page['backLabel']); ?></a>
    </div>
  </nav>
  <header class="legal-header">
    <div class="container">
      <p class="text-uppercase mb-3">MS Manufacturing Solutions</p>
      <h1><?php echo $esc($page['title']); ?></h1>
      <p class="lead mt-3"><?php echo $esc($page['updatedLabel']); ?>: <?php echo $esc($page['updated']); ?></p>
      <p class="legal-language-links">
        <?php foreach ($page['languageLinks'] as $index => $link): ?><?php if ($index): ?> · <?php endif; ?><a href="<?php echo $esc($link['url']); ?>" lang="<?php echo $esc($link['lang']); ?>"><?php echo $esc($link['label']); ?></a><?php endforeach; ?>
      </p>
    </div>
  </header>
  <main class="legal-content" id="main-content">
    <div class="container"><div class="row justify-content-center"><article class="col-lg-9">
      <?php foreach ($page['sections'] as $section): ?>
        <section>
          <h2><?php echo $esc($section['title']); ?></h2>
          <?php foreach ($section['paragraphs'] as $paragraph): ?><p><?php echo $esc($paragraph); ?></p><?php endforeach; ?>
          <?php if (!empty($section['items'])): ?><ul><?php foreach ($section['items'] as $item): ?><li><?php echo $esc($item); ?></li><?php endforeach; ?></ul><?php endif; ?>
        </section>
      <?php endforeach; ?>
    </article></div></div>
  </main>
  <footer class="legal-footer"><div class="container">
    <p>&copy; MS Manufacturing Solutions 2018&ndash;<?php echo date('Y'); ?> · <a href="mailto:info@msmanuf.com">info@msmanuf.com</a></p>
    <p><a href="<?php echo $esc($page['privacyUrl']); ?>"><?php echo $esc($page['privacyLabel']); ?></a> · <a href="<?php echo $esc($page['termsUrl']); ?>"><?php echo $esc($page['termsLabel']); ?></a></p>
    <p class="site-version"><?php echo $esc($page['versionLabel']); ?> <?php echo SITE_VERSION; ?></p>
  </div></footer>
</body>
</html>
