<?php

/**
 * The template for displaying single TV series pages
 *
 * This template can be overridden by copying it to yourtheme/movie-engine/single-series.php.
 * 
 * HOWEVER, on occasion MovieEngine will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @note Please do not delete our CSS classes when you customize, as it may break functionality.
 * @package Movie_Engine
 * @subpackage Movie_Engine/templates
 * @version 1.1.0
 * @since 1.0.0
 */

if (! defined('ABSPATH')) {
    exit; // Exit if accessed directly
}

get_header();

$movie_engine_design_settings = get_option('movie_engine_design_settings', []);
$movie_engine_series_container_type = $movie_engine_design_settings['series_container_type'] ?? 'container';
$movie_engine_series_container_class = 'movie-engine-' . esc_attr($movie_engine_series_container_type);

if ($movie_engine_series_container_type === 'container-fluid') {
    $movie_engine_series_container_class .= ' me-px-6';
}

/**
 * Hooks for before the series wrapper
 */
do_action('movie_engine_before_single_series_wrapper');
?>

<div class="movie-engine-single-movie-wrapper movie-engine-plugin movie-engine-layout-fullwidth me-single-series" data-post-id="<?php the_ID(); ?>">
    <?php
    /**
     * Hero Section Hook
     * 
     * @hooked MovieEngine\Frontend\TemplateHooks::render_series_hero_section - 10
     */
    do_action('movie_engine_single_series_hero');
    ?>

    <div class="<?php echo esc_attr($movie_engine_series_container_class); ?> me-main-content">
        <?php
        /**
         * Main Content Hook
         * 
         * @hooked MovieEngine\Frontend\TemplateHooks::render_ad_before_content - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_episodes_section - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_series_cast_section - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_series_trending_section - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_series_new_releases_section - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_series_upcoming_section - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_series_related_section - Dynamic
         * @hooked MovieEngine\Frontend\TemplateHooks::render_ad_after_content - 90
         * @hooked MovieEngine\Frontend\TemplateHooks::render_reviews_section - 100
         */
        do_action('movie_engine_single_series_content');
        ?>
    </div>
</div>

<?php
/**
 * Hooks for after the series wrapper
 */
do_action('movie_engine_after_single_series_wrapper');

get_footer();
