<?php
/**
 * Company card.
 *
 * @package ALFASMART
 */

$company = $args['company'] ?? array();
$heading = $args['heading'] ?? 'h2';
$image   = $company['image_url'] ?? (! empty($company['image']) ? alfasmart_img($company['image']) : '');
?>
<article class="as-company-card as-reveal">
    <?php if ($image) : ?>
        <img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(($company['title'] ?? '') . ' logo'); ?>">
    <?php endif; ?>
    <?php if (! empty($company['category'])) : ?>
        <span><?php echo esc_html($company['category']); ?></span>
    <?php endif; ?>
    <<?php echo tag_escape($heading); ?>><?php echo esc_html($company['title'] ?? ''); ?></<?php echo tag_escape($heading); ?>>
    <p><?php echo esc_html($company['description'] ?? ''); ?></p>
    <a href="<?php echo esc_url($company['url'] ?? '#'); ?>"><?php echo esc_html(alfasmart_text('Explore', 'استكشف')); ?> <i class="fa-solid fa-arrow-right" aria-hidden="true"></i></a>
</article>
