HEX
Server: nginx/1.18.0
System: Linux vcwordpress 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/viitorx.stgviitor.com/wp-content/themes/viitorx/front-page.php
<?php

/**
 * Front page template — ViitorX marketing site (content only; chrome lives in header.php / footer.php).
 *
 * @package ViitorX
 */

get_header();

if (function_exists('have_rows') && have_rows('page_sections')) :
    while (have_rows('page_sections')) : the_row();

        // ── HERO ──────────────────────────────────────────────────────────────
        if (get_row_layout() === 'section_hero') :
            $hero_video      = get_template_directory_uri() . '/assets/videos/hero-loop-video.webm';
            $hero_headlines  = get_sub_field('hero_headlines');
            $hero_lead       = get_sub_field('hero_lead');
            $btn1_label      = get_sub_field('hero_btn_primary_label');
            $btn1_target     = get_sub_field('hero_btn_primary_target');
            $btn2_label      = get_sub_field('hero_btn_outline_label');
            $btn2_target     = get_sub_field('hero_btn_outline_target');
?>
            <section id="hero">
                <?php get_template_part('template-parts/hero-wordmark'); ?>

                <div class="hero-video-wrap">
                    <video autoplay loop muted playsinline preload="metadata" fetchpriority="high">
                        <source src="<?php echo esc_url($hero_video); ?>" type="video/webm">
                    </video>
                </div>

                <div class="hero-content">
                    <?php if ($hero_headlines) : ?>
                        <div class="hero-headline">
                            <h1>
                                <?php foreach ($hero_headlines as $hl) : ?>
                                    <?php if (! empty($hl['headline_text'])) : ?>
                                        <span><em><?php echo esc_html($hl['headline_text']); ?></em></span>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            </h1>
                        </div>
                    <?php endif; ?>
                    <div class="hero-bottom">
                        <div class="hero-right">
                            <?php if ($hero_lead) : ?>
                                <p class="hero-lead"><?php echo esc_html($hero_lead); ?></p>
                            <?php endif; ?>
                            <?php if (($btn1_label && $btn1_target) || ($btn2_label && $btn2_target)) : ?>
                                <div class="hero-buttons">
                                    <?php if ($btn1_label && $btn1_target) : ?>
                                        <button class="btn-primary" onclick="document.getElementById('<?php echo esc_attr($btn1_target); ?>').scrollIntoView({behavior:'smooth'})"><?php echo esc_html($btn1_label); ?></button>
                                    <?php endif; ?>
                                    <?php if ($btn2_label && $btn2_target) : ?>
                                        <button class="btn-outline" onclick="document.getElementById('<?php echo esc_attr($btn2_target); ?>').scrollIntoView({behavior:'smooth'})"><?php echo esc_html($btn2_label); ?></button>
                                    <?php endif; ?>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </section>
            <?php

        // ── OFFERINGS ─────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_offerings') :
            $offerings_eyebrow = get_sub_field('offerings_eyebrow');
            $offerings_items   = get_sub_field('offerings_items');

            if ($offerings_items) :
            ?>
                <section id="offerings">
                    <div class="offerings-desktop">
                        <div class="offerings-stack-wrap" id="offerings-stack-wrap">
                            <div class="offerings-stage" id="offerings-stage">
                                <h2 class="offerings-heading">Offerings</h2>
                                <div class="offering-progressive">
                                    <div class="offerings-left-column">
                                        <div class="offerings-eyebrow-wrap">
                                            <?php if ($offerings_eyebrow) : ?>
                                                <p class="offerings-eyebrow"><?php echo esc_html($offerings_eyebrow); ?></p>
                                            <?php endif; ?>
                                        </div>
                                        <div class="offering-progressive-copy" id="offering-progressive-copy">
                                            <?php foreach ($offerings_items as $oi => $offer) : ?>
                                                <div class="offering-progressive-block" data-offering-index="<?php echo (int) $oi; ?>">
                                                    <div class="offering-progressive-block-inner">
                                                        <?php if (! empty($offer['title'])) : ?>
                                                            <h3><?php echo esc_html($offer['title']); ?></h3>
                                                        <?php endif; ?>
                                                        <?php if (! empty($offer['text'])) : ?>
                                                            <p class="offering-desc"><?php echo esc_html($offer['text']); ?></p>
                                                        <?php endif; ?>
                                                    </div>
                                                </div>
                                            <?php endforeach; ?>
                                        </div>
                                    </div>
                                    <div class="offering-progressive-visual">
                                        <div class="offering-visual-frame">
                                            <div class="offering-visual-layers" id="offering-visual-layers" aria-hidden="true">
                                                <?php foreach ($offerings_items as $oi => $offer) : ?>
                                                    <?php if (! empty($offer['image']['url'])) : ?>
                                                        <?php
                                                        $load_attr = (0 === (int) $oi) ? 'eager' : 'lazy';
                                                        $prior     = (0 === (int) $oi) ? ' fetchpriority="high"' : '';
                                                        ?>
                                                        <img class="offering-visual-layer" data-offering-index="<?php echo (int) $oi; ?>" src="<?php echo esc_url($offer['image']['url']); ?>" alt="<?php echo esc_attr($offer['image']['alt'] ?? ''); ?>" loading="<?php echo esc_attr($load_attr); ?>" decoding="async" <?php echo $prior; ?> />
                                                    <?php endif; ?>
                                                <?php endforeach; ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="offerings-mobile-stack" id="offerings-mobile-stack">
                        <header class="offerings-mobile-sticky-title">
                            <?php if ($offerings_eyebrow) : ?>
                                <p class="offerings-mobile-heading"><?php echo esc_html($offerings_eyebrow); ?></p>
                            <?php endif; ?>
                        </header>
                        <?php foreach ($offerings_items as $omi => $offer) : ?>
                            <article class="offering-mobile-slide">
                                <div class="offering-mobile-slide-media">
                                    <?php if (! empty($offer['image']['url'])) : ?>
                                        <div class="offering-mobile-slide-bg" aria-hidden="true">
                                            <img
                                                src="<?php echo esc_url($offer['image']['url']); ?>"
                                                alt="<?php echo esc_attr($offer['image']['alt'] ?? ''); ?>"
                                                decoding="async"
                                                loading="<?php echo 0 === (int) $omi ? 'eager' : 'lazy'; ?>"
                                                <?php echo 0 === (int) $omi ? 'fetchpriority="high"' : ''; ?> />
                                        </div>
                                    <?php endif; ?>
                                    <div class="offering-mobile-slide-overlay" aria-hidden="true"></div>
                                </div>
                                <div class="offering-mobile-slide-content">
                                    <div class="offering-mobile-slide-text">
                                        <?php if ($offerings_eyebrow) : ?>
                                            <p class="offerings-eyebrow offerings-eyebrow--mobile"><?php echo esc_html($offerings_eyebrow); ?></p>
                                        <?php endif; ?>
                                        <?php if (! empty($offer['title'])) : ?>
                                            <h3><?php echo esc_html($offer['title']); ?></h3>
                                        <?php endif; ?>
                                        <?php if (! empty($offer['text'])) : ?>
                                            <p class="offering-desc"><?php echo esc_html($offer['text']); ?></p>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </article>
                        <?php endforeach; ?>
                    </div>
                </section>
            <?php
            endif; // offerings_items

        // ── WORK ──────────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_work') :
            $work_heading      = get_sub_field('work_heading');
            $work_case_studies = get_sub_field('work_case_studies');
            ?>
            <section id="work">
                <?php if ($work_heading) : ?>
                    <h2 class="work-eyebrow"><?php echo esc_html($work_heading); ?></h2>
                <?php endif; ?>
                <?php if ($work_case_studies) : ?>
                    <?php foreach ($work_case_studies as $work_cs_i => $work_cs_post) : ?>
                        <?php
                        $work_cs_permalink = get_permalink($work_cs_post->ID);
                        $work_cs_thumb     = get_the_post_thumbnail_url($work_cs_post->ID, 'full');
                        $work_cs_title     = get_the_title($work_cs_post->ID);
                        $work_cs_excerpt   = get_the_excerpt($work_cs_post->ID);
                        $work_cs_aria      = sprintf(
                            /* translators: %s: case study title */
                            __('View case study: %s', 'viitorx'),
                            $work_cs_title
                        );
                        $work_cs_eager = (0 === (int) $work_cs_i);
                        ?>
                        <div class="work-slide" <?php echo $work_cs_eager ? ' id="work-first-slide"' : ''; ?>>
                            <div class="work-slide-bg<?php echo $work_cs_thumb ? '' : ' work-slide-bg--empty'; ?>"<?php echo $work_cs_thumb ? ' style="--work-slide-blur-bg:url(\'' . esc_url( $work_cs_thumb ) . '\')"' : ''; ?>>
                                <?php if ($work_cs_thumb) : ?>
                                    <img src="<?php echo esc_url($work_cs_thumb); ?>" alt="<?php echo esc_attr($work_cs_title); ?>" decoding="async" loading="<?php echo $work_cs_eager ? 'eager' : 'lazy'; ?>" <?php echo $work_cs_eager ? ' fetchpriority="high"' : ''; ?> />
                                <?php endif; ?>
                            </div>
                            <div class="work-slide-content">
                                <div class="work-slide-info">
                                    <h3><?php echo esc_html($work_cs_title); ?></h3>
                                    <p><?php echo esc_html(wp_strip_all_tags($work_cs_excerpt)); ?></p>
                                </div>
                                <a class="work-arrow-btn" href="<?php echo esc_url($work_cs_permalink); ?>" aria-label="<?php echo esc_attr($work_cs_aria); ?>">
                                    <svg viewBox="0 0 24 24" stroke-width="1.5" aria-hidden="true" focusable="false">
                                        <line x1="7" y1="17" x2="17" y2="7" />
                                        <polyline points="7,7 17,7 17,17" />
                                    </svg>
                                </a>
                            </div>
                        </div>
                    <?php endforeach; ?>
                <?php endif; ?>
            </section>
        <?php

        // ── PARTNERS ──────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_partners') :
            $strategic_heading  = get_sub_field('strategic_heading');
            $strategic_partners = get_sub_field('strategic_partners');
            $general_heading    = get_sub_field('general_heading');
            $general_logos      = get_sub_field('general_logos');
        ?>
            <section id="partners">
                <?php if ($strategic_partners) : ?>
                    <div style="position: relative;">
                        <?php if ($strategic_heading) : ?>
                            <h2 class="reveal partners-subheading"><?php echo esc_html($strategic_heading); ?></h2>
                        <?php endif; ?>
                        <div class="partners-grid" style="margin-bottom: 24px;">
                            <?php foreach ($strategic_partners as $partner) : ?>
                                <?php if (! empty($partner['logo']['url'])) : ?>
                                    <div class="partner-card reveal">
                                        <img src="<?php echo esc_url($partner['logo']['url']); ?>" alt="<?php echo esc_attr($partner['logo']['alt'] ?? ''); ?>" loading="lazy">
                                    </div>
                                <?php endif; ?>
                            <?php endforeach; ?>
                        </div>
                    </div>
                <?php endif; ?>

                <div class="partners-tier-spacer"></div>

                <?php if ($general_logos) : ?>
                    <div style="position: relative;">
                        <?php if ($general_heading) : ?>
                            <h3 class="reveal partners-subheading"><?php echo esc_html($general_heading); ?></h3>
                        <?php endif; ?>
                        <div class="partners-grid">
                            <?php foreach ($general_logos as $logo_item) : ?>
                                <?php if (! empty($logo_item['logo']['url'])) : ?>
                                    <div class="partner-card reveal">
                                        <img src="<?php echo esc_url($logo_item['logo']['url']); ?>" alt="<?php echo esc_attr($logo_item['logo']['alt'] ?? ''); ?>" loading="lazy">
                                    </div>
                                <?php endif; ?>
                            <?php endforeach; ?>
                        </div>
                    </div>
                <?php endif; ?>
            </section>
        <?php

        // ── MAGIC HOW ─────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_magic_how') :
            $magic_heading  = get_sub_field('magic_how_heading');
            $magic_steps    = get_sub_field('magic_how_steps');
            $magic_footnote = get_sub_field('magic_how_footnote');
        ?>
            <section id="magic-how">
                <?php if ($magic_heading) : ?>
                    <h2 class="magic-how-eyebrow"><?php echo esc_html($magic_heading); ?></h2>
                <?php endif; ?>

                <div id="magic-how-pin-root" class="magic-how-pin-root">
                    <div class="magic-how-body">
                        <div class="magic-how-svg-wrap magic-how-desktop-rail">
                            <div class="magic-how-diagram-stage">
                                <div class="magic-how-diagram-inner">
                                    <svg viewBox="0 0 1604 298" class="magic-how-svg" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
                                        <defs>
                                            <filter id="magic-how-soft" x="-20%" y="-20%" width="140%" height="140%">
                                                <feGaussianBlur in="SourceGraphic" stdDeviation="0.35" />
                                            </filter>
                                            <linearGradient id="magicHowPathStrokeGrad" gradientUnits="userSpaceOnUse" x1="2" y1="149" x2="1602" y2="149">
                                                <stop offset="0%" stop-color="#edeae3" stop-opacity="0" />
                                                <stop offset="10%" stop-color="#edeae3" stop-opacity="0.95" />
                                                <stop offset="90%" stop-color="#edeae3" stop-opacity="0.95" />
                                                <stop offset="100%" stop-color="#edeae3" stop-opacity="0" />
                                            </linearGradient>
                                        </defs>
                                        <path id="magicHowPathStroke" class="magic-how-path-fill magic-how-path-main" d="M2 295.576C32.1141 263.343 70.8629 247.227 118.246 247.227C189.321 247.227 203.345 280.653 277.876 271.7C352.407 262.746 408.028 203.653 487.008 203.653C565.989 203.653 583.788 221.56 644.97 215.591C706.152 209.622 723.951 155.901 802.931 155.901C881.912 155.901 909.722 167.839 960.893 167.839C1012.06 167.839 1039.73 108.149 1118.85 108.149C1197.98 108.149 1211.18 120.087 1277.37 120.087C1343.56 120.087 1368.19 80.3553 1434.78 48.4593C1483.26 20.576 1529.36 -1.924 1602 2.57558"></path>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="108.9" cy="247.4" class="magic-how-node-ring" r="13" />
                                            <circle cx="108.9" cy="247.4" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="343.3" cy="252" class="magic-how-node-ring" r="13" />
                                            <circle cx="343.3" cy="252" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="574.3" cy="212.1" class="magic-how-node-ring" r="13" />
                                            <circle cx="574.3" cy="212.1" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="801.3" cy="155.9" class="magic-how-node-ring" r="13" />
                                            <circle cx="801.3" cy="155.9" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="1033.4" cy="135.4" class="magic-how-node-ring" r="13" />
                                            <circle cx="1033.4" cy="135.4" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="1268.1" cy="120" class="magic-how-node-ring" r="13" />
                                            <circle cx="1268.1" cy="120" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <g class="magic-how-node-marker magic-how-desktop-node-marker" aria-hidden="true">
                                            <circle cx="1484.5" cy="22.8" class="magic-how-node-ring" r="13" />
                                            <circle cx="1484.5" cy="22.8" class="magic-how-node-dot" r="5" />
                                        </g>
                                        <line class="magic-how-connector-down magic-how-cc" x1="108.9" y1="260.4" x2="108.9" y2="297" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                        <line class="magic-how-connector-up magic-how-cc" x1="343.3" y1="239" x2="343.3" y2="152" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                        <line class="magic-how-connector-down magic-how-cc" x1="574.3" y1="225.1" x2="574.3" y2="272" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                        <line class="magic-how-connector-up magic-how-cc" x1="801.3" y1="142.9" x2="801.3" y2="58" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                        <line class="magic-how-connector-down magic-how-cc" x1="1033.4" y1="148.4" x2="1033.4" y2="196" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                        <line class="magic-how-connector-up magic-how-cc" x1="1268.1" y1="107" x2="1268.1" y2="20" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                        <line class="magic-how-connector-down magic-how-cc" x1="1484.5" y1="35.8" x2="1484.5" y2="118" stroke="rgba(237,234,227,0.72)" stroke-width="2" stroke-opacity="1" vector-effect="non-scaling-stroke" />
                                    </svg>
                                </div>
                                <?php if ($magic_steps) : ?>
                                    <?php
                                    $mh_node_attrs = array(
                                        array('enter' => 'bottom', 'lx' => 0.0679, 'ay' => 0.8303, 'below' => ''),
                                        array('enter' => 'top',    'lx' => 0.2141, 'ay' => 0.8457, 'below' => ''),
                                        array('enter' => 'bottom', 'lx' => 0.3581, 'ay' => 0.7119, 'below' => ''),
                                        array('enter' => 'top',    'lx' => 0.4996, 'ay' => 0.5232, 'below' => ''),
                                        array('enter' => 'bottom', 'lx' => 0.6443, 'ay' => 0.4545, 'below' => ''),
                                        array('enter' => 'top',    'lx' => 0.7680, 'ay' => 0.4027, 'below' => ''),
                                        array('enter' => 'bottom', 'lx' => 0.9255, 'ay' => 0.0764, 'below' => '32px'),
                                    );
                                    ?>
                                    <div class="magic-how-overlay">
                                        <?php foreach ($magic_steps as $si => $step) : ?>
                                            <?php if (! empty($step['step_text']) && isset($mh_node_attrs[$si])) : ?>
                                                <?php
                                                $attr  = $mh_node_attrs[$si];
                                                $style = '--lx: ' . $attr['lx'] . '; --ay: ' . $attr['ay'] . ';';
                                                if ($attr['below']) {
                                                    $style .= ' --below-extra: ' . $attr['below'] . ';';
                                                }
                                                ?>
                                                <div class="magic-how-step-label" data-enter="<?php echo esc_attr($attr['enter']); ?>" style="<?php echo esc_attr($style); ?>">
                                                    <p><?php echo esc_html($step['step_text']); ?></p>
                                                </div>
                                            <?php endif; ?>
                                        <?php endforeach; ?>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>

                        <?php if ($magic_steps) : ?>
                            <div class="magic-how-mobile-rail magic-how-stack" aria-live="polite">
                                <div class="magic-how-mobile-progress-line" id="magicHowMobileRailFill" aria-hidden="true"></div>
                                <?php foreach ($magic_steps as $step) : ?>
                                    <?php if (! empty($step['step_text'])) : ?>
                                        <div class="magic-how-mobile-step">
                                            <div class="magic-how-mobile-pin" aria-hidden="true">
                                                <span class="magic-how-mobile-dot"></span><span class="magic-how-mobile-stem"></span>
                                            </div>
                                            <p><?php echo esc_html($step['step_text']); ?></p>
                                        </div>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>

                        <?php if ($magic_footnote) : ?>
                            <p class="magic-how-footnote" id="magicHowFootnote">
                                <?php echo esc_html($magic_footnote); ?>
                            </p>
                        <?php endif; ?>
                    </div>
                    <div class="magic-how-scroll-cue magic-how-desktop-rail" id="magicHowScrollCue" aria-hidden="true">
                        <span class="magic-how-scroll-cue__mouse" aria-hidden="true">
                            <svg width="32" height="48" viewBox="0 0 32 48" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect x="8" y="6" width="16" height="26" rx="8" stroke="rgba(237,234,227,0.9)" stroke-width="1.5" />
                                <path d="M16 12v4" stroke="rgba(237,234,227,0.95)" stroke-width="1.5" stroke-linecap="round" />
                            </svg>
                        </span>
                        <span class="magic-how-scroll-cue__label">Keep scrolling</span>
                    </div>
                </div>
            </section>
        <?php

        // ── PROCESS (WHERE WE BELONG) ──────────────────────────────────────────
        elseif (get_row_layout() === 'section_process') :
            $process_heading = get_sub_field('process_heading');
            $stats           = get_sub_field('stats');
            $sectors         = get_sub_field('sectors');
            $sector_total    = $sectors ? count($sectors) : 0;
        ?>
            <section id="process">
                <?php if ($process_heading) : ?>
                    <h2 class="reveal process-eyebrow"><?php echo esc_html($process_heading); ?></h2>
                <?php endif; ?>

                <div class="process-wrapper">
                    <?php if ($stats) : ?>
                        <div class="process-stats-sticky" id="process-stats-sticky">
                            <div class="sector-stats">
                                <?php foreach ($stats as $stat) : ?>
                                    <?php if (isset($stat['count'])) : ?>
                                        <div class="stat-item js-count-stat" data-count-to="<?php echo (int) $stat['count']; ?>" data-count-suffix="<?php echo esc_attr($stat['suffix'] ?? ''); ?>">
                                            <h4 class="stat-count-display">0<?php echo esc_html($stat['suffix'] ?? ''); ?></h4>
                                            <?php if (! empty($stat['label'])) : ?>
                                                <p><?php echo esc_html($stat['label']); ?></p>
                                            <?php endif; ?>
                                        </div>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    <?php endif; ?>

                    <?php if ($sectors) : ?>
                        <div class="sectors-container sectors-stack--dissolve">
                            <?php foreach ($sectors as $si => $sector) : ?>
                                <?php
                                $curr_num   = str_pad($si + 1, 2, '0', STR_PAD_LEFT);
                                $total_num  = str_pad($sector_total, 2, '0', STR_PAD_LEFT);
                                $aria_label = sprintf('Slide %d of %d', $si + 1, $sector_total);
                                $is_first   = (0 === (int) $si);
                                ?>
                                <article class="sector-slide">
                                    <div class="sector-slide-inner">
                                        <div class="sector-slide-col sector-slide-col--lead">
                                            <span class="sector-counter" aria-label="<?php echo esc_attr($aria_label); ?>">
                                                <span class="sector-counter-curr"><?php echo esc_html($curr_num); ?></span><span class="sector-counter-sep">/</span><span class="sector-counter-max"><?php echo esc_html($total_num); ?></span>
                                            </span>
                                            <div class="sector-lead-body">
                                                <?php if (! empty($sector['title'])) : ?>
                                                    <h3><?php echo wp_kses_post($sector['title']); ?></h3>
                                                <?php endif; ?>
                                                <?php if (! empty($sector['description'])) : ?>
                                                    <p><?php echo esc_html($sector['description']); ?></p>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                        <?php if (! empty($sector['image']['url'])) : ?>
                                            <div class="sector-slide-col sector-slide-col--media">
                                                <div class="sector-image-wrap">
                                                    <img class="sector-image" src="<?php echo esc_url($sector['image']['url']); ?>" alt="<?php echo esc_attr($sector['image']['alt'] ?? ''); ?>" loading="<?php echo $is_first ? 'eager' : 'lazy'; ?>" decoding="async" <?php echo $is_first ? ' fetchpriority="high"' : ''; ?> />
                                                </div>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                </article>
                            <?php endforeach; ?>
                        </div>
                    <?php endif; ?>
                </div>
            </section>
        <?php

        // ── CTA ───────────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_cta') :
            $cta_hl1        = get_sub_field('cta_headline_1');
            $cta_hl2        = get_sub_field('cta_headline_2');
            $cta_btn_label  = get_sub_field('cta_btn_label');
            $cta_btn_target = get_sub_field('cta_btn_target');
        ?>
            <section id="cta">
                <?php if ($cta_hl1 || $cta_hl2) : ?>
                    <h2 class="reveal">
                        <?php if ($cta_hl1) : ?><?php echo esc_html($cta_hl1); ?><br><?php endif; ?>
                    <?php if ($cta_hl2) : ?><span class="reveal-delay-1"><?php echo esc_html($cta_hl2); ?></span><?php endif; ?>
                    </h2>
                <?php endif; ?>
                <?php if ($cta_btn_label && $cta_btn_target) : ?>
                    <button class="btn-cta reveal reveal-delay-1" onclick="document.getElementById('<?php echo esc_attr($cta_btn_target); ?>').scrollIntoView({behavior:'smooth'})"><?php echo esc_html($cta_btn_label); ?></button>
                <?php endif; ?>
            </section>
        <?php

        // ── INSIGHTS ──────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_insights') :
            $insights_heading = get_sub_field('insights_heading');
            $viitorx_front_insights = new WP_Query(
                array(
                    'post_type'           => 'post',
                    'post_status'         => 'publish',
                    'posts_per_page'      => 3,
                    'ignore_sticky_posts' => true,
                    'no_found_rows'       => true,
                )
            );
            $viitorx_insights_blog_url = function_exists('viitorx_get_page_url_by_template')
                ? viitorx_get_page_url_by_template('template-blog-listing.php')
                : '';
            if ('' === $viitorx_insights_blog_url) {
                $viitorx_insights_blog_url = trailingslashit(home_url('/blog'));
            }
        ?>
            <section id="insights">
                <?php if ($insights_heading) : ?>
                    <h2 class="insights-heading"><?php echo esc_html($insights_heading); ?></h2>
                <?php endif; ?>

                <div class="insights-slider" tabindex="0" role="region" aria-label="<?php esc_attr_e('Insights articles', 'viitorx'); ?>">
                    <div class="insights-grid">
                        <?php
                        if ($viitorx_front_insights->have_posts()) :
                            $fi = 0;
                            while ($viitorx_front_insights->have_posts()) :
                                $viitorx_front_insights->the_post();
                                $idx   = $fi;
                                $thumb   = get_the_post_thumbnail_url(get_the_ID(), 'full');
                                $loading = (0 === $idx) ? 'eager' : 'lazy';
                                ++$fi;
                        ?>
                                <a class="insight-card" href="<?php the_permalink(); ?>">
                                    <div class="insight-image-wrap">
                                        <?php if ($thumb) : ?>
                                            <img src="<?php echo esc_url($thumb); ?>" alt="<?php echo esc_attr(wp_strip_all_tags(get_the_title())); ?>" loading="<?php echo esc_attr($loading); ?>" decoding="async" <?php echo (0 === $idx) ? ' fetchpriority="high"' : ''; ?> />
                                        <?php endif; ?>
                                    </div>
                                    <div class="insight-content">
                                        <h3><?php echo esc_html(wp_strip_all_tags(get_the_title())); ?></h3>
                                    </div>
                                </a>
                        <?php
                            endwhile;
                            wp_reset_postdata();
                        endif;
                        ?>
                    </div>
                </div>

                <div class="insights-footer">
                    <a class="btn-insights" href="<?php echo esc_url($viitorx_insights_blog_url); ?>"><?php esc_html_e('View All', 'viitorx'); ?></a>
                </div>
            </section>
        <?php

        // ── CONTACT ───────────────────────────────────────────────────────────
        elseif (get_row_layout() === 'section_contact') :
            $con_heading_1  = get_sub_field('contact_heading_1');
            $con_heading_2  = get_sub_field('contact_heading_2');
            $con_email      = get_sub_field('contact_email');
            $con_desc       = get_sub_field('contact_description');
            $con_shortcode  = get_sub_field('contact_form_shortcode');
        ?>
            <section id="contact">
                <div class="contact-grid">
                    <div class="contact-left reveal">
                        <?php if ($con_heading_1 || $con_heading_2) : ?>
                            <h2>
                                <?php if ($con_heading_1) : ?><?php echo esc_html($con_heading_1); ?><br><?php endif; ?>
                            <?php if ($con_heading_2) : ?><?php echo esc_html($con_heading_2); ?><?php endif; ?>
                            </h2>
                        <?php endif; ?>
                        <?php if ($con_email) : ?>
                            <div class="contact-email">
                                <img src="<?php echo esc_url(get_template_directory_uri() . '/assets/social/mail.svg'); ?>" alt="" width="30" height="30" decoding="async" />
                                <?php echo esc_html($con_email); ?>
                            </div>
                        <?php endif; ?>
                    </div>
                    <div class="contact-right reveal reveal-delay-1">
                        <?php if ($con_desc) : ?>
                            <p><?php echo esc_html($con_desc); ?></p>
                        <?php endif; ?>
                        <div class="contact-form contact-form-cf7">
                            <?php
                            if ($con_shortcode) {
                                echo do_shortcode($con_shortcode); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                            } else {
                                echo viitorx_get_contact_form_7_markup(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                            }
                            ?>
                        </div>
                    </div>
                </div>
            </section>
<?php

        endif; // end layout checks

    endwhile;
endif;

get_footer();