<?php
if ( get_theme_mod( 'rebeccalite_promo_boxes_show' ) ) {
    ?>
    <div class="rebeccalite-promo-boxes">
        <div class="row">
            <?php for ( $i = 1; $i <= 3; $i++ ) { ?>
            <div class="col-sm-6 col-md-4">
                <div class="promo-box-item">
                    
                    <?php
                        $image_id = attachment_url_to_postid( esc_url( get_theme_mod( "rebeccalite_promo_box_image_{$i}" ) ) );
                        echo wp_get_attachment_image( $image_id, 'medium', false, array(
                            'sizes' => '(max-width: 575.98px) calc( 100vw - 24px ),
                                (max-width: 767.98px) 246px,
                                (max-width: 991.98px) 216px,
                                (max-width: 1199.98px) 296px,
                                (max-width: 1399.98px) 356px,
                                416px'
                        ) );
                    ?>
                    <a href="<?php echo esc_url( get_theme_mod( "rebeccalite_promo_box_link_{$i}" ) ); ?>">
                        <?php echo esc_html( get_theme_mod( "rebeccalite_promo_box_title_{$i}", __( 'Box', 'rebeccalite' ) . ' ' . $i ) ); ?>
                    </a>
                </div>
            </div>
            <?php } ?>
        </div>
    </div>
    <?php
}
