<?php
require_once dirname(__DIR__) . '/csp_config.php';
require_once dirname(__DIR__) . '/config_loader.php';
require_once dirname(__DIR__) . '/CsrfProtection.php';

$currentDir = trim(str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'] ?? '/')), '/');
$depth = ($currentDir === '') ? 0 : (substr_count($currentDir, '/') + 1);
$urlPrefix = ($depth === 0) ? '' : str_repeat('../', $depth);

// Generate and send CSP header
send_security_headers();

// Start session for CSRF protection
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-317231418"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'AW-317231418');
</script>
    <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q9ZQXB9TDH">
</script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-Q9ZQXB9TDH');
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2LD3RECBYF"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-2LD3RECBYF');
  gtag('event', 'ads_conversion_click_1', {});
</script>
    <!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W4G4XMPD');</script>
<!-- End Google Tag Manager -->
    <script src="https://www.google.com/recaptcha/enterprise.js?render=6LeUoSksAAAAAG7oSdSl4zKoBxmo7e1Pq5nih2iU"></script>
    <meta name="google-adsense-account" content="ca-pub-9807741295373154">
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9807741295373154"
     crossorigin="anonymous"></script>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Mark's Tech Solution offers expert computer repair, laptop repair, network setup, WiFi optimization, custom PC builds, virus removal, and on-site IT support in East Weymouth, MA.">
    <meta name="keywords" content="computer repair East Weymouth, laptop repair, desktop repair, IT support, network setup, WiFi installation, custom PC builds, virus removal, malware removal, on-site tech support, remote computer repair, printer setup, router setup, PC tune up, gaming PC build, business IT support, home computer repair, Mark's Tech Solution">
    <meta name="author" content="Mark's Tech Solution">
    <meta name="robots" content="index, follow, max-image-preview:large">
    <meta name="theme-color" content="#ff6600">
    <meta name="msapplication-TileColor" content="#ff6600">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="strict-origin-when-cross-origin">
    <meta name="format-detection" content="telephone=yes">

    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://markstechsolution.com/">
    <meta property="og:title" content="Mark's Tech Solution - Computer Repair & IT Support in East Weymouth, MA">
    <meta property="og:description" content="Professional computer repair, network setup, WiFi optimization, custom PC builds, virus removal, and on-site IT support in East Weymouth, MA.">
    <meta property="og:image" content="https://markstechsolution.com/assets/square-white-logo-og-image.png">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="630">
    <meta property="og:image:alt" content="Mark's Tech Solution logo and IT services">
    <meta property="og:site_name" content="Mark's Tech Solution">
    <meta property="og:locale" content="en_US">
    <meta property="og:phone_number" content="+1-339-746-0995">

    <!-- Twitter -->
    <meta property="twitter:card" content="summary_large_image">
    <meta property="twitter:domain" content="markstechsolution.com">
    <meta property="twitter:url" content="https://markstechsolution.com/">
    <meta property="twitter:title" content="Mark's Tech Solution - Computer Repair & IT Support in East Weymouth, MA">
    <meta property="twitter:description" content="Professional computer repair, network setup, WiFi optimization, custom PC builds, virus removal, and on-site IT support in East Weymouth, MA.">
    <meta property="twitter:image" content="https://markstechsolution.com/assets/square-white-logo-og-image.png">
    <meta property="twitter:image:alt" content="Mark's Tech Solution logo and IT services">

    <!-- Additional SEO -->
    <link rel="canonical" href="https://markstechsolution.com/">
    <link rel="apple-touch-icon" href="<?php echo $urlPrefix; ?>assets/favicon.png">
    <meta name="geo.region" content="US-MA">
    <meta name="geo.placename" content="East Weymouth">
    <meta name="geo.position" content="42.226008;-70.945108">
    <meta name="ICBM" content="42.226008, -70.945108">
    <title><?php echo htmlspecialchars($pageTitle ?? "Mark's Tech Solution - Computer Repair & IT Support in East Weymouth, MA", ENT_QUOTES, 'UTF-8'); ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <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@300;400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo $urlPrefix; ?>styles.css">

    <?php if (!empty($extraHead)) { echo $extraHead; } ?>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W4G4XMPD"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
    <!-- Skip Navigation -->
    <a href="#main-content" class="skip-nav visually-hidden-focusable">Skip to main content</a>
    
    <?php include __DIR__ . '/navbar.php'; ?>
