<?php
    $img_path = public_path('images/team/' . strtolower($firstname) . '.jpg');

    $img_url = file_exists($img_path)
        ? asset('images/team/' . strtolower($firstname) . '.jpg')
        : null;

    $tel_href = preg_replace('/\s+/', '', $tel);
?>

<div class="card-3">
    <?php if($img_url): ?>
        <img
            class="card-image"
            src="<?php echo e($img_url); ?>?v=4"
            alt="<?php echo e($firstname); ?> <?php echo e($lastname); ?>"
            style="object-position: top;"
        >
    <?php else: ?>
        <div class="flex items-center justify-center aspect-square size-[263px] bg-gray-200 rounded-3xl">
            <i class="text-primary size-32 icon-[mdi--user]"></i>
        </div>
    <?php endif; ?>

    <div class="card-body flex flex-col justify-center items-center gap-6 text-center">
        <div class="card-header pb-2 border-b-1 border-gray-300">
            <div class="card-title text-black font-sora">
                <?php echo e($firstname); ?> <span class="uppercase text-nowrap"><?php echo e($lastname); ?></span>
            </div>
            <div class="card-subtitle italic"><?php echo e($title); ?></div>
        </div>

        <div class="card-footer flex flex-col gap-2">
            <a href="tel:<?php echo e($tel_href); ?>" class="card-phone">
                <?php echo e($tel); ?>

            </a>

            <a
                href="mailto:<?php echo e($email); ?>"
                class="btn btn-block card-email js-mail-reveal-copy"
                data-email="<?php echo e($email); ?>"
            >
                <span class="js-mail-label">Envoyer un mail</span>
                <span class="js-mail-address hidden break-all"><?php echo e($email); ?></span>
            </a>
        </div>
    </div>
</div>
<?php /**PATH /var/www/html/lcrh_v2/resources/views/cabinet/card-team.blade.php ENDPATH**/ ?>