/*
 * style.css for DOA Human News Fetcher Plugin
 */

.doa-human-news-wrapper {
    margin-bottom: 20px;
}

.doa-human-news-wrapper h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.doa-news-cards-container {
    display: grid; /* ใช้ Grid สำหรับจัดเรียงการ์ด */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* ปรับขนาดคอลัมน์อัตโนมัติ */
    gap: 20px; /* ระยะห่างระหว่างการ์ด */
}

.doa-news-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden; /* ซ่อนส่วนเกิน */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    height: 100%; /* ทำให้การ์ดสูงเท่ากัน */
}

.doa-news-card:hover {
    transform: translateY(-5px); /* เอฟเฟกต์ยกขึ้นเมื่อ Hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.doa-news-card-image {
    width: 100%;
    height: 180px; /* ความสูงของรูปภาพ */
    overflow: hidden;
}

.doa-news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปภาพครอบคลุมพื้นที่ */
}

.doa-news-card-content {
    padding: 15px;
    flex-grow: 1; /* ทำให้ส่วนเนื้อหาขยายเต็มพื้นที่ */
    display: flex;
    flex-direction: column;
}

.doa-news-card-title {
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1; /* ทำให้ Title ขยายเต็มพื้นที่ */
}

.doa-news-card-title a {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.doa-news-card-title a:hover {
    color: #005177;
    text-decoration: underline;
}

.doa-news-card-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.doa-news-card-excerpt {
    font-size: 1em;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.doa-news-card-readmore {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    align-self: flex-start; /* จัดให้อยู่ด้านล่างซ้าย */
    margin-top: auto; /* ดันไปอยู่ด้านล่าง */
}

.doa-news-card-readmore:hover {
    background-color: #005177;
    color: #fff;
}

.no-news-found {
    grid-column: 1 / -1; /* ทำให้ข้อความอยู่กึ่งกลาง Grid */
    text-align: center;
    color: #888;
    padding: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .doa-news-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}
@media (max-width: 480px) {
    .doa-news-cards-container {
        grid-template-columns: 1fr; /* 1 คอลัมน์บนมือถือ */
    }
}