<section class="potting-shed" data-reveal>
  <div class="container">
    <div class="potting-shed__layout">
      <div class="potting-shed__image-col">
        {%- if section.settings.image != blank -%}
          <img src="{{ section.settings.image | image_url: width: 800 }}" srcset="{{ section.settings.image | image_url: width: 400 }} 400w, {{ section.settings.image | image_url: width: 600 }} 600w, {{ section.settings.image | image_url: width: 800 }} 800w" sizes="(max-width: 768px) 100vw, 50vw" alt="{{ section.settings.image.alt | escape }}" loading="lazy" class="potting-shed__img">
        {%- else -%}
          <img src="{{ 'brand-story.png' | asset_url }}" alt="" loading="lazy" class="potting-shed__image" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
          <div class="potting-shed__placeholder" style="display:none;">
            <svg viewBox="0 0 600 500" fill="none" stroke="currentColor" stroke-width="1" opacity="0.12" aria-hidden="true"><rect x="50" y="30" width="500" height="440" rx="16"/><path d="M200 250c30-60 100-80 150-40s60 100 10 140-130 20-160-40-30-120 0-60z" stroke-width="1.5"/></svg>
          </div>
        {%- endif -%}
      </div>
      <div class="potting-shed__text-col">
        {%- 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.text != blank -%}
          <div class="potting-shed__body">{{ section.settings.text }}</div>
        {%- endif -%}
        {%- if section.settings.cta_text != blank -%}
          <a href="{{ section.settings.cta_url | default: '/pages/about' }}" class="btn btn--primary">{{ section.settings.cta_text }}</a>
        {%- endif -%}
      </div>
    </div>
  </div>
</section>

{% schema %}
{
  "name": "Potting Shed",
  "class": "section-potting-shed",
  "settings": [
    { "type": "text", "id": "eyebrow", "label": "Eyebrow", "default": "OUR STORY" },
    { "type": "text", "id": "heading", "label": "Heading", "default": "Our Roots" },
    { "type": "richtext", "id": "text", "label": "Story text" },
    { "type": "text", "id": "cta_text", "label": "Button text" },
    { "type": "text", "id": "cta_url", "label": "Button URL" },
    { "type": "image_picker", "id": "image", "label": "Image" }
  ],
  "presets": [{ "name": "Potting Shed" }]
}
{% endschema %}