<div class="row features-view"
     tal:define="
       elements view/elements;
     "
     tal:condition="elements"
>
  <div class="${context/columns} mb-5"
       tal:define="
         fetchpriority_image_value python:hasattr(context, 'fetchpriority_image') and (context.fetchpriority_image and 'high' or 'auto') or 'auto';
         loading_image_value python:hasattr(context, 'fetchpriority_image') and (context.fetchpriority_image and 'eager' or 'lazy') or 'lazy';
       "
       tal:repeat="brain elements"
  >
    <tal:define tal:define="
                  element brain/getObject;
                ">

      <div class="card">
        <tal:image tal:define="
                     image element/related_image_object;
                   "
                   tal:condition="image"
                   tal:on-error="nothing"
        >
          <img tal:define="
                 images image/@@images;
               "
               tal:replace="structure python:images.srcset(fieldname='image',
                                                                  scale_in_src='huge',
                                                                  sizes='(min-width: 1400px) 400px, 100vw',
                                                                  alt=element.Title() ,
                                                                  title=element.Title(),
                                                                  fetchpriority=fetchpriority_image_value,
                                                                  loading=loading_image_value)"
          />
        </tal:image>
        <div class="card-body">
          <a class="h5 card-title stretched-link mb-3"
             href="${element/url}"
             tal:condition="element/url"
          >${element/Title}</a>
          <p class="h5 card-title mb-3"
             tal:condition="not:element/url"
          >${element/Title}</p>
          <p class="card-text"
             tal:condition="element/Description"
          >${element/Description}</p>
          <tal:replace tal:condition="element/text"
                       replace="structure element/text/output"
          >
          </tal:replace>
        </div>
      </div>
    </tal:define>
  </div>
</div>
