<?php
if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Safe defaults
 */
$gridpress_card_data = ! empty( $gridpress_card_data ) && is_array( $gridpress_card_data )
    ? $gridpress_card_data
    : [];

$gridpress_url       = isset( $gridpress_card_data['url'] ) ? $gridpress_card_data['url'] : '';
$gridpress_image     = isset( $gridpress_card_data['imag_url'] ) ? $gridpress_card_data['imag_url'] : '';
$gridpress_title     = isset( $gridpress_card_data['title'] ) ? $gridpress_card_data['title'] : '';
$gridpress_short     = isset( $gridpress_card_data['short_title'] ) ? $gridpress_card_data['short_title'] : '';
?>
<div class="jc-cards">
    <div class="jc-cards-image">
        <a class="jc-cards-image-wrap" href="<?php echo esc_url( $gridpress_url ); ?>">
            <img
                src="<?php echo esc_url( $gridpress_image ); ?>"
                alt="<?php echo esc_attr( $gridpress_title ); ?>"
            >
        </a>
        </a>
    </div>

    <div class="jc-cards-textbox">
        <strong class="jc-cards-title">
            <img
                src="<?php echo esc_url( GRIDPRESS_URL . 'images/instagram.svg' ); ?>"
                alt="<?php echo esc_attr__( 'Instagram', 'gridpress-grid-layout-design' ); ?>"
            >
            <a href="<?php echo esc_url( $gridpress_url ); ?>">
                <?php echo esc_html( $gridpress_short ); ?>
            </a>
        </strong>
        <label class="jc-cards-favourite">
            <img
                src="<?php echo esc_url( GRIDPRESS_URL . 'images/heart.svg' ); ?>"
                alt="<?php echo esc_attr__( 'Favourite', 'gridpress-grid-layout-design' ); ?>"
            >
        </label>
    </div>
</div>