/* ============================================
   Custom Blog Posts Grid — Frontend CSS
   By SyntexDev
   ============================================ */

.cbpg-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.cbpg-grid-row {
    display: grid;
    gap: 16px;
}

.cbpg-grid-row-featured {
    grid-template-columns: 1fr;
}

.cbpg-grid-row-2col {
    grid-template-columns: 1fr 1fr;
}

/* ----- Card base ----- */
.cbpg-card {
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cbpg-card:hover {
    transform: translateY(-2px);
}

.cbpg-card-image-link {
    display: block;
    flex-shrink: 0;
    overflow: hidden;
}

.cbpg-card-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.4s ease;
}

.cbpg-card-image-link:hover .cbpg-card-image {
    transform: scale(1.04);
}

/* ----- Featured (Row 1) ----- */
.cbpg-card-featured {
    flex-direction: row;
    align-items: stretch;
}

.cbpg-card-featured .cbpg-card-image-link {
    width: 50%;
}

.cbpg-card-featured .cbpg-card-image {
    width: 100%;
    height: 350px;
}

.cbpg-card-featured .cbpg-card-content {
    flex: 1;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cbpg-card-featured .cbpg-card-title {
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
    margin: 8px 0 16px;
}

.cbpg-card-featured .cbpg-card-excerpt {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ----- Small (Row 2 & 3) ----- */
.cbpg-card-small {
    flex-direction: row;
    align-items: stretch;
}

.cbpg-card-small .cbpg-card-image-link {
    width: 38%;
    min-width: 38%;
}

.cbpg-card-small .cbpg-card-image {
    width: 100%;
    height: 100%;
    min-height: 160px;
}

.cbpg-card-small .cbpg-card-content {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cbpg-card-small .cbpg-card-title {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    margin: 6px 0 10px;
}

.cbpg-card-small .cbpg-card-excerpt {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 12px;
}

/* ----- Shared text ----- */
.cbpg-card-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.cbpg-card-category,
.cbpg-card-date {
    font-size: 13px;
    color: #888;
}

.cbpg-card-title {
    color: #1a1a1a;
    margin: 0;
}

.cbpg-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cbpg-card-title a:hover {
    color: #0066cc;
}

.cbpg-card-excerpt {
    color: #666;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cbpg-card-meta-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 10px;
}

.cbpg-card-readmore {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: underline;
    font-size: 14px;
    transition: color 0.2s ease;
}

.cbpg-card-readmore:hover {
    color: #0066cc;
}

.cbpg-card-author {
    color: #888;
    font-size: 13px;
    text-align: right;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .cbpg-card-featured .cbpg-card-title {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .cbpg-grid-row-2col {
        grid-template-columns: 1fr;
    }

    .cbpg-card-featured {
        flex-direction: column;
    }

    .cbpg-card-featured .cbpg-card-image-link {
        width: 100%;
    }

    .cbpg-card-featured .cbpg-card-image {
        height: 240px;
    }

    .cbpg-card-featured .cbpg-card-content {
        padding: 20px;
    }

    .cbpg-card-featured .cbpg-card-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .cbpg-card-small {
        flex-direction: column;
    }

    .cbpg-card-small .cbpg-card-image-link {
        width: 100%;
        min-width: 100%;
    }

    .cbpg-card-small .cbpg-card-image {
        height: 180px;
    }
}
