<?php get_header(); global $syrus; ?>
<?php if(get_theme_mod('use-static-page-404','no') == 'no' || !get_theme_mod('static-page-404',null)) : ?>
  <div class="container main-container layout-<?php echo $syrus->get_current_layout() ?>" role="main" id="main-content">
      <div class="row mt-4">

        <div class="col-12 col-md-9">
          <?php do_action('error-404'); ?>
        </div>

        <div class="d-none d-md-inline col-md-3">
          <?php get_sidebar(); ?>
        </div>

      </div>
  </div>

<?php else : ?>

  <?php
      global $post;
      $post = get_post(get_theme_mod('static-page-404', null));
      setup_postdata($post);
      
      // THEME MOD
      $font_sizes = [
          'small' => "1em",
          'medium' => "1.2em",
          'large' => "1.35em"
      ];

      $general_font_size = get_theme_mod("general-font-size") ? sanitize_text_field(get_theme_mod("general-font-size")) : "medium";
      $general_font_size = $font_sizes[$general_font_size];
      $show_sidebar = (int) get_theme_mod("show-sidebar-single-page", 1) ? true : false;

  ?>
  <style media="screen">
      .single-content p, .single-content li, .single-content span{
          font-size: <?php echo $general_font_size; ?> !important;
      }
  </style>

  <div class="container main-container layout-<?php echo $syrus->get_current_layout() ?>" role="main" id="main-content">
      <div class="row mx-0 mt-4">

        <div class="col-12 <?php echo $show_sidebar ? 'col-md-9' : '' ?>">
          <div class="card-post">
            <?php do_action('single-page-content'); ?>
          </div>
        </div>

        <?php if($show_sidebar) : ?>
          <div class="d-none d-md-inline col-md-3">
            <?php get_sidebar(); ?>
          </div>
        <?php endif; ?>

      </div>
  </div>

<?php endif; ?>

<?php get_footer(); ?>
