<?php
get_header();
$layout=lt_theme_option('practice_archive_layout');$show_filters=(bool)lt_theme_option('archive_show_filters');$show_images=(bool)lt_theme_option('archive_show_images');$show_excerpts=(bool)lt_theme_option('archive_show_excerpts');$search=lt_theme_filter_value('lt_q');
?>
<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(function_exists('lt_core_label')?lt_core_label('practice',__('Expertise','law-temple-theme')):__('Expertise','law-temple-theme')); ?></div><h1><?php echo esc_html(lt_theme_option('practice_archive_heading')?: (function_exists('lt_core_label')?lt_core_label('practice',__('Practice Areas','law-temple-theme')):post_type_archive_title('',false))); ?></h1><?php if(lt_theme_option('practice_archive_intro')): ?><p class="lt-lead"><?php echo esc_html(lt_theme_option('practice_archive_intro')); ?></p><?php endif; ?></div></section>
<section class="lt-section"><div class="lt-container">
<?php if($show_filters): ?><form class="lt-filterbar lt-filterbar--server" method="get" action="<?php echo esc_url(get_post_type_archive_link('practice')); ?>" role="search"><label class="screen-reader-text" for="lt-practice-q"><?php esc_html_e('Search Practice Areas','law-temple-theme'); ?></label><input id="lt-practice-q" type="search" name="lt_q" value="<?php echo esc_attr($search); ?>" placeholder="<?php esc_attr_e('Search Practice Areas','law-temple-theme'); ?>"><button class="lt-button lt-button--primary" type="submit"><?php esc_html_e('Search','law-temple-theme'); ?></button><?php if($search): ?><a class="lt-button lt-button--text" href="<?php echo esc_url(lt_theme_filter_reset_url()); ?>"><?php esc_html_e('Reset','law-temple-theme'); ?></a><?php endif; ?></form><?php endif; ?>
<?php if(have_posts()): ?>
<?php if('accordion'===$layout): ?><div class="lt-accordion"><?php $i=0;while(have_posts()):the_post();$i++;$panel='practice-archive-'.$i; ?><article class="lt-accordion-item"><button type="button" class="lt-accordion-button" data-accordion-button aria-expanded="false" aria-controls="<?php echo esc_attr($panel); ?>"><span><?php echo esc_html(str_pad((string)$i,2,'0',STR_PAD_LEFT).'  '.get_the_title()); ?></span><span aria-hidden="true">+</span></button><div class="lt-accordion-panel" id="<?php echo esc_attr($panel); ?>" hidden><?php if($show_excerpts): ?><p><?php echo esc_html(get_the_excerpt()); ?></p><?php endif; ?><a class="lt-button lt-button--text" href="<?php the_permalink(); ?>"><?php esc_html_e('View Practice Area','law-temple-theme'); ?> →</a></div></article><?php endwhile; ?></div>
<?php else: ?><div class="lt-practice-archive--<?php echo esc_attr($layout); ?> <?php echo 'numbered'===$layout?'lt-practice-list':'lt-archive-responsive'; ?>" <?php if('numbered'!==$layout): ?>style="<?php echo esc_attr(lt_theme_archive_columns_style('practice')); ?>"<?php endif; ?>><?php $i=0;while(have_posts()):the_post();$i++; ?><article class="<?php echo 'numbered'===$layout?'lt-practice-row':'lt-card'; ?>"><?php if('numbered'===$layout): ?><span class="num"><?php echo esc_html(str_pad((string)$i,2,'0',STR_PAD_LEFT)); ?></span><h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3><span aria-hidden="true">→</span><?php else: ?><?php if($show_images&&'image-cards'===$layout&&has_post_thumbnail()): ?><a class="lt-card-media" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('lt-card'); ?></a><?php endif; ?><h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3><?php if($show_excerpts):the_excerpt();endif; ?><?php endif; ?></article><?php endwhile; ?></div><?php endif; ?>
<?php lt_theme_server_pagination(); ?>
<?php else: ?><div class="lt-empty-state"><h2><?php esc_html_e('No Practice Areas match your search','law-temple-theme'); ?></h2><a class="lt-button lt-button--outline" href="<?php echo esc_url(lt_theme_filter_reset_url()); ?>"><?php esc_html_e('Clear search','law-temple-theme'); ?></a></div><?php endif; ?>
</div></section></main><?php get_footer(); ?>
