/* Custom Header Builder - Posts Grid Styles */

.chb-posts-wrap {
    --chb-cols-d: 3;
    --chb-cols-t: 2;
    --chb-cols-m: 1;
    direction: rtl;
}

.chb-posts-grid {
    display: grid;
    grid-template-columns: repeat(var(--chb-cols-d), 1fr);
    gap: 24px;
}

.chb-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.chb-post-card:hover {
    box-shadow: 0 10px 26px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.chb-post-image-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.chb-post-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.chb-post-card:hover .chb-post-image-wrap img {
    transform: scale(1.05);
}

.chb-post-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eee, #f7f7f7);
}

.chb-post-cat {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #2e9e2e;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
}

.chb-post-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.chb-post-meta {
    font-size: 12px;
    color: #999999;
    margin-bottom: 8px;
}

.chb-post-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    transition: color 0.2s ease;
}

.chb-post-excerpt {
    font-size: 13.5px;
    line-height: 1.7;
    color: #666666;
    margin-bottom: 14px;
    flex: 1;
}

.chb-post-readmore {
    font-size: 13px;
    font-weight: 700;
    color: #2e9e2e;
    margin-top: auto;
    transition: color 0.2s ease;
}

@media (max-width: 1024px) {
    .chb-posts-grid {
        grid-template-columns: repeat(var(--chb-cols-t), 1fr);
    }
}

@media (max-width: 600px) {
    .chb-posts-grid {
        grid-template-columns: repeat(var(--chb-cols-m), 1fr);
        gap: 16px;
    }
}
