<?php
/**
 * Template for displaying site footer
 *
 * Contains closing of #main div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package errigal
 * @since 1.0.0
 */

defined( 'ABSPATH' ) || exit;

use Errigal\Constant\{
	Errigal_Html_Attr as Html_Attr,
	Errigal_Html_Option as Html_Option,
};
use Errigal\Icon\Errigal_Icon as Icon;
use Errigal\Shared\Errigal_Html_Builder as Html_Builder;

$html_builder = Html_Builder::create();

// ──────────────── MAIN ──────────────────────────────────
$html_builder->create_main()->render_close_tag();
// ────────────── CONTENT AREA ────────────────────────────
$html_builder->create_div()->render_close_tag();
// ────────────── SIDEBAR ─────────────────────────────────
get_sidebar();
// ──────────── SITE CONTENT ROW ──────────────────────────
$html_builder->create_div()->render_close_tag();
// ────────── SITE CONTENT CONTAINER ──────────────────────
$html_builder->create_div()->render_close_tag();
// ────────── BACK TO TOP BUTTON ──────────────────────────
$html_builder->create_button(
	array(
		Html_Option::ATTRS => array(
			Html_Attr::CLASS_NAME => 'back-to-top',
			Html_Attr::STYLE      => null,
			Html_Attr::TYPE       => Html_Attr::VALUE_BUTTON,
			Html_Attr::ARIA_LABEL => __( 'Back to top', 'errigal' ),
		),
	)
)->render_element(
	Icon::get_icon( Icon::BACK_TO_TOP, Icon::SIZE_MD )
);
// ──────── SITE CONTENT ──────────────────────────────────
$html_builder->create_div()->render_close_tag();
// ──────── SITE FOOTER ───────────────────────────────────
get_template_part( 'template-parts/footer/site-footer' );
// ────── PAGE ────────────────────────────────────────────
$html_builder->create_div()->render_close_tag();
// ────── FOOTER ──────────────────────────────────────────
wp_footer();
// ──── BODY ──────────────────────────────────────────────
$html_builder->create_body()->render_close_tag();
// ── HTML ────────────────────────────────────────────────
$html_builder->create_html()->render_close_tag();
