<?php
global $informationSectionPatternParams;

$sectionContent = '<!-- wp:cover {"url":"' . $informationSectionPatternParams['image_url'] . '","id":' . $informationSectionPatternParams['image_id'] . ',"dimRatio":80,"overlayColor":"primary","isUserOverlayColor":true,"metadata":{"categories":["miocommerce-pattern"],"patternName":"olympus/changing-the-game-accelerator","name":"Changing the game (Accelerator)"},"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60","left":"var:preset|spacing|20","right":"var:preset|spacing|20"},"margin":{"top":"0","bottom":"0"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-cover alignfull" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--20)"><span aria-hidden="true" class="wp-block-cover__background has-primary-background-color has-background-dim-80 has-background-dim"></span><img class="wp-block-cover__image-background wp-image-' . $informationSectionPatternParams['image_id'] . '" alt="" src="' . $informationSectionPatternParams['image_url'] . '" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:group {"layout":{"type":"constrained"},"hasAnimation":true,"animationType":"fadeInBottom","animationDistance":50,"animationDuration":300,"animationDelay":0,"triggerPoint":30,"scrollBehavior":"playOnView"} -->
<div class="wp-block-group orphic-motion-animation" data-animation-type="fadeInBottom" data-animation-distance="50" data-animation-duration="300" data-animation-delay="0" data-animation-trigger="30" data-scroll-behavior="playOnView"><!-- wp:heading {"textAlign":"center"} -->
<h2 class="wp-block-heading has-text-align-center">' . $informationSectionPatternParams['title'] . '</h2>
<!-- /wp:heading -->

<!-- wp:spacer {"height":"35px"} -->
<div style="height:35px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->';

$sectionContent .= '';
$columnsCounter = 0;
foreach ($informationSectionPatternParams['points'] as $point) {
  if ($columnsCounter % 2 == 0) {
    $sectionContent .= '<!-- wp:columns {"style":{"spacing":{"blockGap":{"top":"var:preset|spacing|40","left":"var:preset|spacing|40"}}}} -->
<div class="wp-block-columns">';
  }

  $sectionContent .= '<!-- wp:column {"style":{"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}},"border":{"width":"2px","color":"#ffffff","radius":"6px"}}} -->
<div class="wp-block-column has-border-color" style="border-color:#ffffff;border-width:2px;border-radius:6px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)"><!-- wp:acf/check-emphasis {"name":"acf/check-emphasis","data":{"primary_color":"","_primary_color":"field_6780617862c8a","primary_contrast_color":"","_primary_contrast_color":"field_6780618562c8b"},"mode":"preview"} -->
<!-- wp:heading {"level":3,"placeholder":"Item title","style":{"typography":{"fontStyle":"normal","fontWeight":"600"},"spacing":{"margin":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20"}}},"fontSize":"large"} -->
<h3 class="wp-block-heading has-large-font-size" style="margin-top:var(--wp--preset--spacing--20);margin-bottom:var(--wp--preset--spacing--20);font-style:normal;font-weight:600">' . $point['title'] . '</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"placeholder":"Lorem ipsum dolor sit amet naect sum nam","style":{"spacing":{"margin":{"top":"0","bottom":"0"}}}} -->
<p style="margin-top:0;margin-bottom:0">' . $point['description'] . '</p>
<!-- /wp:paragraph -->
<!-- /wp:acf/check-emphasis --></div>
<!-- /wp:column -->';

  if ($columnsCounter == count($informationSectionPatternParams['points']) - 1 || ($columnsCounter + 1) % 2 == 0) {
    $sectionContent .= '</div><!-- /wp:columns -->';
  }

  $columnsCounter++;
}

$sectionContent .= '<!-- wp:spacer {"height":"60px"} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"base","textColor":"primary","style":{"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"borderColor":"base"} -->
<div class="wp-block-button"><a href="' . $informationSectionPatternParams['contact_page_url'] . '" class="wp-block-button__link has-primary-color has-base-background-color has-text-color has-background has-link-color has-border-color has-base-border-color wp-element-button">Contact us</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group --></div></div>
<!-- /wp:cover -->';

return $sectionContent;
