.posts-container {
    margin: 150px auto -50px;
    width: 90%;
    max-width: 1200px;
}

#post-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.post-card {
    width: calc(33.33% - 30px);
    padding: 30px 0;
    background-color: var(--secondary-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    min-width: 300px;
    max-width: 350px;
    flex-grow: 0;
    flex-shrink: 0;
}

.post-card:hover {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
}

.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 350px; /* ارتفاع ثابت لجميع البطاقات */
}

.card-body img {
    width: 100%;
    height: 200px; /* ارتفاع ثابت للصور */
    object-fit: cover;
    margin-bottom: 20px;
}

.card-body p {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.view-details {
    margin-top: 15px;
    border: solid 1px var(--secondary-color);
    border-radius: 10px;
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    font-weight: bold;
    box-shadow: rgb(1, 53, 100) 1.95px 1.95px 2.6px;
    transition: background-color 0.3s ease;
}

.view-details:hover {
    background-color: #fec122;
    color: white;
}

.no-articles {
    width: 100%;
    height: 150px;
    padding: 30px;
    text-align: center;
}

/* للشاشات المتوسطة - جهاز لوحي */
@media (min-width: 768px) and (max-width: 1024px) {
    .post-card {
        width: calc(50% - 30px);
    }
}

/* للهواتف المحمولة */
@media (max-width: 767px) {
    .posts-container {
        margin: 100px 15px -50px;
        width: 90%;
    }
    
    .post-card {
        width: 100%;
        min-width: unset;
        margin-bottom: 30px;
    }
    
    .card-body {
        height: auto;
        min-height: 300px;
    }
    
    .card-body img {
        height: 180px;
    }
    
    .view-details {
        width: 80%;
    }
}