<?php


$cover_title = get_field('cover_titre');
$cover_image = get_field('cover_image')['id'];
$intro_logo = get_field('intro_logo')['id'];
$intro_text = get_field('intro_texte');
$intro_image = get_field('intro_image')['id'];
$intro_illustration = get_field('intro_illustration')['id'];
$offre_titre = get_field('offer_titre');
$offre_illustration = get_field('offer_illustration')['id'];
$offre_principale = get_field('offer_offre_1');
$offre_store = get_field('offer__store');

?>

<section id="offres_cuvee_rose" class="ccccc" role="main">

  <section id="offre_cover">
    <div class="wrapper offre_cover-wrapper">

      <div class="offre_cover-left"> <img <?php echo acf_responsive_image($cover_image, 'page', 800); ?> class="img-responsive"></div>
      <div class="offre_cover-right">
        <h1 class="offre_cover-title"><?php echo $cover_title; ?></h1>
      </div>

    </div>
  </section>
  <section id="offre_intro">
    <div class="wrapper offre_intro-wrapper">
      <div class="offre_intro-left">
        <div class="wrapper">
          <img <?php echo acf_responsive_image($intro_logo, 'medium', 260); ?> class="img-responsive logo">
          <div class="text"><?php echo $intro_text; ?></div>
        </div>
      </div>
      <div class="offre_intro-right">
        <img <?php echo acf_responsive_image($intro_image, 'large', 350); ?> class="img-responsive">
        <img <?php echo acf_responsive_image($intro_illustration, 'medium', 150); ?> class="illus">
        <img <?php echo acf_responsive_image($intro_illustration, 'medium', 150); ?> class="illus-2">
      </div>
    </div>
  </section>
  <section id="offre_main">
    <h2 class="section_title"><?php echo $offre_titre; ?></h2>

    <div class="bg">
      <img <?php echo acf_responsive_image($offre_illustration, 'medium', 150); ?> class="illus">
      <div class="num">N°1</div>
      <div class="wrapper offre_main-wrapper">
        <div class="offre_main-left">
          <img <?php echo acf_responsive_image($offre_principale['image']['id'], 'large', '100vw'); ?> class="img-responsive">
        </div>
        <div class="offre_main-right">
          <h3 class="title"><?php echo $offre_principale['titre']; ?></h3>
          <div class="text"><?php echo $offre_principale['texte']; ?></div>
          <a href="<?php echo $offre_principale['lien']['url']; ?>" target="<?php echo $offre_principale['lien']['target']; ?>" class="bouton ">
            <?php echo $offre_principale['lien']['title']; ?>
          </a>
        </div>
      </div>

    </div>
  </section>
  <section id="offre_offres">

    <?php
    if (have_rows('offer_offres')) :
      $cpt = 2;
      while (have_rows('offer_offres')) : the_row();
    ?>
        <div class="wrapper offre_offres-wrapper">
          <div class="offre_offres-left">
            <div class="content">
              <div class="num"><?php echo 'N°' . $cpt; ?></div>
              <div class="title"><?php echo get_sub_field('titre'); ?></div>
              <?php if (get_sub_field('texte') != '') { ?>
                <div class="text"><?php echo get_sub_field('texte'); ?></div>
              <?php } ?>
              <img <?php echo acf_responsive_image(get_sub_field('image')['id'], 'large', 250); ?> class="mobile-only">
              <a href="<?php echo get_sub_field('lien')['url']; ?>" target="<?php echo get_sub_field('lien')['target']; ?>" class="bouton">
                <?php echo get_sub_field('lien')['title']; ?>
              </a>
            </div>
          </div>
          <div class="offre_offres-right">
            <img <?php echo acf_responsive_image(get_sub_field('image')['id'], 'large', 315); ?> class="desktop-only">

          </div>
        </div>
    <?php
        $cpt++;
      endwhile;
    endif;
    ?>

  </section>
  <section id="offre_store">
    <a href="<?php echo $offre_store['url']; ?>" class="bouton bouton_pink" target="<?php echo $offre_store['target']; ?>">
      <?php echo $offre_store['title']; ?>
    </a>
  </section>

  </div>
</section>