<?php 
/**
 * Template part for displaying Featured Albums Section
 *
 *@package Rock Studio
 */
    $featured_albums_section_title           = rock_studio_get_option( 'featured_albums_section_title' );
    $number_of_featured_albums_items         = rock_studio_get_option( 'number_of_featured_albums_items' ); ?>

    <?php if( !empty($featured_albums_section_title) ): ?>
        <div class="section-header">
            <h2 class="section-title"><?php echo esc_html($featured_albums_section_title);?></h2>
        </div><!-- .section-header -->
    <?php endif; ?>

    <div class="section-content col-3 clear">
        <?php for( $i=1; $i<=$number_of_featured_albums_items; $i++ ) : 
            $featured_albums_image[$i]              = rock_studio_get_option( 'featured_albums_image_'.$i );
            $featured_albums_title[$i]              = rock_studio_get_option( 'featured_albums_title_'.$i );
            $featured_albums_content[$i]          = rock_studio_get_option( 'featured_albums_content_'.$i );
            $featured_albums_button_label[$i]       = rock_studio_get_option( 'featured_albums_button_label_'.$i );
            $featured_albums_button_url[$i]          = rock_studio_get_option( 'featured_albums_button_url_'.$i );
        ?>          
            
        <article>
            <div class="album-item">
                <div class="featured-image" style="background-image: url('<?php echo esc_url($featured_albums_image[$i]); ?>');">
                </div><!-- .featured-image -->

                <div class="entry-container">
                    <?php if( !empty($featured_albums_title[$i]) || !empty($featured_albums_content[$i]) ):?>
                        <header class="entry-header">
                            <?php if( !empty($featured_albums_title[$i]) ):?>
                                <h2 class="entry-title"><a href="<?php echo esc_html( $featured_albums_button_url[$i] ); ?>"><?php echo esc_html( $featured_albums_title[$i] ); ?></a></h2>
                            <?php endif; ?>

                            <?php if( !empty($featured_albums_content[$i]) ): ?>
                                <p><?php echo esc_html( $featured_albums_content[$i] ); ?></p>
                            <?php endif; ?>
                        </header>
                    <?php endif; ?>

                    <?php if( !empty($featured_albums_button_label[$i]) ):?>
                        <a href="<?php echo esc_html( $featured_albums_button_url[$i] ); ?>" class="btn"><?php echo esc_html( $featured_albums_button_label[$i] ); ?><i class="fas fa-angle-right"></i></a>
                    <?php endif; ?>
                </div><!-- .entry-container -->
            </div><!-- .album-item -->
        </article>
        <?php endfor; ?>
    </div><!-- .section-content -->