<?php
$page_header_padding = get_theme_mod('page_header_padding', []);
$page_header_overlay = get_theme_mod('page_header_overlay', '#242c5e');
$page_header_title = get_theme_mod('page_header_title', [
    'font-family' => 'Poppins',
    'color' => '#fff',
    'text-transform' => 'none',
    'font-size' => '59px',
    'line-height' => '1.1',
    'letter-spacing' => '0px',
    'variant' => 'regular',
    'font-backup' => '',
    'font-weight' => '400',
    'font-style' => 'normal',
]);
$page_header_breadcrumb = get_theme_mod('page_header_breadcrumb', [
    'font-family' => 'Poppins',
    'color' => '#fff',
    'text-transform' => 'none',
    'font-size' => '24px',
    'line-height' => '1.1',
    'letter-spacing' => '0px',
    'variant' => 'regular',
    'font-backup' => '',
    'font-weight' => '400',
    'font-style' => 'normal',
]);

$page_header_title_selector = [
    '.page-details h2.page-title'
];
$page_header_breadcrumb_selector = [
    '.page-details div.breadcrumbs, .page-details div.breadcrumbs span'
];
$page_title_img  = get_theme_mod('edumodo_page_header_image', '');
$blog_img        = get_theme_mod('edumodo_blog_related_page_header_image', '');
$learnpress_img  = get_theme_mod('edumodo_learnpress_page_header_image', '');
$notice_img      = get_theme_mod('edumodo_notice_page_header_image', '');
$notice_img      = get_theme_mod('edumodo_notice_page_header_image', '');
$event_img       = get_theme_mod('edumodo_event_page_header_image', '');
$event_img       = get_theme_mod('edumodo_event_page_header_image', '');
$woo_img         = get_theme_mod('edumodo_woocommerce_page_header_image', '');
$teacher_img     = get_theme_mod('edumodo_teacher_page_header_image', '');

?>
<style style="edumodo-page-style">
    <?php
    edumodo_parse_typography_to_selectors($page_header_title, edumodo_parse_selector_as_string($page_header_title_selector));
    edumodo_parse_typography_to_selectors($page_header_breadcrumb, edumodo_parse_selector_as_string($page_header_breadcrumb_selector));

    # page header overlay
    if (!empty($page_header_overlay)) : ?>div#primary .page-details:before {
        background: <?php echo $page_header_overlay; ?>;
    }

    body.single-tribe_events .page-details:before {
        background: <?php echo $page_header_overlay; ?>;
    }

    div#page .page-details:before {
        background: <?php echo $page_header_overlay; ?>;
    }

    <?php endif;
    # end of page header overlay

    # page header padding
    if (!empty($page_header_padding)) : ?>.page-details .page-wrapper {
        padding: <?php echo $page_header_padding['top'] . ' ' . $page_header_padding['right'] . ' ' . $page_header_padding['bottom'] . ' ' . $page_header_padding['left']; ?>;
    }

    <?php endif;
    # end of page heading padding
    if (!empty($page_title_img)) : ?>.page-details {
        background-image: url(<?php echo $page_title_img ?>);
    }

    <?php endif;
    if (!empty($blog_img)) : ?>.page-details.blog {
        background-image: url(<?php echo $blog_img ?>);
    }

    .single-post .page-details {
        background-image: url(<?php echo $blog_img ?>);
    }

    <?php endif;
    if (!empty($learnpress_img)) : ?>.post-type-archive-lp_course .page-details,.single-lp_course .page-details{
        background-image: url(<?php echo $learnpress_img ?>);
    }

    <?php endif;
    if (!empty($notice_img)) : ?>.page-details.notice {
        background-image: url(<?php echo $notice_img ?>);
    }

    .single-notice .page-details {
        background-image: url(<?php echo $notice_img ?>);
    }

    <?php endif;
    if (!empty($event_img)) : ?>.post-type-archive-tribe_events .page-details {
        background-image: url(<?php echo $event_img ?>);
    }

    .single-tribe_events .page-details {
        background-image: url(<?php echo $event_img ?>);
    }

    <?php endif;
    if (!empty($woo_img)) : ?>.page-details.woocommerce {
        background-image: url(<?php echo $woo_img ?>);
    }

    .woocommerce-cart .page-details {
        background-image: url(<?php echo $woo_img ?>);
    }

    .woocommerce-checkout .page-details {
        background-image: url(<?php echo $woo_img ?>);
    }

    <?php endif;
    if (!empty($teacher_img)) : ?>.post-type-archive-teacher .page-details {
        background-image: url(<?php echo $teacher_img ?>);
    }
    .single-teacher .page-details {
        background-image: url(<?php echo $teacher_img ?>);
    }
    <?php endif; ?>
</style>
<?php

?>