<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }
$post_type = get_query_var( 'post_type' );
if ( is_array( $post_type ) ) { $post_type = reset( $post_type ); }
$post_type = $post_type ?: get_post_type();
$layout = function_exists( 'lt_theme_archive_layout' ) ? lt_theme_archive_layout( $post_type ) : 'grid';
$columns = function_exists( 'lt_theme_archive_columns' ) ? lt_theme_archive_columns( $post_type ) : 3;
$heading_key = $post_type . '_archive_heading';
$intro_key   = $post_type . '_archive_intro';
?>
<main id="main-content">
<section class="lt-page-hero <?php echo esc_attr(lt_theme_archive_hero_class()); ?>"><div class="lt-container"><?php lt_theme_breadcrumbs(); ?><div class="lt-kicker"><?php echo esc_html( lt_theme_firm_name() ); ?></div><h1><?php echo esc_html( lt_theme_option( $heading_key ) ?: post_type_archive_title( '', false ) ); ?></h1><?php if ( lt_theme_option( $intro_key ) ) : ?><p class="lt-lead"><?php echo esc_html( lt_theme_option( $intro_key ) ); ?></p><?php else : ?><?php the_archive_description( '<div class="lt-lead">', '</div>' ); ?><?php endif; ?></div></section>
<section class="lt-section"><div class="lt-container"><div class="lt-archive-<?php echo esc_attr( $layout ); ?> lt-archive-responsive" style="<?php echo esc_attr( lt_theme_archive_columns_style( $post_type ) ); ?>">
<?php while ( have_posts() ) : the_post(); lt_theme_archive_card( get_the_ID(), $post_type ); endwhile; ?>
</div><?php the_posts_pagination(); ?></div></section>
</main>
