/** Shopify CDN: Minification failed

Line 16:0 Unexpected "{"
Line 16:1 Unexpected "{"
Line 16:3 Expected identifier but found "'video-section.css'"
Line 18:0 Unexpected "{"
Line 18:1 Expected identifier but found "%"
Line 19:43 Unexpected "{"
Line 20:32 Unexpected "{"
Line 23:12 Unexpected "{"
Line 23:21 Expected ":"
Line 24:16 Expected identifier but found whitespace
... and 105 more hidden warnings

**/
{{ 'video-section.css' | asset_url | stylesheet_tag }}

{%- style -%}
  .section + .section:has(#video-container-{{ section.id }}),
  .section:has(#video-container-{{ section.id }}) + .section {
    margin-top: 0 !important;
  }
  .section-{{ section.id }}-padding {
    padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
    padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
  }
  @media screen and (min-width: 750px) {
    .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }
  .section-{{ section.id }}-padding .video-section {
    height: auto !important;
  }
  #video-container-{{ section.id }} {
    width: 100%;
    aspect-ratio: 1998 / 1080;
    max-height: 500px;
    overflow: hidden;
    display: block;
    position: relative;
    margin: 0 auto;
  }
  #video-container-{{ section.id }} video,
  #video-container-{{ section.id }} iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  @media screen and (min-width: 990px) {
    #video-container-{{ section.id }} video,
    #video-container-{{ section.id }} iframe {
      object-position: 50% 35%;
    }
  }
  #video-overlay-{{ section.id }} {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: rgba(0,0,0,{{ section.settings.overlay_opacity | divided_by: 100.0 }});
    z-index: 2;
    pointer-events: none;
  }
  #video-overlay-{{ section.id }} .video-overlay__title {
    font-family: 'Trocchi', serif;
    color: #ffffff;
    font-size: 2rem;
    margin: 0 0 0.5rem;
  }
  #video-overlay-{{ section.id }} .video-overlay__subtitle {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0 0 1.5rem;
  }
  #video-overlay-{{ section.id }} .video-overlay__btn {
    pointer-events: auto;
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: {{ section.settings.button_color }};
    color: {{ section.settings.button_text_color }};
    font-family: 'Geologica', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 2rem;
    text-decoration: none;
    letter-spacing: 0.04em;
  }
  @media screen and (max-width: 749px) {
    #video-overlay-{{ section.id }} .video-overlay__title { font-size: 1.3rem; }
    #video-overlay-{{ section.id }} .video-overlay__subtitle { font-size: 1.0rem; }
    #video-overlay-{{ section.id }} .video-overlay__btn { font-size: 0.8rem; padding: 0.6rem 1.25rem; }
  }
{%- endstyle -%}

{%- liquid
  assign video_id = section.settings.video.id | default: section.settings.video_url.id
-%}

<div class="color-{{ section.settings.color_scheme }}">
  <div class="video-section isolate{% unless section.settings.full_width %} page-width{% endunless %} section-{{ section.id }}-padding">
    <div id="video-container-{{ section.id }}">
      {%- if section.settings.video != null -%}
        {{
          section.settings.video
          | video_tag:
            image_size: '1100x',
            autoplay: true,
            loop: section.settings.enable_video_looping,
            controls: false,
            muted: true,
            playsinline: true
        }}
      {%- elsif section.settings.video_url != null -%}
        {%- liquid
          assign loop = ''
          if section.settings.enable_video_looping
            assign loop = '&loop=1&playlist=' | append: video_id
          endif
        -%}
        {%- if section.settings.video_url.type == 'youtube' -%}
          <iframe
            src="https://www.youtube.com/embed/{{ video_id }}?enablejsapi=1&autoplay=1&mute=1{{ loop }}"
            class="js-youtube"
            allow="autoplay; encrypted-media"
            allowfullscreen
            title="{{ section.settings.description | escape }}"
          ></iframe>
        {%- else -%}
          <iframe
            src="https://player.vimeo.com/video/{{ video_id }}?autoplay=1&muted=1{{ loop }}"
            class="js-vimeo"
            allow="autoplay; encrypted-media"
            allowfullscreen
            title="{{ section.settings.description | escape }}"
          ></iframe>
        {%- endif -%}
      {%- endif -%}

      {%- if section.settings.overlay_title != blank or section.settings.overlay_subtitle != blank or section.settings.button_label != blank -%}
        <div id="video-overlay-{{ section.id }}">
          {%- if section.settings.overlay_title != blank -%}
            <h2 class="video-overlay__title">{{ section.settings.overlay_title }}</h2>
          {%- endif -%}
          {%- if section.settings.overlay_subtitle != blank -%}
            <p class="video-overlay__subtitle">{{ section.settings.overlay_subtitle }}</p>
          {%- endif -%}
          {%- if section.settings.button_label != blank -%}
            <a href="{{ section.settings.button_link }}" class="video-overlay__btn">
              {{ section.settings.button_label }}
            </a>
          {%- endif -%}
        </div>
      {%- endif -%}
    </div>
  </div>
