<?php
/**
 * Displays footer sidebars.
 */

$has_footer_sidebar_1 = is_active_sidebar( 'footer-sidebar-1' );
$has_footer_sidebar_2 = is_active_sidebar( 'footer-sidebar-2' );
$has_footer_sidebar_3 = is_active_sidebar( 'footer-sidebar-3' );
$has_footer_sidebar_4 = is_active_sidebar( 'footer-sidebar-4' );

if ( $has_footer_sidebar_1 || $has_footer_sidebar_2 || $has_footer_sidebar_3 || $has_footer_sidebar_4 ) {
    ?>

    <aside class="footer-widgets-area uk-section uk-section-large" role="complementary">
        <div class="uk-container<?php echo esc_attr( basho_get_container_width_class( 'footer' ) ); ?>">
            <div class="uk-grid uk-child-width-1-1 uk-child-width-1-2@s uk-child-width-1-4@m uk-child-width-1-4@l" data-uk-grid="masonry: 1;">

                <?php if ( $has_footer_sidebar_1 ) { ?>

    				<div>
                        <div class="sidebar-1">
        					<?php dynamic_sidebar( 'footer-sidebar-1' ); ?>
                        </div>
    				</div>

    			<?php } ?>

                <?php if ( $has_footer_sidebar_2 ) { ?>

    				<div>
                        <div class="sidebar-2">
        					<?php dynamic_sidebar( 'footer-sidebar-2' ); ?>
                        </div>
    				</div>

    			<?php } ?>

                <?php if ( $has_footer_sidebar_3 ) { ?>

    				<div>
                        <div class="sidebar-3">
        					<?php dynamic_sidebar( 'footer-sidebar-3' ); ?>
                        </div>
    				</div>

    			<?php } ?>

                <?php if ( $has_footer_sidebar_4 ) { ?>

    				<div>
                        <div class="sidebar-4">
        					<?php dynamic_sidebar( 'footer-sidebar-4' ); ?>
                        </div>
    				</div>

    			<?php } ?>

            </div>
        </div>
    </aside> <!-- .footer-widgets-area -->

    <?php
}
