<?php

/**
 * Header / footer injection via action hooks.
 *
 * The theme's header and footer template parts are rendered on the neutral
 * `kubelio_header` and `kubelio_footer` actions instead of being loaded directly
 * in header.php / footer.php. This lets add-ons (and the theme itself) inject,
 * reorder, or replace the header/footer markup by hooking these actions.
 *
 * @package Kubelio
 * @since 1.0.0
 */

if (! defined('ABSPATH')) {
	exit;
}

/**
 * Render the site header template part.
 *
 * Hooked to the theme's `kubelio_header` action (fired in header.php).
 *
 * @return void
 */
function kubelio_render_header() {
	kubelio_get_template_part('header/header');
}
add_action('kubelio_header', 'kubelio_render_header');

/**
 * Render the site footer template part.
 *
 * Hooked to the theme's `kubelio_footer` action (fired in footer.php).
 *
 * @return void
 */
function kubelio_render_footer() {
	kubelio_get_template_part('footer/footer');
}
add_action('kubelio_footer', 'kubelio_render_footer');

/**
 * Render the off-canvas (mobile) menu.
 *
 * @return void
 */
function kubelio_render_offcanvas_menu() {
	kubelio_get_template_part('global/offcanvas-menu');
}
add_action('kubelio_after_main', 'kubelio_render_offcanvas_menu', 20);

/**
 * Render the back-to-top button.
 *
 * @return void
 */
function kubelio_render_gotop() {
	kubelio_get_template_part('global/gotop');
}
add_action('kubelio_after_main', 'kubelio_render_gotop', 30);

/**
 * Render the mini-cart drawer.
 *
 * @return void
 */
function kubelio_render_mini_cart() {
	kubelio_get_template_part('global/mini-cart');
}
add_action('kubelio_after_main', 'kubelio_render_mini_cart', 40);

/**
 * Render the search modal.
 *
 * @return void
 */
function kubelio_render_modal_search() {
	kubelio_get_template_part('global/modal-search');
}
add_action('kubelio_after_main', 'kubelio_render_modal_search', 50);

/**
 * Render the share modal.
 *
 * @return void
 */
function kubelio_render_modal_share() {
	kubelio_get_template_part('global/modal-share');
}
add_action('kubelio_after_main', 'kubelio_render_modal_share', 60);
