<?php
global $servicesSectionPatternParams;

$sectionContent = '<!-- wp:group {"tagName":"section","align":"full","style":{"border":{"top":{"color":"#f4f4f4","width":"1px"},"bottom":{"color":"#f4f4f4","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"backgroundColor":"neutral","layout":{"type":"constrained"},"hasAnimation":true,"animationType":"fadeInBottom","animationDistance":50,"animationDuration":300,"animationDelay":0,"triggerPoint":30,"scrollBehavior":"playOnView"} -->
<section class="wp-block-group alignfull has-neutral-background-color has-background orphic-motion-animation" style="border-top-color:#f4f4f4;border-top-width:1px;border-bottom-color:#f4f4f4;border-bottom-width:1px;padding-top:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60)" data-animation-type="fadeInBottom" data-animation-distance="50" data-animation-duration="300" data-animation-delay="0" data-animation-trigger="30" data-scroll-behavior="playOnView">';

foreach ($servicesSectionPatternParams['servicesOutput']['categoryPages'] as $category) {
  $sectionContent .= '<!-- wp:heading {"textAlign":"center"} -->
  <h2 class="wp-block-heading has-text-align-center">' . $category['title'] . '</h2>
  <!-- /wp:heading -->
  
  <!-- wp:spacer {"height":"26px"} -->
  <div style="height:26px" aria-hidden="true" class="wp-block-spacer"></div>
  <!-- /wp:spacer -->
  
  <!-- wp:acf/services {"name":"acf/services","data":{"field_677adff8afca8":"' . $servicesSectionPatternParams['theme'] . '","field_5ec556e261df4":"service-card","field_5ec5572061df5":"-1","field_5ec5575661df6":"1","field_5ec5577761df7":"' . $category['taxonomy_id'] . '","field_677adf85c24c9":"","field_677adf9bc24ca":"","field_677adfa6c24cb":"","field_677adfb0c24cc":""},"align":"' . $servicesSectionPatternParams['align'] . '", "mode":"preview"} /-->
  
  <!-- wp:spacer {"height":"20px"} -->
  <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
  <!-- /wp:spacer -->
  
  <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
  <div class="wp-block-buttons"><!-- wp:button -->
  <div class="wp-block-button"><a href="' . $category['url'] . '" class="wp-block-button__link wp-element-button">See all ' . $category['title'] . '</a></div>
  <!-- /wp:button --></div>
  <!-- /wp:buttons -->
  
  <!-- wp:spacer {"height":"52px"} -->
  <div style="height:52px" aria-hidden="true" class="wp-block-spacer"></div>
  <!-- /wp:spacer -->';
}


$sectionContent .= '</section>
<!-- /wp:group -->';

return $sectionContent;
