<?php
ob_start();
?>
test
<section>
    <div class="container">
        <h1 class="main__title"><?= $content['title'] ?></h1>
        <div class="main__banner">
            <?php if (!empty($bannerLogo['src'])): ?>
                <img class="redirect-js"
                    width="<?= $bannerLogo['width'] ?? '' ?>"
                    height="<?= $bannerLogo['height'] ?? '' ?>"
                    src="<?= htmlspecialchars($bannerLogo['src']) ?>"
                    alt="<?= $bannerLogo['alt'] ?? '' ?>"
                    title="<?= $bannerLogo['title'] ?? '' ?>">
            <?php endif; ?>
        </div>
        <div class="container">
            <?php if (!empty($content['author-img'])): ?>
                <div class="author">
                    <div class="author__img">
                        <img width="" height="" src="<?= htmlspecialchars($content['author-img']) ?>" alt="<?= htmlspecialchars($content['author-name'] ?? '') ?>" title="<?= htmlspecialchars($content['author-name'] ?? '') ?>">
                    </div>
                    <div class="author__info">
                        <div class="author__name"><?= htmlspecialchars($content['author-name'] ?? '') ?></div>
                        <div class="author__date"> <?= $content['modified-date'] ?? '' ?></div>
                    </div>
                </div>
            <?php endif; ?>
            <div class="main__text">
                <?= $content['top_text'] ?>
            </div>
            <?php if (empty($content['hide-btns'])): ?>
                <div class="pulse__btn main__btn accent-color pass-btn-color redirect-js"><?= $content['content_btn'] ?></div>
            <?php endif; ?>
        </div>
</section>
<section class="casinos">

    <div class="container casinos__wrap">
        <?php if (!empty($casinoItems)): ?>
            <h2 class="casinos__listing"><?= htmlspecialchars($content['listing']) ?></h2>
        <?php endif; ?>

        <?php if (!empty($casinoItems) && is_array($casinoItems)): ?>
            <?php foreach ($casinoItems as $index => $item):
                $isTopThree = $index < 3;
            ?>
                <div class="casinos__item <?= $isTopThree ? 'top-casino' : '' ?>" id="<?= getSlug(htmlspecialchars($item['heading'] ?? '')) ?>">
                    <div class="casinos__info">
                        <div class="casinos__number pass-btn-color accent-color"><?= $index + 1 ?></div>
                        <div class="casinos__image">
                            <div class="redirect-js" data-idp="<?= $index + 1 ?>" data-url="<?= htmlspecialchars($item['keitaro'] ?? '') ?>" data-label="repeater-button-<?= $index + 1 ?>">
                                <?php if (!empty($item['image'])): ?>
                                    <img
                                        width="140" height="92"
                                        class="lazy"
                                        data-src="<?= htmlspecialchars($item['image']) ?>"
                                        alt="<?= isset($item['alt']) ? htmlspecialchars($item['alt']) : '' ?>"
                                        title="<?= isset($item['title']) ? htmlspecialchars($item['title']) : '' ?>">
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="casinos__title">
                            <?php if (!empty($item['heading'])): ?>
                                <div><?= htmlspecialchars($item['heading']) ?></div>
                            <?php endif; ?>
                            <div class="casinos__rait">
                                <img data-src="images/Star.svg" class="lazy" alt="star" title="star" width="24" height="24">
                                <div class="casinos__rating-box">
                                    <span class="casinos__rating-value"><?= $item['rating'] ?? calculateRating($index) ?> &nbsp;</span> / 10
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="casinos__bonus">
                        <?= isset($item['text']) ? htmlspecialchars($item['text']) : '' ?>
                    </div>

                    <div class="casinos__button">
                        <?php if (!empty($item['keitaro']) && !empty($item['button'])): ?>
                            <div class="redirect-js" data-idp="<?= $index + 1 ?>" data-url="<?= htmlspecialchars($item['keitaro']) ?>" data-label="repeater-button-<?= $index + 1 ?>">
                                <button class="accent-color pass-btn-color">
                                    <?= htmlspecialchars($item['button']) ?>
                                </button>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>

</section>
<section>
    <div class="container">
        <div class="secondary__text">
            <?= htmlspecialchars_decode($content['bottom_text']); ?>
        </div>
    </div>
</section>
<section>
    <div class="container">
        <h2><?= $content['faq-title'] ?? '' ?></h2>
        <div class="accordion-container">
            <?php foreach ($faqItems as $item): ?>
                <div class="accordion-item">
                    <h3 class="accordion-header faq-title-hover-font-color secondary-color faq-title-font-color">
                        <?= htmlspecialchars($item['question']) ?>
                        <span class="icon  faq-title-hover-font-color faq-title-font-color">+</span>
                    </h3>
                    <div class="accordion-content secondary-color faq-title-font-color">
                        <p>
                            <?= htmlspecialchars($item['answer']) ?>
                        </p>
                    </div>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<?php
$pageContent = ob_get_clean();
include __DIR__ . '/layouts/main.php';
?>