/*
 * SDG Remote Posts Widget Styles
 */

/* 1. Grid Container */
.sdg-grid {
    display: grid;
    gap: 20px;
    /* ค่าเริ่มต้นของคอลัมน์ จะถูกควบคุมโดย Elementor control ที่เราสร้างไว้ */
    /* แต่เราสามารถใส่ค่า default สำหรับหน้าเว็บที่ไม่ได้ใช้ Elementor ได้ */
    grid-template-columns: repeat(3, 1fr);
}

/* 2. Post Card */
.sdg-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sdg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* 3. Card Image */
.sdg-card img {
    /* ความสูงและสไตล์อื่นๆ จะถูกควบคุมโดย Elementor control ที่เราสร้างไว้ */
    /* CSS ด้านล่างคือค่าพื้นฐาน */
    display: block;
    width: 100%;
    height: 220px; /* Default height */
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

/* 4. Card Content */
.sdg-card h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 15px 15px 10px 15px;
    padding: 0;
    flex-grow: 1; /* ทำให้หัวข้อยืดเต็มพื้นที่ที่เหลือ */
}

.sdg-card h3 a {
    text-decoration: none;
    color: #333;
}

.sdg-card h3 a:hover {
    color: #0056b3;
}

/* 5. SDG Badges */
.sdg-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 15px 15px 15px;
    margin-top: auto; /* ดันให้อยู่ล่างสุดเสมอ */
}

.sdg-badge {
    width: 32px;
    height: 32px;
}

/* 6. Responsive Styles for Shortcode (เผื่อไว้) */
/* Tablet */
@media (max-width: 768px) {
    .sdg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .sdg-grid {
        grid-template-columns: 1fr;
    }
}