<?php
$pageTitle = $pageTitle ?? 'Medical Tracker';
$activePage = $activePage ?? '';
function site_active(string $page, string $activePage): string
{
    return $page === $activePage ? ' class="active"' : '';
}
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= htmlspecialchars($pageTitle, ENT_QUOTES) ?></title>
    <link rel="stylesheet" href="/assets/site.css">
</head>
<body>
    <header class="site-header">
        <a class="site-logo" href="/">
            <span class="site-logo-bars" aria-hidden="true"><i></i><i></i><i></i></span>
            <span>Medical Tracker</span>
        </a>
        <nav class="site-nav" aria-label="Primary navigation">
            <a<?= site_active('home', $activePage) ?> href="/">Home</a>
            <a<?= site_active('conditions', $activePage) ?> href="/workouts.php">Conditions</a>
            <a<?= site_active('medicines', $activePage) ?> href="/nutrition.php">Medicines</a>
            <a<?= site_active('symptoms', $activePage) ?> href="/symptoms.php">Symptoms</a>
            <a<?= site_active('research', $activePage) ?> href="/recovery.php">Research</a>
            <a<?= site_active('terminology', $activePage) ?> href="/medical.php">Terminology</a>
            <a href="/tracker.php">Tracker</a>
            <a href="/admin.php">Admin</a>
        </nav>
    </header>
