<div class="card" [@focusShadow]="(isCollapsed$ | async)?'blur':'focus'">
  <ds-truncatable [id]="dso.id">
    <div class="position-absolute ms-1">
      <ng-content></ng-content>
    </div>
    @if (linkType !== linkTypes.None) {
      <a
        [target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
        [attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
        class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
        <div>
          <ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
          </ds-thumbnail>
        </div>
      </a>
    }
    @if (linkType === linkTypes.None) {
      <span class="card-img-top full-width">
        <div>
          <ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
          </ds-thumbnail>
        </div>
      </span>
    }
    <div class="card-body">
      @if (showLabel) {
        <ds-badges [object]="dso" [context]="context"></ds-badges>
      }
      <ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
        <h4 class="card-title" [innerHTML]="dsoTitle"></h4>
      </ds-truncatable-part>
      @if (dso.hasMetadata('organization.foundingDate')) {
        <p
          class="item-date card-text text-muted">
          <ds-truncatable-part [id]="dso.id" [minLines]="1">
            <span [innerHTML]="firstMetadataValue('organization.foundingDate')"></span>
          </ds-truncatable-part>
        </p>
      }
      @if (dso.hasMetadata('organization.address.addressCountry')) {
        <p
          class="item-location card-text">
          <ds-truncatable-part [id]="dso.id" [minLines]="3">
            <span
            class="item-country">{{firstMetadataValue('organization.address.addressCountry')}}</span>
            @if (dso.hasMetadata('organization.address.addressLocality')) {
              <span class="item-city">
                <span>, </span>
                {{firstMetadataValue('organization.address.addressLocality')}}
              </span>
            }
          </ds-truncatable-part>
        </p>
      }
      @if (linkType !== linkTypes.None) {
        <div class="text-center">
          <a [target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
            [attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
          class="lead btn btn-primary viewButton" role="link" tabindex="0">{{ 'search.results.view-result' | translate}}</a>
        </div>
      }
    </div>
  </ds-truncatable>
  <ng-content></ng-content>
</div>
