<?php
    // Page: Kontakt
    // ID: 84

    get_header();

    $box_1 = get_field('box_1');
    $box_2 = get_field('box_2');
?>
<main id="primary" class="site-main">
    <section class="box-1">
        <div class="box-bg">
            <img src="/wp-content/uploads/2025/10/img-3.svg" alt="">
        </div>
        <div class="container">
            <div class="box-wrapper">
                <div class="row row-1">
                    <div class="col-1">
                        <div id="box-page-name">
                            <?php echo get_the_title(); ?>
                        </div>
                        <div class="box-title">
                            <h2><?php echo $box_1['title']; ?></h2>
                        </div>
                        <div class="box-text">
                            <?php echo $box_1['text']; ?>
                        </div>
                    </div>
                    <div class="col-2">
                        <div class="box-img">
                            <img src="<?php echo $box_1['img']; ?>" alt="">
                        </div>
                    </div>
                </div>
                <div class="row row-2">
                    <ol class="box-list">
                        <li class="box-list-item">
                            <div class="box-list-text">
                                <p><?php echo $box_1['cards'][0]['text']; ?></p>
                            </div>
                            <ul class="box-list-contact">
                                <li>
                                    <?php if ($box_1['cards'][0]['link']['url']): ?>
                                    <a href="<?php echo $box_1['cards'][0]['link']['url']; ?>"><?php echo $box_1['cards'][0]['link']['title']; ?></a>
                                    <?php endif; ?>
                                </li>
                            </ul>
                        </li>
                        <li class="box-list-item">
                            <div class="box-list-text">
                                <p><?php echo $box_1['cards'][1]['text']; ?></p>
                            </div>
                            <ul class="box-list-contact">
                                <li>
                                    <?php if ($box_1['cards'][1]['link']['url']): ?>
                                    <a href="<?php echo $box_1['cards'][1]['link']['url']; ?>"><?php echo $box_1['cards'][1]['link']['title']; ?></a>
                                    <?php endif; ?>
                                </li>
                            </ul>
                        </li>
                        <li class="box-list-item">
                            <div class="box-list-text">
                                <p><?php echo $box_1['cards'][2]['text']; ?></p>
                            </div>
                            <ul class="box-list-contact">
                                <li>
                                    <?php if ($box_1['cards'][2]['link']['url']): ?>
                                    <a href="<?php echo $box_1['cards'][2]['link']['url']; ?>"><?php echo $box_1['cards'][2]['link']['title']; ?></a>
                                    <?php endif; ?>
                                </li>
                            </ul>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </section>
    <section class="box-2">
        <div class="box-bg">
            <img src="/wp-content/uploads/2025/10/img-5.svg" alt="">
        </div>
        <div class="container">
            <div class="row">
                <div class="col-1">
                    <div class="box-title">
                        <h2><?php echo $box_2['title']; ?></h2>
                    </div>
                    <div class="box-text">
                        <?php echo $box_2['text']; ?>
                    </div>

                    <ol class="contact-list">
                        <?php foreach ($box_2['contacts'] as $contact) : ?>
                        <li class="contact-item">
                            <div class="item-bg">
                                <img src="/wp-content/uploads/2025/10/kontakt-3.svg" alt="">
                            </div>
                            <div class="contact-item-img">
                                <img src="/wp-content/uploads/2025/10/Group-561.svg" alt="">
                                <div class="img">
                                    <img src="<?php echo $contact['img']; ?>" alt="">
                                </div>
                            </div>
                            <div class="contact-item-content">
                                <div class="contact-name">
                                    <p><?php echo $contact['name']; ?></p>
                                </div>
                                <ul>
                                    <?php foreach ($contact['lista'] as $item) : ?>
                                        <?php if ($item['link']['title']): ?>
                                            <li>
                                                <img src="<?php echo $item['icon']; ?>" alt="">
                                                <a href="<?php echo $item['link']['url']; ?>"><?php echo $item['link']['title']; ?></a>
                                            </li>
                                        <?php endif; ?>
                                    <?php endforeach; ?>
                                </ul>
                            </div>
                        </li>
                        <?php endforeach; ?>
                    </ol>
                </div>
                <div class="col-2">
                    <div class="box-image">
                        <img src="<?php echo $box_2['img']; ?>" alt="">
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<?php get_footer(); ?>