@php
  use Illuminate\Support\Str;
  $orgNome = $organizzazione->fullName;
  $orgAttivita = $organizzazione->attivita;
  $orgAccent = $orgAttivita->first()?->colore ?: ($orgAccents[$orgIndex % count($orgAccents)]);
  $orgSearch = Str::lower($orgNome . ' ' . $orgAttivita->pluck('nome')->join(' '));
  $orgCount = $orgAttivita->count();
  $festLogoFallback = \App\Models\Attivita::defaultLogoUrl();
  $orgLogoUrl = filled($organizzazione->profile_photo_path)
    ? $organizzazione->profile_photo_url
    : $festLogoFallback;
@endphp

<div
  class="welcome-bacheca__carousel-slide {{ $isActive ? 'is-active' : '' }}"
  data-org-slide
  data-org-id="{{ $organizzazione->id }}"
  data-org-search="{{ $orgSearch }}"
  data-org-nome="{{ $orgNome }}"
  data-org-accent="{{ $orgAccent }}"
  style="--org-accent: {{ $orgAccent }}"
  role="group"
  aria-roledescription="slide"
  aria-label="{{ $orgNome }}"
>
  <div class="welcome-bacheca__carousel-slide-inner">
    <span class="welcome-bacheca__org-avatar welcome-bacheca__org-avatar--lg" aria-hidden="true">
      <img
        src="{{ $orgLogoUrl }}"
        alt=""
        class="welcome-bacheca__org-avatar-img"
        loading="lazy"
        data-fest-logo-fallback="{{ $festLogoFallback }}"
        onerror="if (this.dataset.festLogoFallback && this.src !== this.dataset.festLogoFallback) { this.src = this.dataset.festLogoFallback; }"
      >
    </span>

    <div class="welcome-bacheca__carousel-slide-copy">
      <h3 class="welcome-bacheca__carousel-slide-title">{{ $orgNome }}</h3>
      <p class="welcome-bacheca__carousel-slide-meta">
        {{ $orgCount }} {{ $orgCount === 1 ? 'attività' : 'attività' }}
      </p>
    </div>
  </div>
</div>
