<?php /* NOTE: GENERATED BY GULP !!! */ ?><?php
$b = "flo-block-image-block-2"; // To be used inside HTML

// Start: Class name automation
  $b__for_css = ".".$b; // To be used inside CSS
  $b__uniq = $b."--".mt_rand(1, 999); // To be used inside HTML
  $b__uniq_for_css = ".".$b__uniq; // To be used inside CSS
// End: Class name automation

// A. Image Area
$image = flo_data($data, "image");
$image_height = flo_data($data, "image_height");
$image_height_rem = $image_height / 16 . "rem";
// B. Text Area
$elements_color = flo_data($data, "elements_color");
$text_area_background_color = flo_data($data, "text_area_background_color");
$text_area_position = flo_data($data, "text_area_position");
$pretitle = flo_data($data, "pretitle");
$pretitle_font = flo_data($data, "pretitle_font");
$title = flo_data($data, "title");
$title_font = flo_data($data, "title_font");
$title_paragraph = flo_data($data, "title_paragraph");
$title_paragraph = strlen($title_paragraph) ? $title_paragraph : false;
$title_paragraph_font = flo_data($data, "title_paragraph_font");
$button = flo_data($data, "button");
$button_label_font = flo_data($data, "button_label_font");

/* START: MOBILE OPTIONS */
  $mobile_text_position = flo_data($data, "mobile_text_position");
  $mobile_image_height = flo_data($data, "mobile_image_height") . 'px';
  if($mobile_text_position == 'center') {
    $mobile_image_height = '400px';
  }
  $mobile_text_position_class = $b . '__mobile-text-' . $mobile_text_position;
/* END: MOBILE OPTIONS */

$text_area_position_class = "";

switch ($text_area_position) {
  case 'left':
    $text_area_position_class =  $b."--text-area-on-the-left";
    break;

  case 'center':
    $text_area_position_class =  $b."--text-area-in-the-center";
    break;

  case 'right':
    $text_area_position_class =  $b."--text-area-on-the-right";
    break;

  default:
    $text_area_position_class =  $b."--text-area-on-the-right";
    break;
}

// Image Optimization
$img_sizes = array(
 'mobile' => array('width' => 626, 'height' => 400 * 2),  // mobile size
 'tablet' => array('width' => 1188, 'height' => $image_height * 2), // tablet size
 'desktop' => array('width' => 2228, 'height' => $image_height * 2),
);

$img_vars = generate_srcsets($image['url'], $img_sizes, $crop = false);

?>

<?php echo $__env->make('core.style', [
  "breakpoint__general" => "

    /* START: TEXT AREA */

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__pretitle",
      $pretitle_font
      )
      ."

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__title",
      $title_font
      )
      ."

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__title-paragraph",
      $title_paragraph_font
      )
      ."

      ".
      flo_render_typography_styles(
      $b__uniq_for_css." ".$b__for_css."__button",
      $button_label_font
      )
      ."

      ".$b__uniq_for_css." ".$b__for_css."__text-area {
        background-color: ".$text_area_background_color.";
      }

      ".$b__uniq_for_css." ".$b__for_css."__vertical-line {
        background-color: ".$elements_color.";
      }

      ".$b__uniq_for_css." ".$b__for_css."__button {
        border: 1px solid ".hex2rgba($elements_color, 0.3)."!important;
      }
      ".$b__uniq_for_css." ".$b__for_css."__button:hover {
        background-color: ".$elements_color.";
        color: ".$text_area_background_color.";
        border-color: ".$text_area_background_color.";
      }

    /* END: TEXT AREA */

    ".$b__uniq_for_css." {
      color: ".$elements_color.";
    }

  ",

  "breakpoint__medium_up" => "

    /* START: IMAGE AREA */

      ".$b__uniq_for_css." {
        min-height: ".$image_height_rem.";
      }

    /* END: IMAGE AREA */

  "
], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->startSection('block_content'); ?>
  <div class="<?php echo $b; ?> <?php echo $b__uniq; ?> <?php echo $text_area_position_class; ?> <?php echo $mobile_text_position_class; ?>" >
    <img class="<?php echo $b; ?>__image"
      src="<?php echo $image['url']; ?>"
      srcset="<?php echo $img_vars['srcsets']; ?>"
      sizes="<?php echo $img_vars['sizes']; ?>"
      alt="<?php echo $image['alt']; ?>"
    />
    <?php if($title or $pretitle or $title_paragraph or $button): ?>
      <?php if($mobile_text_position == 'bottom' || $mobile_text_position == 'top'): ?>
        <img class="<?php echo $b; ?>__mobile-img-wrap"
         src="<?php echo $image['url']; ?>"
         srcset="<?php echo $img_vars['srcsets']; ?>"
         sizes="<?php echo $img_vars['sizes']; ?>"
         alt="<?php echo $image['alt']; ?>"
        />
      <?php endif; ?>
      <div class="<?php echo $b; ?>__text-area">
        <?php if($pretitle): ?>
          <h3 class="<?php echo $b; ?>__pretitle"><?php echo $pretitle; ?></h3>
        <?php endif; ?>
        <?php if($title): ?>
          <h2 class="<?php echo $b; ?>__title"><?php echo $title; ?></h2>
        <?php endif; ?>
        <?php if( ($pretitle || $title) && $title_paragraph ): ?>
          <div class="<?php echo $b; ?>__vertical-line"></div>
        <?php endif; ?>
        <?php if($title_paragraph): ?>
          <div class="<?php echo $b; ?>__title-paragraph"><?php echo $title_paragraph; ?></div>
        <?php endif; ?>
        <?php if($button): ?>
          <div class="<?php echo $b; ?>__button-wrap">
            <a class="<?php echo $b; ?>__button" href="<?php echo $button['url']; ?>" target="<?php echo $button['target']; ?>"><?php echo $button['title']; ?></a>
          </div>
        <?php endif; ?>
      </div>
    <?php endif; ?>
  </div>
<?php $__env->stopSection(true); ?>

<?php echo $__env->make('layout.block', [
  "block_classes" => "", // Will be added to main block div. e.g. flo-block--full-width
  "data_onready" => "flo_block_image_block_2" // Specify a function (see _blank.js on how to define) that will be executed on document ready.
], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>