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

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

	switch ( $size ) {
		case 'small':
			?>
			<article
				id="post-<?php the_ID(); ?>"
				<?php post_class( 'g-eb3aedba' ); ?>
			>
				<a href="<?php the_permalink(); ?>" class="g-1bb724a5" data-component-position="top" data-mui-action="hover">
					<div class="g-8daf8f75" id="elem-f4acd196d44a37b1">
						<time class="g-7dfa8389 g-994d86ac g-b8d8db67"
						      datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
							<?php echo esc_html( get_the_date() ); ?>
						</time>
						<?php
							$categories = get_the_category();
							if ( ! empty( $categories ) ) :
								?>
								<div class="g-715154d9 g-994d86ac" data-element-role="main" data-component-trigger="d9f4a569" data-bs-color="warning" data-section-status="draft">
									<?php foreach ( $categories as $key => $category ) : ?>
										<span class="g-f67b9ec2">
											<?php echo esc_html( $category->name ); ?>
											<?php if ( $key !== count( $categories ) - 1 ) : ?>
												<span class="g-2a990671"></span>
											<?php endif; ?>
										</span>
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
					</div>
					<div class="g-8daf8f75 g-40fe8b15" id="elem-34988727e49bdd36">
						<div class="g-b6b50215 g-b8d8db67">
							<?php if ( has_post_thumbnail() ) : ?>
								<?php the_post_thumbnail( 'medium_large' ); ?>
							<?php endif; ?>
						</div>
						<div class="g-bf937b59" data-element-position="bottom" data-module-content="d246d54" data-analytics-category="content">
							<h2 class="g-f45b1901 g-fc21ac9a" id="elem-a648aa704c50bca9">
								<?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-b566fb56 g-994d86ac" data-analytics-track="2435c12b6" data-element-variant="text" data-bs-selected="dd3ba23" data-analytics-pause="1e2279ccd2" data-test-toggle="popover">
									<?php echo esc_html( wp_trim_words( $description, 12 ) ); ?>
								</p>
							<?php endif; ?>
						</div>
					</div>
				</a>
			</article>
			<?php
			break;
		default:
			?>
			<article
				id="post-<?php the_ID(); ?>"
				<?php post_class( 'g-d1a02e62' ); ?>
			>
				<a href="<?php the_permalink(); ?>" class="g-1bb724a5" data-bs-checked="2f650ed754" data-component-state="success" data-analytics-unit="e23e4e02" data-module-size="medium">
					<div class="g-b6b50215" id="elem-97ca234d48a108f0">
						<?php if ( has_post_thumbnail() ) : ?>
							<?php the_post_thumbnail( 'medium_large' ); ?>
						<?php endif; ?>
					</div>
					<div class="g-bf937b59" data-mui-qa="581545b51b" data-component-config="2e72ef9" data-bs-interval="2574f9bac9">
						<?php
							$categories = get_the_category();
							if ( ! empty( $categories ) ) :
								?>
								<div class="g-715154d9 g-994d86ac" id="elem-b9826ecfffadda81">
									<?php foreach ( $categories as $key => $category ) : ?>
										<span class="g-f67b9ec2">
											<?php echo esc_html( $category->name ); ?>
											<?php if ( $key !== count( $categories ) - 1 ) : ?>
												<span class="g-2a990671"></span>
											<?php endif; ?>
										</span>
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
						<time class="g-7dfa8389 g-aea53723" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
							<?php echo esc_html( get_the_date() ); ?>
						</time>
						<h2 class="g-f45b1901 g-fc21ac9a" data-mui-target="f181215c" data-mui-goal="3f95e780ca">
							<?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-b566fb56 g-aea53723" data-bs-selected="7c8d7e6217f" data-block-state="error" data-section-state="error" data-module-target="2744279c">
								<?php echo esc_html( wp_trim_words( $description, 12 ) ); ?>
							</p>
						<?php endif; ?>
						<span class="g-551b2871 g-8c0d7ac6">Read <svg width="18" height="12" viewBox="0 0 18 12"
						                                             fill="currentColor"
						                                             xmlns="http://www.w3.org/2000/svg">
<path
	d="M0.75 4.77295C0.335786 4.77295 0 5.10874 0 5.52295C0 5.93716 0.335786 6.27295 0.75 6.27295V5.52295V4.77295ZM17.2803 6.05328C17.5732 5.76039 17.5732 5.28551 17.2803 4.99262L12.5074 0.219648C12.2145 -0.073245 11.7396 -0.073245 11.4467 0.219648C11.1538 0.512542 11.1538 0.987415 11.4467 1.28031L15.6893 5.52295L11.4467 9.76559C11.1538 10.0585 11.1538 10.5334 11.4467 10.8263C11.7396 11.1191 12.2145 11.1191 12.5074 10.8263L17.2803 6.05328ZM0.75 5.52295V6.27295H16.75V5.52295V4.77295H0.75V5.52295Z"/>
</svg>
</span>
					</div>
				</a>
			</article>
			<?php
	}
?>