@php use Illuminate\Support\Str; @endphp

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>New Blog Post</title>
</head>
<body style="margin:0;padding:0;background:#f6f6f6;font-family:Arial, Helvetica, sans-serif;">

<table width="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td align="center" style="padding:30px 10px;">
            <table width="600" cellpadding="0" cellspacing="0" style="background:#ffffff;border-radius:6px;overflow:hidden;">

                <!-- Header -->
                <tr>
                    <td style="background:#111827;padding:20px;text-align:center;">
                        <h1 style="color:#ffffff;margin:0;font-size:22px;">
                            📝 New Blog Post Published
                        </h1>
                    </td>
                </tr>

                <!-- Content -->
                <tr>
                    <td style="padding:30px;color:#333;">
                        <p style="font-size:15px;">
                            Dear <strong>{{ $subscriber->name }}</strong>,
                        </p>

                        <p style="font-size:15px;">
                            We’re excited to share that a new blog post has just been published on our website.
                        </p>

                        <h2 style="margin:20px 0 10px;color:#111827;">
                            {{ $post->title }}
                        </h2>

                        <p style="font-size:14px;color:#555;line-height:1.6;">
                            {{ Str::limit($post->meta_description, 160) }}
                        </p>

                        <!-- CTA Button -->
                        <p style="margin:30px 0;text-align:center;">
                            <a href="{{ url($post->slug) }}"
                               style="background:#2563eb;color:#ffffff;text-decoration:none;
                               padding:12px 22px;border-radius:4px;font-size:14px;display:inline-block;">
                                Read Full Article →
                            </a>
                        </p>

                        <p style="font-size:14px;">
                            Thank you for being part of our community 🙌
                        </p>

                        <p style="font-size:14px;">
                            Best regards,<br>
                            <strong>Your Blog Team</strong>
                        </p>
                    </td>
                </tr>

                <!-- Footer -->
                <tr>
                    <td style="background:#f3f4f6;padding:15px;text-align:center;">
                        <p style="font-size:12px;color:#6b7280;margin:0;">
                            You’re receiving this email because you subscribed to our blog.
                        </p>

                        <p style="font-size:12px;margin:8px 0 0;">
                            <a href="{{ route('unsubscribe', $subscriber->unsubscribe_token) }}"
                               style="color:#dc2626;text-decoration:none;">
                                Unsubscribe
                            </a>
                        </p>
                    </td>
                </tr>

            </table>
        </td>
    </tr>
</table>

</body>
</html>
