<?php
$block_titling = get_field('block_titling_description_datas');
$demarches_administratives_links = get_field('demarches_administratives_links');


?>


<section id="block-demarches-administratives" class="card-large-content-container card-large-content-container--has-illustration">

	<div class="card-large-content card-large-content--has-illustration">
		<img class="card-large-content__top-illustration" src='<?php echo get_template_directory_uri() ?>/resources/img/illustrations/illustration-que-fait-homegrade-pour-vous.svg' alt=''>
		<div class="section_titling">
			<h2 class="section_titling__title"><?php echo $block_titling['title'] ?></h2>
			<p class="section_titling__subtitle"><?php echo $block_titling['subtitle'] ?></p>
			<p class="section_titling__description"><?php echo $block_titling['description'] ?></p>
		</div>
		<div class="card-large-content__links-container">
			<?php foreach ($demarches_administratives_links as $link_datas) : ?>
				<?php
				$linked_page = $link_datas['linked_page'];
				$page_icon = get_field('page_icon', $linked_page->ID);
				?>
				<div class="card-large-content__link">
					<img class="card-large-content__link__page_icon" src="<?php echo $page_icon['url'] ?>" alt="">
					<h3 class="card-large-content__link__title"><?php echo $linked_page->post_title ?></h3>
					<p class="card-large-content__link__excerpt"><?php echo $linked_page->post_excerpt ?></p>

					<a class="cta cta--button cta--shadowed" href="<?php echo get_permalink($linked_page->ID) ?>"><?php echo $link_datas['button_text'] ?></a>
				</div>
			<?php endforeach; ?>
		</div>

	</div>
</section>