<?php
/**
 * Blog Over Informational Notice Control
 *
 * Displays a subtle informational notice in the WordPress Customizer.
 * Used to inform users about additional options available in Blog Over Pro.
 * Follows WordPress.org theme guidelines — no aggressive upsell.
 *
 * @package Blog_Over
 * @since 2.1.0
 */

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

if (!class_exists('WP_Customize_Control')) {
    return;
}

/**
 * Informational notice control for the Customizer.
 *
 * Renders a subtle text notice with an optional link.
 * No badges, no feature lists, no buttons — just informational text.
 */
class Blog_Over_Info_Control extends WP_Customize_Control
{

    /**
     * Control type.
     *
     * @var string
     */
    public $type = 'blog_over_info';

    /**
     * URL for the optional "Learn more" link.
     *
     * @var string
     */
    public $info_url = '';

    /**
     * Link text for the optional link.
     *
     * @var string
     */
    public $info_link_text = '';

    /**
     * Render the control content.
     */
    public function render_content()
    {
        ?>
        <div class="blog-over-info-notice">
            <?php if (!empty($this->label)): ?>
                <p class="blog-over-info-text">
                    <?php echo esc_html($this->label); ?>
                </p>
            <?php endif; ?>

            <?php if (!empty($this->info_url) && !empty($this->info_link_text)): ?>
                <a href="<?php echo esc_url($this->info_url); ?>" class="blog-over-info-link" target="_blank"
                    rel="noopener noreferrer">
                    <?php echo esc_html($this->info_link_text); ?>
                </a>
            <?php endif; ?>
        </div>
        <?php
    }
}
