<section class="tiny-updates" data-reveal>
  <div class="container">
    <div class="tiny-updates__layout">
      <div class="tiny-updates__copy">
        {%- if section.settings.eyebrow != blank -%}
          <span class="section-eyebrow">{{ section.settings.eyebrow }}</span>
        {%- endif -%}
        {%- if section.settings.heading != blank -%}
          <h2 class="section-heading">{{ section.settings.heading }}</h2>
        {%- endif -%}
        {%- if section.settings.subheading != blank -%}
          <p class="tiny-updates__sub">{{ section.settings.subheading }}</p>
        {%- endif -%}
      </div>
      <div class="tiny-updates__form-col">
        {%- form 'customer', id: 'newsletter-form', class: 'newsletter-form' -%}
          <input type="hidden" name="contact[tags]" value="newsletter">
          <div class="tiny-updates__field">
            <input type="email" name="contact[email]" placeholder="{{ 'newsletter.email_placeholder' | t }}" required autocomplete="email" class="tiny-updates__input">
            <button type="submit" class="btn btn--primary tiny-updates__btn">{{ 'newsletter.submit' | t }}</button>
          </div>
          {%- if form.posted_successfully? -%}
            <p class="tiny-updates__success">{{ 'newsletter.success' | t }}</p>
          {%- endif -%}
        {%- endform -%}
      </div>
    </div>
  </div>
</section>

{% schema %}
{
  "name": "Tiny Updates",
  "class": "section-tiny-updates",
  "settings": [
    { "type": "text", "id": "eyebrow", "label": "Eyebrow", "default": "NEWSLETTER" },
    { "type": "text", "id": "heading", "label": "Heading", "default": "Stay Updated" },
    { "type": "textarea", "id": "subheading", "label": "Subheading" }
  ],
  "presets": [{ "name": "Tiny Updates" }]
}
{% endschema %}