<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes 2020-present. All rights reserved.
 * This product is licensed per Magento install
 * See https://hyva.io/license
 */
use Magento\Framework\Escaper;

/** @var Info $block */
/** @var Escaper $escaper */

$_post = $block->getPost();
$_postUrl = $escaper->escapeUrl($_post->getPostUrl());
$_postName = $escaper->escapeHtml($_post->getTitle());
?>
<li class="post-holder post-holder-<?= (int)$_post->getId() ?> px-4">
    <div class="post-content">
        <div class="post-description clearfix">
            <?php $featuredImage = $_post->getFeaturedListImage() ?: $_post->getFeaturedImage(); ?>
            <?php if ($featuredImage): ?>
                <?php $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); ?>
                <?php if (!$featuredImgAlt): ?>
                    <?php $featuredImgAlt = $_postName; ?>
                <?php endif; ?>
                <div class="post-ftimg-hld">
                    <a href="<?= /*@noEscape*/ $_postUrl ?>"
                       title="<?= /*@noEscape*/ $_postName ?>">
                        <img src="<?= $escaper->escapeUrl($featuredImage) ?>"
                             alt="<?= $escaper->escapeHtmlAttr($featuredImgAlt) ?>"
                             class="w-full"
                             loading="lazy" />
                    </a>
                </div>
            <?php endif; ?>
            <div class="post-header">
                <div class="post-title-holder">
                    <h2 class="mt-2 mb-1 items-center justify-center text-primary font-semibold text-lg text-left">
                        <a class="post-item-link"
                           href="<?= /*@noEscape*/ $_postUrl ?>">
                            <?= /*@noEscape*/ $_postName ?>
                        </a>
                    </h2>
                </div>
                <?= /*@noEscape*/ $block->getInfoHtml() ?>
            </div>

            <div class="text-base py-2">
                <?= /*@noEscape*/ $block->getShortContent() ?>
            </div>
            <a class="btn btn-primary inline-block"
               href="<?= /*@noEscape*/ $_postUrl ?>"
               title="<?= /*@noEscape*/ $_postName ?>">
               <?= $escaper->escapeHtml(__('Read more &#187;')) ?>
            </a>
        </div>
    </div>
</li>
