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

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

	switch ( $size ) {
		case 'small':
			?>
			<article
				id="post-<?php the_ID(); ?>"
				<?php post_class( 'g-24eb6216' ); ?>
			>
				<a href="<?php the_permalink(); ?>" class="g-7c7a5cd8" data-analytics-dismiss="167cbe6971" data-bs-focus="1ba820a8248" data-analytics-size="small" data-component-role="header" data-test-interval="c6f7a9169b9b">
					<div class="g-32c76eb3" id="elem-e3f1a16988e7bbd6">
						<?php
							$categories = get_the_category();
							if ( ! empty( $categories ) ) :
								?>
								<div class="g-e64f6cb4 g-72872471" data-component-status="published" data-bs-component="344b97e86d" data-section-position="left" data-component-group="db2615b228a7" data-component-handler="7cb2f68">
									<?php foreach ( $categories as $key => $category ) : ?>
										<span class="g-f1c28477">
											<span class="g-78541cb5"></span>
											<?php echo esc_html( $category->name ); ?>
											<?php if ( $key !== count( $categories ) - 1 ) : ?>
												<span>/</span>
											<?php endif; ?>
										</span>
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
						<h2 class="g-c23671ec g-ac617201" id="elem-cac1ee43a86a0d05">
							<?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-dd95f876 g-99fc6ecc" data-bs-event="scroll" data-widget-variant="filled" data-section-animation="bounce">
								<?php echo esc_html( wp_trim_words( $description, 12 ) ); ?>
							</p>
						<?php endif; ?>
						<div class="g-551756f3" id="elem-aaad16e37eddddfe">
							<span class="g-2e4b8f13 g-ac617201">
							Read
								<svg width="11" height="11" viewBox="0 0 11 11" fill="currentColor"
								     xmlns="http://www.w3.org/2000/svg">
									<path
										d="M10 0C10.5523 3.81379e-05 11 0.447739 11 1V10C11 10.5523 10.5523 11 10 11C9.44772 11 9 10.5523 9 10V3.41406L2.22168 10.1924C1.83116 10.5829 1.19813 10.5829 0.807617 10.1924C0.417105 9.80187 0.417128 9.16885 0.807617 8.77832L7.58594 2H1C0.447715 2 0 1.55228 0 1C0 0.447715 0.447715 0 1 0H10Z"/>
								</svg>
							</span>
							<time class="g-2e1bde4b g-72872471" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
								<?php echo esc_html( get_the_date() ); ?>
							</time>
						</div>
					</div>
					<div class="g-9a82815f" data-test-metric="20d12ddfc" data-element-variant="filled" data-section-theme="auto" data-analytics-wrap="7b0d8c70">
						<?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-d26d9e28' ); ?>
			>
				<a href="<?php the_permalink(); ?>" class="g-7c7a5cd8" data-block-config="26aacf85f98" data-mui-target="2fd4c5b917e">
					<div class="g-9a82815f" id="elem-cb882f0356859024">
						<?php if ( has_post_thumbnail() ) : ?>
							<?php the_post_thumbnail( 'medium_large' ); ?>
						<?php endif; ?>
					</div>
					<div class="g-32c76eb3" data-component-priority="critical" data-analytics-category="commerce" data-block-handler="161ac38585" data-test-track="97a42a7f79" data-widget-group="d2f89d487bd">
						<?php
							$categories = get_the_category();
							if ( ! empty( $categories ) ) :
								?>
								<div class="g-e64f6cb4 g-72872471" id="elem-31dd373dbca0b541">
									<?php foreach ( $categories as $key => $category ) : ?>
										<span class="g-f1c28477">
											<span class="g-78541cb5"></span>
											<?php echo esc_html( $category->name ); ?>
											<?php if ( $key !== count( $categories ) - 1 ) : ?>
												<span>/</span>
											<?php endif; ?>
										</span>
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
						<h2 class="g-c23671ec g-9b9886c1" data-element-trigger="2ff9dda" data-component-handler="bcb160ee" data-bs-interval="dd0e27d0e">
							<?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-dd95f876 g-99fc6ecc" data-component-position="top" data-section-role="sidebar" data-test-focus="846a4f0630" data-analytics-dimension="afde96750d62" data-element-handler="ffeebe">
								<?php echo esc_html( wp_trim_words( $description, 12 ) ); ?>
							</p>
						<?php endif; ?>
						<div class="g-551756f3" id="elem-c9b840abf98db530">
							<span class="g-2e4b8f13 g-69d5938a">
							Read
								<svg width="11" height="11" viewBox="0 0 11 11" fill="currentColor"
								     xmlns="http://www.w3.org/2000/svg">
									<path
										d="M10 0C10.5523 3.81379e-05 11 0.447739 11 1V10C11 10.5523 10.5523 11 10 11C9.44772 11 9 10.5523 9 10V3.41406L2.22168 10.1924C1.83116 10.5829 1.19813 10.5829 0.807617 10.1924C0.417105 9.80187 0.417128 9.16885 0.807617 8.77832L7.58594 2H1C0.447715 2 0 1.55228 0 1C0 0.447715 0.447715 0 1 0H10Z"/>
								</svg>
							</span>
							<time class="g-2e1bde4b g-72872471" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
								<?php echo esc_html( get_the_date() ); ?>
							</time>
						</div>
					</div>
				</a>
			</article>
			<?php
	}
?>