@php
    /** @var \App\Models\Partnership $p */
    /** @var array{dot: string} $cfg */
    /** @var ?string $dateText */
    /** @var ?string $inclusionText */
@endphp

<div class="flex items-start justify-between gap-3">
    <div class="min-w-0 flex-1">
        <div class="mb-1 flex items-center gap-2">
            <span class="status-dot {{ $cfg['dot'] }}"></span>
            <h3 class="truncate text-[15px] font-semibold leading-snug text-foreground sm:text-base">{{ $p->restaurant_name }}</h3>
        </div>
        @if($p->instagram_handle)
            <div class="mb-2 flex items-center gap-1.5">
                <svg class="h-3.5 w-3.5 shrink-0 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><rect width="20" height="20" x="2" y="2" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" x2="17.51" y1="6.5" y2="6.5"/></svg>
                <span class="truncate text-xs text-muted-foreground">{{ '@'.$p->instagram_handle }}</span>
            </div>
        @endif
        <div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground">
            @if($dateText)
                <span class="inline-flex items-center gap-1">
                    <svg class="h-3 w-3 shrink-0 opacity-80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>
                    {{ $dateText }}
                    @if($p->scheduled_time)
                        <svg class="ml-1 h-3 w-3 shrink-0 opacity-80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
                        {{ $p->scheduled_time }}
                    @endif
                </span>
            @endif
            @if($p->location)
                <span class="inline-flex items-center gap-1">
                    <svg class="h-3 w-3 shrink-0 opacity-80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>
                    {{ $p->location }}
                </span>
            @endif
            @if($p->guests)
                <span class="inline-flex items-center gap-1">
                    <svg class="h-3 w-3 shrink-0 opacity-80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>
                    {{ $p->guests }} {{ $p->guests === 1 ? __('guest') : __('guests') }}
                </span>
            @endif
        </div>
        @if($inclusionText)
            <div class="mt-2 flex items-center gap-1.5 text-xs font-medium text-accent">
                <svg class="h-3 w-3 shrink-0 opacity-90" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="m3 2 7 12.5"/><path d="m21 2-7 12.5"/><path d="M12 12.5 3 2"/><path d="m12 12.5 9-10.5"/><path d="M12 12.5V22"/></svg>
                {{ $inclusionText }}
            </div>
        @endif
        @if($p->notes)
            <div class="mt-2 flex items-start gap-1.5 text-xs text-muted-foreground">
                <svg class="mt-0.5 h-3 w-3 shrink-0 opacity-80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z"/><path d="M15 3v6h6"/></svg>
                <span class="line-clamp-2 leading-relaxed">{{ $p->notes }}</span>
            </div>
        @endif
    </div>
    @if($p->instagram_url)
        <a
            href="{{ $p->instagram_url }}"
            target="_blank"
            rel="noopener noreferrer"
            data-card-interactive
            class="-m-1 shrink-0 rounded-xl p-2.5 text-muted-foreground transition-colors hover:bg-secondary/80 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card"
            x-on:click.stop
            aria-label="{{ __('Open Instagram') }}"
        >
            <svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" x2="21" y1="14" y2="3"/></svg>
        </a>
    @endif
</div>
@if($p->post_url)
    <div class="mt-3 border-t border-border/50 pt-3" data-card-interactive x-on:click.stop>
        <a href="{{ $p->post_url }}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center gap-1.5 text-xs font-semibold text-accent underline-offset-2 transition-colors hover:underline">
            <svg class="h-3 w-3 shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" x2="21" y1="14" y2="3"/></svg>
            {{ __('View posted content') }}
        </a>
    </div>
@endif
