<section class="parent-voices" data-reveal>
  <div class="container">
    {%- 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 -%}

    <div class="parent-voices__grid">
      {%- for block in section.blocks -%}
        <div class="parent-voices__card" {{ block.shopify_attributes }} data-reveal style="--index: {{ forloop.index }}">
          <div class="parent-voices__avatar" aria-hidden="true">
            <span class="parent-voices__initial">{{ block.settings.author | slice: 0 }}</span>
          </div>
          <blockquote class="parent-voices__quote">{{ block.settings.quote }}</blockquote>
          <div class="parent-voices__footer">
            <span class="parent-voices__author">{{ block.settings.author }}</span>
            {%- if block.settings.detail != blank -%}
              <span class="parent-voices__detail">{{ block.settings.detail }}</span>
            {%- endif -%}
          </div>
        </div>
      {%- endfor -%}
    </div>
  </div>
</section>

{% schema %}
{
  "name": "Parent Voices",
  "class": "section-parent-voices",
  "settings": [
    { "type": "text", "id": "eyebrow", "label": "Eyebrow" },
    { "type": "text", "id": "heading", "label": "Heading", "default": "What Parents Say" }
  ],
  "blocks": [
    {
      "type": "voice",
      "name": "Voice",
      "settings": [
        { "type": "textarea", "id": "quote", "label": "Quote" },
        { "type": "text", "id": "author", "label": "Author" },
        { "type": "text", "id": "detail", "label": "Detail" }
      ]
    }
  ],
  "presets": [{ "name": "Parent Voices", "blocks": [{ "type": "voice" }, { "type": "voice" }, { "type": "voice" }] }]
}
{% endschema %}