<?php
	if ( ! defined( 'ABSPATH' ) ) {
		exit;
	}

	$size = $args['size'] ?? 'default';

	switch ( $size ) {
		case 'small':
			?>
			<article
				id="post-<?php the_ID(); ?>"
				<?php post_class( 'g-17ae1ed9' ); ?>
			>
				<a href="<?php the_permalink(); ?>" class="g-d34de8ca" data-analytics-wrap="c59cc8" data-bs-interval="cc8d7d5" data-block-position="bottom">
					<?php
						$categories = get_the_category();
						if ( ! empty( $categories ) ) :
							?>
							<div class="g-951c6c0c g-8cdd9402" id="elem-123fd7543e36ce45">
								<?php foreach ( $categories as $category ) : ?>
									<span class="g-6c2a307b">
										<span class="g-0c65c640">#</span>
										<?php echo esc_html( $category->name ); ?>
									</span>
								<?php endforeach; ?>
							</div>
						<?php endif; ?>
					<h2 class="g-ad707848 g-c7fe552c" data-element-group="aaaf5da7b0" data-bs-source="b017a9a">
						<?php the_title(); ?>
					</h2>
					<?php
						$short_description = get_post_meta(
							get_the_ID(),
							'short_description',
							true
						);

						$description = $short_description
							? $short_description
							: get_the_excerpt();
					?>

					<?php if ( ! empty( $description ) ) : ?>
						<p class="g-e3d0b61e g-8cdd9402" id="elem-105c71c6bffe32f3">
							<?php echo esc_html( wp_trim_words( $description, 12 ) ); ?>
						</p>
					<?php endif; ?>
					<time class="g-40642a46 g-8cdd9402" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
						<?php echo esc_html( get_the_date() ); ?>
					</time>
					<div class="g-64982ddf" data-bs-wrap="3bb5eaf3d2f" data-widget-target="2e2c42ba59f" data-bs-expanded="ff9badaeb68" data-mui-action="submit" data-mui-metric="d44d513">
						<?php if ( has_post_thumbnail() ) : ?>
							<?php the_post_thumbnail( 'medium_large' ); ?>
						<?php endif; ?>
					</div>
				</a>
			</article>
			<?php
			break;
		default:
			?>
			<article
				id="post-<?php the_ID(); ?>"
				<?php post_class( 'g-4e9f4bb9' ); ?>
			>
				<a href="<?php the_permalink(); ?>" class="g-d34de8ca" data-analytics-slide-to="42ff34fd772" data-test-locator="97b2edb30" data-analytics-ride="572991f">
					<?php
						$categories = get_the_category();
						if ( ! empty( $categories ) ) :
							?>
							<div class="g-951c6c0c g-8cdd9402" id="elem-ee8cda31ae6ee899">
								<?php foreach ( $categories as $category ) : ?>
									<span class="g-6c2a307b">
										<span class="g-0c65c640">#</span>
										<?php echo esc_html( $category->name ); ?>
									</span>
								<?php endforeach; ?>
							</div>
						<?php endif; ?>
					<h2 class="g-ad707848 g-fc8ad3ad" data-mui-component="b92889c887" data-module-position="bottom" data-element-size="large" data-test-value="18d5075">
						<?php the_title(); ?>
					</h2>
					<?php
						$short_description = get_post_meta(
							get_the_ID(),
							'short_description',
							true
						);

						$description = $short_description
							? $short_description
							: get_the_excerpt();
					?>

					<?php if ( ! empty( $description ) ) : ?>
						<p class="g-e3d0b61e g-8cdd9402" id="elem-91bb56b9d030eba7">
							<?php echo esc_html( wp_trim_words( $description, 12 ) ); ?>
						</p>
					<?php endif; ?>
					<time class="g-40642a46 g-8cdd9402" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
						<?php echo esc_html( get_the_date() ); ?>
					</time>
					<div class="g-64982ddf" data-block-category="navigation" data-block-mode="readonly">
						<?php if ( has_post_thumbnail() ) : ?>
							<?php the_post_thumbnail( 'medium_large' ); ?>
						<?php endif; ?>
					</div>
				</a>
			</article>
			<?php
	}
?>