.custom-post-grid {
    width: 100%;
}


/* =========================
   GRID
========================= */

.custom-post-grid .cpg-grid {
    display: grid;
    gap: 30px;
}


/* 1 COLUMN */

.custom-post-grid.columns-1 .cpg-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}


/* 2 COLUMNS */

.custom-post-grid.columns-2 .cpg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


/* 3 COLUMNS */

.custom-post-grid.columns-3 .cpg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* 4 COLUMNS */

.custom-post-grid.columns-4 .cpg-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


/* =========================
   CARD
========================= */

.custom-post-grid .cpg-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;

    display: flex;
    flex-direction: column;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.custom-post-grid .cpg-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.08);
}


/* =========================
   IMAGE
========================= */

.custom-post-grid .cpg-image {
    display: block;

    width: 100%;
    height: 230px;

    overflow: hidden;

    background: #f2f2f2;
}


.custom-post-grid .cpg-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition: transform 0.4s ease;
}


.custom-post-grid .cpg-card:hover .cpg-image img {
    transform: scale(1.05);
}


.custom-post-grid .cpg-no-image {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #777;
}


/* =========================
   CONTENT
========================= */

.custom-post-grid .cpg-content {
    padding: 24px;

    display: flex;
    flex-direction: column;

    flex-grow: 1;
}


.custom-post-grid .cpg-title {
    margin: 0 0 15px;

    font-size: 22px;
    line-height: 1.4;
}

.custom-post-grid .cpg-date {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 13px;
    line-height: 1.4;
    color: #777;

    margin-bottom: 12px;
}

.custom-post-grid .cpg-date-dot {
    width: 5px;
    height: 5px;

    background: #999;
    border-radius: 50%;

    flex-shrink: 0;
}

.custom-post-grid .cpg-title a {
    color: inherit;

    text-decoration: none;
}


.custom-post-grid .cpg-title a:hover {
    text-decoration: underline;
}


.custom-post-grid .cpg-excerpt {
    font-size: 15px;

    line-height: 1.7;

    color: #666;

    margin-bottom: 20px;
}


/* =========================
   READ MORE
========================= */

.custom-post-grid .cpg-read-more {
    display: inline-flex;

    align-items: center;

    margin-top: auto;

    text-decoration: none;

    font-weight: 600;

    color: #000;
}


.custom-post-grid .cpg-read-more:hover {
    text-decoration: underline;
}


/* =========================
   PAGINATION
========================= */

.custom-post-grid .cpg-pagination {
    margin-top: 50px;

    display: flex;

    justify-content: center;
}


.custom-post-grid .cpg-pagination ul {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    list-style: none;

    padding: 0;
    margin: 0;
}


.custom-post-grid .cpg-pagination a,
.custom-post-grid .cpg-pagination span {
    display: flex;

    align-items: center;
    justify-content: center;

    min-width: 42px;
    height: 42px;

    padding: 0 12px;

    border: 1px solid #ddd;

    border-radius: 6px;

    text-decoration: none;

    color: #222;

    transition: all 0.2s ease;
}


.custom-post-grid .cpg-pagination a:hover {
    background: #000;
    color: #fff;

    border-color: #000;
}


.custom-post-grid .cpg-pagination .current {
    background: #000;

    color: #fff;

    border-color: #000;
}


/* =========================
   NO POSTS
========================= */

.custom-post-grid .cpg-no-posts {
    text-align: center;

    padding: 40px;

    background: #f7f7f7;

    border-radius: 10px;
}


/* =========================
   TABLET
========================= */

@media (max-width: 1024px) {

    .custom-post-grid.columns-3 .cpg-grid,
    .custom-post-grid.columns-4 .cpg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* =========================
   MOBILE
========================= */

@media (max-width: 767px) {

    .custom-post-grid.columns-2 .cpg-grid,
    .custom-post-grid.columns-3 .cpg-grid,
    .custom-post-grid.columns-4 .cpg-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .custom-post-grid .cpg-image {
        height: 220px;
    }

}