<?php
/**
 * Shared site header.
 * Set $pageTitle and $activePage before including this file on inner pages.
 */
$pageTitle  = $pageTitle ?? 'PROLAD Homes & Properties';
$activePage = $activePage ?? 'home';

// Centralized search metadata for clean, consistent indexing across all pages.
$scriptSlug = basename($_SERVER['SCRIPT_NAME'] ?? 'index.php', '.php');
$canonicalPath = $scriptSlug === 'index' ? '' : $scriptSlug;
$canonicalUrl = 'https://prolad.com.ng/' . $canonicalPath;

$seoDescriptions = [
    'index' => 'Find premium homes, property investments and expert real estate, construction and architectural services with PROLAD Homes & Properties Nigeria.',
    'properties' => 'Explore verified homes and residential properties for sale in Lagos, Abuja and prime Nigerian locations with PROLAD Homes & Properties.',
    'real-estate' => 'Buy, sell, lease and manage property confidently with PROLAD real estate services and investment guidance across Nigeria.',
    'construction' => 'Professional building construction, renovation, site engineering and project supervision services for homes and commercial properties in Nigeria.',
    'architectural-design' => 'Architectural designs, structural drawings, space planning and approval support for residential and commercial projects in Nigeria.',
    'property-documentation' => 'Land documentation, property verification, title review and government approval support from PROLAD in Nigeria.',
    'services' => 'Explore PROLAD services: real estate, construction, renovation, site engineering, property development, management and architectural design.',
    'projects' => 'See PROLAD residential construction, architectural design and property development capabilities across Nigeria.',
    'about' => 'Learn about PROLAD Homes & Properties, a Nigerian real estate, construction and architectural services company built on integrity and quality.',
    'contact' => 'Contact PROLAD Homes & Properties for property inspections, construction projects, architectural designs and real estate enquiries in Nigeria.',
];

$seoImages = [
    'construction' => 'nigeria-site-engineers.webp',
    'architectural-design' => 'nigeria-architect-consultation.webp',
    'property-documentation' => 'nigeria-architect-consultation.webp',
    'projects' => 'nigeria-construction-hero.webp',
];

$metaDescription = $metaDescription ?? ($seoDescriptions[$scriptSlug] ?? $seoDescriptions['index']);
$socialImage = 'https://prolad.com.ng/img/' . ($seoImages[$scriptSlug] ?? 'nigeria-luxury-home.webp');
$seoKeywords = 'real estate company Nigeria, homes for sale Nigeria, properties for sale Lagos, properties for sale Abuja, luxury homes Nigeria, property development Nigeria, construction company Nigeria, architectural design Nigeria, site engineers Nigeria, building renovation Nigeria, property management Nigeria, real estate investment Nigeria, land documentation Nigeria, property verification Nigeria, building construction Lagos';

