<?php
/**
 * Top Bar Section (Homepage)
 *
 * Expected variables:
 * - $section (array)
 *   - settings['messages'] => array of strings
 */

$messages = $section['settings']['messages'] ?? [];

if (empty($messages)) {
    return;
}
?>

<div class="top-bar" data-top-bar>
    <div class="container">
        <div class="top-bar-messages">
            <?php foreach ($messages as $message): ?>
                <span class="top-bar-message">
                    <?= htmlspecialchars($message, ENT_QUOTES, 'UTF-8') ?>
                </span>
            <?php endforeach; ?>
        </div>
    </div>
</div>
