/* ==========================================================================
   POST GRID
   Structure: container > grid > items
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CONTAINER
   -------------------------------------------------------------------------- */

.post_grid
{
    position: relative;
}

/* --------------------------------------------------------------------------
   2. GRID
   -------------------------------------------------------------------------- */

.post_grid__grid
{
    display: flex;

    flex-wrap: wrap;
    gap: 25px;
}

.post_grid__grid[data-layout='vertical']
{
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   3. ITEM
   -------------------------------------------------------------------------- */

.post_grid__item
{
    position: relative;

    overflow: hidden;

    border: 1px solid #d7d7d7;
    border-radius: 10px;
    background-color: #fff;
}

.post_grid__grid[data-layout='horizontal'] .post_grid__item
{
    width: calc(100% / var(--post-grid-col, 4) - 25px + (25px / var(--post-grid-col, 4)));
}

.post_grid__item:hover
{
    opacity: .5;
}

/* --------------------------------------------------------------------------
   4. LINK
   -------------------------------------------------------------------------- */

.post_grid__link
{
    display: block;

    text-decoration: none;

    color: inherit;
}

/* --------------------------------------------------------------------------
   5. COVER IMAGE
   -------------------------------------------------------------------------- */

.post_grid__cover
{
    position: relative;

    overflow: hidden;

    background-color: #f5f5f5;

    aspect-ratio: 16 / 9;
}

.post_grid__cover img
{
    display: block;

    width: 100%;
    height: 100%;

    transition: transform .25s ease-out;

    object-fit: cover;
    object-position: center;
}

.post_grid__item:hover .post_grid__cover img
{
    transform: scale(1.03125);
}

/* --------------------------------------------------------------------------
   6. CONTENT
   -------------------------------------------------------------------------- */

.post_grid__content
{
    padding: 10px;
}

/* --------------------------------------------------------------------------
   7. TITLE
   -------------------------------------------------------------------------- */

.post_grid__title
{
    font-size: 16px;
    font-weight: 700;
    line-height: 1.125;

    margin: 0 0 4px 0;

    color: #1a1a1a;
}

/* --------------------------------------------------------------------------
   8. DATE
   -------------------------------------------------------------------------- */

.post_grid__date
{
    font-size: 13px;
    font-style: italic;

    display: block;

    margin: 0 0 8px 0;

    text-transform: capitalize;

    color: #999;
}

/* --------------------------------------------------------------------------
   9. EXCERPT
   -------------------------------------------------------------------------- */

.post_grid__excerpt
{
    font-size: 14px;
    line-height: 1.25;

    margin: 0;

    color: #666;
}

/* --------------------------------------------------------------------------
   10. READ MORE LINK
   -------------------------------------------------------------------------- */

.post_grid__readmore
{
    font-size: 14px;
    font-weight: 600;

    display: inline-block;

    margin-top: 12px;

    color: #ce132e;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   < 1000px - Tablet
   -------------------------------------------------------------------------- */

@media screen and (max-width: 1000px)
{
    .post_grid__grid[data-layout='horizontal'] .post_grid__item
    {
        width: calc(100% / 3 - 25px + (25px / 3));
    }
}

/* --------------------------------------------------------------------------
   < 768px - Mobile landscape
   -------------------------------------------------------------------------- */

@media screen and (max-width: 768px)
{
    .post_grid__grid[data-layout='horizontal'] .post_grid__item
    {
        width: calc(100% / 2 - 25px + (25px / 2));
    }
}

/* --------------------------------------------------------------------------
   < 540px - Mobile portrait
   -------------------------------------------------------------------------- */

@media screen and (max-width: 540px)
{
    .post_grid__grid[data-layout='horizontal'] .post_grid__item
    {
        width: 100%;
    }
}