$organizationSchema = [
    '@context' => 'https://schema.org',
    '@type' => ['Organization', 'RealEstateAgent'],
    '@id' => 'https://prolad.com.ng/#organization',
    'name' => 'PROLAD Homes & Properties',
    'url' => 'https://prolad.com.ng/',
    'logo' => 'https://prolad.com.ng/img/logo.png',
    'image' => $socialImage,
    'description' => $metaDescription,
    'email' => 'support@prolad.com.ng',
    'telephone' => ['+2348145010155', '+2348032081085'],
    'slogan' => 'Everyone Deserves A Home',
    'areaServed' => ['Nigeria', 'Lagos', 'Abuja'],
    'contactPoint' => [[
        '@type' => 'ContactPoint',
        'telephone' => '+2348145010155',
        'contactType' => 'customer service',
        'email' => 'support@prolad.com.ng',
        'areaServed' => 'NG',
        'availableLanguage' => 'English',
    ]],
    'hasOfferCatalog' => [
        '@type' => 'OfferCatalog',
        'name' => 'Property and Construction Services',
        'itemListElement' => array_map(static fn(string $service): array => [
            '@type' => 'Offer',
            'itemOffered' => ['@type' => 'Service', 'name' => $service],
        ], [
            'Property Sales and Management', 'Real Estate Investment',
            'Property Development', 'Building Construction', 'Renovations',
            'Site Engineering', 'Architectural Design', 'Property Documentation',
        ]),
    ],
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="<?= htmlspecialchars($metaDescription, ENT_QUOTES, 'UTF-8'); ?>">
    <meta name="keywords" content="<?= htmlspecialchars($seoKeywords, ENT_QUOTES, 'UTF-8'); ?>">
    <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
    <meta name="author" content="PROLAD Homes &amp; Properties">
    <meta name="theme-color" content="#031d43">
    <link rel="icon" type="image/png" href="img/prolad-favicon.png">
    <link rel="apple-touch-icon" href="img/prolad-favicon.png">
    <title><?= htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?></title>
    <link rel="canonical" href="<?= htmlspecialchars($canonicalUrl, ENT_QUOTES, 'UTF-8'); ?>">

    <meta property="og:type" content="website">
    <meta property="og:site_name" content="PROLAD Homes &amp; Properties">
    <meta property="og:title" content="<?= htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?>">
    <meta property="og:description" content="<?= htmlspecialchars($metaDescription, ENT_QUOTES, 'UTF-8'); ?>">
    <meta property="og:url" content="<?= htmlspecialchars($canonicalUrl, ENT_QUOTES, 'UTF-8'); ?>">
    <meta property="og:image" content="<?= htmlspecialchars($socialImage, ENT_QUOTES, 'UTF-8'); ?>">
    <meta property="og:image:alt" content="PROLAD Homes &amp; Properties in Nigeria">
    <meta property="og:locale" content="en_NG">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="<?= htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?>">
    <meta name="twitter:description" content="<?= htmlspecialchars($metaDescription, ENT_QUOTES, 'UTF-8'); ?>">
    <meta name="twitter:image" content="<?= htmlspecialchars($socialImage, ENT_QUOTES, 'UTF-8'); ?>">

    <script type="application/ld+json"><?= json_encode($organizationSchema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); ?></script>
    <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=Montserrat:wght@400;500;600;700;800&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>

<header class="site-header" id="site-header">
    <div class="home-utility-bar">
        <div class="container home-utility-inner">
            <p>Everyone Deserves A Home</p>
            <div class="home-utility-contacts">
                <a href="https://wa.me/2348145010155" target="_blank" rel="noopener" aria-label="Chat with PROLAD on WhatsApp at +234 814 501 0155">
                    <i class="bi bi-whatsapp" aria-hidden="true"></i><span>+234 814 501 0155</span>
                </a>
                <a href="mailto:support@prolad.com.ng" aria-label="Email PROLAD at support@prolad.com.ng">
                    <i class="bi bi-envelope" aria-hidden="true"></i><span>support@prolad.com.ng</span>
                </a>
            </div>
        </div>
    </div>
    <nav class="navbar" aria-label="Main navigation">
        <div class="container nav-inner">
            <a class="brand" href="./" aria-label="PROLAD home">
                <img class="brand-logo" src="img/logo.png" alt="PROLAD Homes and Properties">
            </a>

            <button class="nav-toggle" type="button" aria-expanded="false" aria-controls="primary-menu" aria-label="Open navigation">
                <span></span><span></span><span></span>
            </button>

            <div class="nav-menu" id="primary-menu">
                <a class="<?= $activePage === 'home' ? 'active' : ''; ?>" href="./">Home</a>
                <details class="services-menu <?= $activePage === 'services' ? 'active' : ''; ?>">
                    <summary>Services <span aria-hidden="true">⌄</span></summary>
                    <div class="services-dropdown">
                        <a href="real-estate"><span>01</span>Real Estate</a>
                        <a href="construction"><span>02</span>Construction</a>
                        <a href="property-documentation"><span>03</span>Property Documentation</a>
                        <a href="architectural-design"><span>04</span>Architectural Design</a>
                        <a class="all-services" href="services">View all services →</a>
                    </div>
                </details>
                <a class="<?= $activePage === 'properties' ? 'active' : ''; ?>" href="properties">Properties</a>
                <a class="<?= $activePage === 'about' ? 'active' : ''; ?>" href="about">About Us</a>
                <a class="<?= $activePage === 'contact' ? 'active' : ''; ?>" href="contact">Contact</a>
                <a class="button button-small nav-cta" href="contact?service=Real+Estate">Book Inspection</a>
            </div>
        </div>
    </nav>
</header>
