<?php
/**
 * Title: Latest Articles
 * Slug: blokio/latest-articles
 * Categories: blokio-cards
 * Description: Grid of the most recent posts, full card treatment (image, badge, title, excerpt, author, date, reading time, comments).
 * Keywords: blog, posts, grid, latest
 */
?>
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|xl","bottom":"var:preset|spacing|sm"}}}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--xl);padding-bottom:var(--wp--preset--spacing--sm)">

    <!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
    <div class="wp-block-group">
        <!-- wp:heading {"level":2} -->
        <h2><?php echo esc_html__( 'Latest Articles', 'blokio' ); ?></h2>
        <!-- /wp:heading -->
        <!-- wp:paragraph {"textColor":"text-secondary"} -->
        <p class="has-text-secondary-color has-text-color"><?php echo esc_html__( 'Fresh off the press.', 'blokio' ); ?></p>
        <!-- /wp:paragraph -->
    </div>
    <!-- /wp:group -->

    <!-- wp:query {"query":{"perPage":6,"postType":"post","order":"desc","orderBy":"date","inherit":false},"style":{"spacing":{"margin":{"top":"var:preset|spacing|md"}}}} -->
    <div class="wp-block-query" style="margin-top:var(--wp--preset--spacing--md)">
        <!-- wp:post-template {"layout":{"type":"grid","columnCount":3}} -->

            <!-- wp:group {"className":"blokio-card blokio-reveal","layout":{"type":"constrained"}} -->
            <div class="wp-block-group blokio-card blokio-reveal">
                <!-- wp:group {"style":{"position":{"type":"relative"}},"layout":{"type":"default"}} -->
                <div class="wp-block-group" style="position:relative">
                    <!-- wp:post-featured-image {"isLink":true} /-->
                    <!-- wp:group {"style":{"position":{"type":"absolute","top":"12px","left":"12px"}},"layout":{"type":"flow"}} -->
                    <div class="wp-block-group" style="position:absolute;top:12px;left:12px">
                        <!-- wp:post-terms {"term":"category","className":"blokio-badge"} /-->
                    </div>
                    <!-- /wp:group -->
                </div>
                <!-- /wp:group -->
                <!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|sm","right":"var:preset|spacing|sm","bottom":"var:preset|spacing|sm","left":"var:preset|spacing|sm"}}},"layout":{"type":"constrained"}} -->
                <div class="wp-block-group" style="padding-top:var(--wp--preset--spacing--sm);padding-right:var(--wp--preset--spacing--sm);padding-bottom:var(--wp--preset--spacing--sm);padding-left:var(--wp--preset--spacing--sm)">
                    <!-- wp:post-title {"isLink":true,"style":{"typography":{"fontSize":"var(--wp--preset--font-size--large)"}}} /-->
                    <!-- wp:post-excerpt {"excerptLength":16} /-->
                    <!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between"},"textColor":"text-secondary","style":{"typography":{"fontSize":"var(--wp--preset--font-size--small)"}}} -->
                    <div class="wp-block-group has-text-secondary-color has-text-color">
                        <!-- wp:post-author {"showAvatar":false} /-->
                        <!-- wp:post-date /-->
                    </div>
                    <!-- /wp:group -->
                    <!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between"},"textColor":"text-secondary","style":{"typography":{"fontSize":"var(--wp--preset--font-size--small)"},"spacing":{"margin":{"top":"0.4rem"}}}} -->
                    <div class="wp-block-group has-text-secondary-color has-text-color" style="margin-top:0.4rem">
                        <!-- wp:paragraph {"className":"blokio-reading-time"} -->
<p class="blokio-reading-time"></p>
<!-- /wp:paragraph -->
                        <!-- wp:post-comments-count /-->
                    </div>
                    <!-- /wp:group -->
                </div>
                <!-- /wp:group -->
            </div>
            <!-- /wp:group -->

        <!-- /wp:post-template -->
    </div>
    <!-- /wp:query -->

    <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"},"style":{"spacing":{"margin":{"top":"var:preset|spacing|md"}}}} -->
    <div class="wp-block-buttons" style="margin-top:var(--wp--preset--spacing--md)">
        <!-- wp:button {"className":"is-style-outline"} -->
        <div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button" href="/blog"><?php echo esc_html__( 'View All Articles', 'blokio' ); ?></a></div>
        <!-- /wp:button -->
    </div>
    <!-- /wp:buttons -->

</div>
<!-- /wp:group -->
