/*
Theme Name: SherBIM Studio
Theme URI: http://example.com
Author: Sher Ali
Author URI: http://example.com
Description: A custom WordPress theme for SherBIM AI Plugin and Revit Families.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sherbim
*/
// Route 5 Manufacturer Pages
add_action('init', function() {
    if (is_admin()) return;
    $path = trim(parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH), '/');
    $routes = [
        'overview.html'    => 'overview',
        'what-we-do.html'  => 'what-we-do',
        'bim-content.html' => 'bim-content',
        'development.html' => 'development',
        'what-is-bim.html' => 'what-is-bim',
        'overview'         => 'overview',
        'what-we-do'       => 'what-we-do',
        'bim-content'      => 'bim-content',
        'development'      => 'development',
        'what-is-bim'      => 'what-is-bim',
    ];
    if (isset($routes[$path])) {
        $file = get_template_directory() . "/page-{$routes[$path]}.php";
        if (file_exists($file)) {
            status_header(200);
            header('Content-Type: text/html; charset=UTF-8');
            include $file;
            exit;
        }
    }
}, 1);