/* Container หลัก */
.category-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Sarabun', sans-serif;
}

/* หัวข้อหมวดหมู่ */
.category-header {
    margin-bottom: 40px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.category-title {
    font-size: 28px;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.article-badge {
    background: #eef2f7;
    color: #5d6d7e;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 14px;
}

/* ระบบ Grid 3 คอลัมน์ */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* สไตล์ Card ข่าว */
.news-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f1f1;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* 🎯 แก้ไขรูปภาพ: บังคับขนาดให้เท่ากันทุกรูป */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 210px; /* บังคับความสูงรูป */
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* รูปจะถูกตัดให้พอดี ไม่เบี้ยว ไม่ยืด */
    transition: transform 0.5s ease;
}

.news-card:hover .card-img {
    transform: scale(1.05);
}

.card-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ส่วนเนื้อหา */
.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 18px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.card-title a {
    text-decoration: none;
    color: #1a1a1a;
    transition: color 0.2s;
}

.card-title a:hover {
    color: #007bff;
}

.card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ส่วนล่างของ Card */
.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f9f9f9;
}

.post-date {
    font-size: 13px;
    color: #999;
}

.btn-read-more {
    text-decoration: none;
    color: #007bff;
    font-weight: 600;
    font-size: 14px;
}

.btn-read-more:hover {
    text-decoration: underline;
}

/* หน้าว่างเมื่อไม่มีข้อมูล */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    background: #fdfdfd;
    border-radius: 15px;
    border: 2px dashed #eee;
}

.empty-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.btn-home-back {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}