{{!--
    Parameters:
    - isForGrid: Boolean
    - isForAuthor: Boolean
--}}

<div class="small-card{{#if isForGrid}} grid-small-card{{/if}}">
    <small class="small-card-small-text">
        {{#unless access}}
            <span class="restricted-access-icon">
                {{> "icons/lock-icon" }}
            </span>
        {{/unless}}

        {{#primary_tag}}
            <a href="{{url}}" class="hover-underline">{{name}}</a>
            <span>&nbsp;&nbsp;-&nbsp;&nbsp;</span>
        {{/primary_tag}}
        
        <span class="small-card-date">
            {{#unless isForAuthor}}
                {{date published_at format="MMM DD, YYYY"}}
            {{else}}
                {{plural count.posts empty=(t "No Articles") singular=(t "1 Article") plural=(t "% Articles")}}
            {{/unless}} 
        </span>
    </small>
 
    <a href="{{url}}" class="medium-text hover-underline small-card-heading">
        {{title}}
    </a>

    {{#if feature_image}}
        <a href="{{url}}" class="small-card-image-link hover-image-opacity">                   
            <figure class="small-card-image-wrapper">
                <img             
                    srcset="{{img_url feature_image size="s" format="webp"}} 320w,
                            {{img_url feature_image size="xm" format="webp"}} 440w,
                            {{img_url feature_image size="m" format="webp"}} 600w,
                            {{img_url feature_image size="l" format="webp"}} 960w"
                    src="{{img_url feature_image size="m"}}"
                    alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
                    loading="{{#match @index 0}}eager{{else}}lazy{{/match}}"
                >
            </figure> 
        </a> 
    {{else}}
        {{#if isForGrid}}
            <a href="{{url}}" class="placeholder hover-image-opacity">
                {{> "icons/placeholder" }}
            </a>  
        {{/if}}                     
    {{/if}}

    <div class="small-card-text-and-author{{#if isForGrid}}{{#unless isForAuthor}} text-min-height{{/unless}}{{/if}}">
        <p class="small-card-text three-lines{{#if @custom.use_initials}} initial-paragraph{{/if}} initial-paragraph-reset">
            {{excerpt}}
        </p>

        <small class="small-card-bottom-text">
            {{authors separator=" & " prefix="by "}}
        </small>
    </div>
</div>