<?php

$mots_cles = get_the_terms($args['post_ID'], 'mots-cles');
$thematique_icon = get_field('taxonomy_pictures', $args['thematique'])['icon'];
?>

<div class="card-frequent-question card-<?php echo $args['thematique']->slug ?>">
	<img class="card-frequent-question__icon" src="<?php echo $thematique_icon['url'] ?>" alt="">
	<h3 class="card-frequent-question__title text-<?php echo getThematiqueFamilySlug($args['thematique']->slug) ?>"><?php echo $args['thematique']->name  ?></h3>
	<p class=""><?php echo $args['post_title'] ?></p>

	<div class="card-frequent-question__details-container">
		<ul class="card-frequent-question__tags_container">
			<?php if (!empty($mots_cles)) : ?>
				<?php foreach ($mots_cles as $mot_cle) : ?>
					<li class="tag bg-<?php echo getThematiqueFamilySlug($args['thematique']->slug) ?>-light text-<?php echo getThematiqueFamilySlug($args['thematique']->slug) ?>"><?php echo $mot_cle->name ?></li>
				<?php endforeach; ?>
			<?php endif; ?>
		</ul>

		<a href="<?php echo get_permalink($args['post_ID']) ?>" class="cta--streched cta--with-arrow-button">
			<img class="cta_arrow_button" src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/arrow-right-circle.svg' alt='Lire la fiche <?php echo $args['thematique']->name  ?>'>
		</a>
	</div>

</div>