</div>

{% schema %}
{
  "name": "t:sections.video.name",
  "tag": "section",
  "class": "section",
  "disabled_on": {
    "groups": ["header", "footer"]
  },
  "settings": [
    {
      "type": "header",
      "content": "Video overlay"
    },
    {
      "type": "text",
      "id": "overlay_title",
      "label": "Overlay titel",
      "default": "De beste slaap vanaf dag één"
    },
    {
      "type": "text",
      "id": "overlay_subtitle",
      "label": "Overlay subtitel",
      "default": "Ontdek slaapoplossingen die met je kleintje meegroeit"
    },
    {
      "type": "text",
      "id": "button_label",
      "label": "Knoptekst",
      "default": "Betere slaap begint hier"
    },
    {
      "type": "url",
      "id": "button_link",
      "label": "Knop link"
    },
    {
      "type": "color",
      "id": "button_color",
      "label": "Knop achtergrondkleur",
      "default": "#b07070"
    },
    {
      "type": "color",
      "id": "button_text_color",
      "label": "Knop tekstkleur",
      "default": "#ffffff"
    },
    {
      "type": "range",
      "id": "overlay_opacity",
      "min": 0,
      "max": 70,
      "step": 5,
      "unit": "%",
      "label": "Overlay donkerte",
      "default": 30
    },
    {
      "type": "header",
      "content": "t:sections.video.settings.header__1.content"
    },
    {
      "type": "video",
      "id": "video",
      "label": "t:sections.video.settings.video.label"
    },
    {
      "type": "checkbox",
      "id": "enable_video_looping",
      "label": "t:sections.video.settings.enable_video_looping.label",
      "default": true
    },
    {
      "type": "header",
      "content": "t:sections.video.settings.header__2.content"
    },
    {
      "type": "paragraph",
      "content": "t:sections.video.settings.paragraph.content"
    },
    {
      "type": "video_url",
      "id": "video_url",
      "accept": ["youtube", "vimeo"],
      "default": "https://www.youtube.com/watch?v=_9VUPq3SxOc",
      "label": "t:sections.video.settings.video_url.label",
      "info": "t:sections.video.settings.video_url.info"
    },
    {
      "type": "text",
      "id": "description",
      "label": "t:sections.video.settings.description.label",
      "info": "t:sections.video.settings.description.info"
    },
    {
      "type": "header",
      "content": "t:sections.video.settings.header__3.content"
    },
    {
      "type": "checkbox",
      "id": "full_width",
      "label": "t:sections.video.settings.full_width.label",
      "default": true
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.colors.label",
      "default": "scheme-1"
    },
    {
      "type": "header",
      "content": "t:sections.all.padding.section_padding_heading"
    },
    {
      "type": "range",
      "id": "padding_top",
      "min": 0, "max": 100, "step": 4, "unit": "px",
      "label": "t:sections.all.padding.padding_top",
      "default": 0
    },
    {
      "type": "range",
      "id": "padding_bottom",
      "min": 0, "max": 100, "step": 4, "unit": "px",
      "label": "t:sections.all.padding.padding_bottom",
      "default": 0
    }
  ],
  "presets": [
    {
      "name": "t:sections.video.presets.name"
    }
  ]
}
{% endschema %}
