<?php
/**
 * Template part for displaying posts in the Audio format.
 *
 * Shows the audio player (first embed/shortcode) prominently, with
 * title and excerpt below.
 *
 * @package FansPaysite
 * @since   2.3
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'fps-post-card fps-format-audio' ); ?>>
	<?php
	$content = apply_filters( 'the_content', get_the_content() );
	$audio   = get_media_embedded_in_content( $content, array( 'audio', 'iframe' ) );
	?>
	<?php if ( ! empty( $audio ) ) : ?>
		<div class="fps-post-media">
			<?php echo $audio[0]; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
		</div>
	<?php endif; ?>
	<div class="fps-post-body">
		<div class="fps-format-icon"><i class="fas fa-music"></i></div>
		<h2><a href="<?php the_permalink(); ?>" aria-label="<?php echo esc_attr( sprintf( __( 'Listen to %s', 'fanspaysite' ), get_the_title() ) ); ?>"><?php the_title(); ?></a></h2>
		<?php the_excerpt(); ?>
	</div>
</article>
