<!DOCTYPE html>
<html <?php language_attributes(); ?>>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
  <?php wp_head(); ?>
</head>

<?php
$options = kaveh_get_options();

// Determine the font class once
$font_class = 'ybakh';
if (isset($options['kaveh_typoselect'])) {
  if ($options['kaveh_typoselect'] === 'value-1') {
    $font_class = 'irsans';
  } elseif ($options['kaveh_typoselect'] === 'value-2') {
    $font_class = 'iryekan';
  }
}
?>

<body <?php body_class(); ?>>
  <?php
  if (function_exists('wp_body_open')) {
    wp_body_open();
  }
  ?>
  <?php do_action('kaveh_before_header'); ?>
  <div class="app <?php echo esc_attr($font_class); ?>">

    <?php
    if (isset($options['kaveh_header_mobile_on']) && !empty($options['kaveh_header_mobile_on']) && wp_is_mobile()) {
      $mobile_header_option = intval(preg_replace('/[^0-9]/', '', $options['kaveh_header_mobile_select']));
      if ($mobile_header_option) {
        get_template_part('template-part/header-mobile-' . $mobile_header_option);
      }
    }
    // Desktop Header
    else {
      if (function_exists('boostify_header_active') && boostify_header_active()) {
        boostify_get_header_template();
      }
    }
