/* --- Base Styles --- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Kanit', sans-serif; }
body { background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%); color: #2d3436; min-height: 100vh; }

/* --- Header & Logo --- */
.top-header { 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(10px); 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    padding: 15px 0; 
}
.header-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.main-logo { height: 50px; width: auto; display: block; }
.header-ad { flex-grow: 1; display: flex; justify-content: flex-end; min-height: 60px; }

/* --- Grid & Cards (ความสูงเท่ากันแบบเต็มเนื้อหา) --- */
.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.page-title { text-align: center; margin-bottom: 40px; }

.card-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 30px; 
    align-items: stretch; /* สำคัญ: บังคับให้การ์ดในแถวเดียวกันยืดความสูงเท่ากัน */
}

.card { 
    background: #fff; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.04); 
    display: flex; 
    flex-direction: column; /* จัดองค์ประกอบแนวตั้ง */
    height: 100%; /* ให้ยืดเต็ม Grid Cell */
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.08); }

.card img { 
    width: 100%; 
    aspect-ratio: 3 / 4; 
    object-fit: cover; 
    display: block; 
}

/* แสดงข้อความเต็ม ไม่มีการตัดบรรทัด */
.card-desc { 
    padding: 25px; 
    font-size: 16px; 
    line-height: 1.8; 
    color: #4a4a4a; 
    flex-grow: 1; /* ให้ส่วนข้อความยืดเพื่อดันการ์ดให้สูงเท่ากัน */
    word-break: break-word; /* ป้องกันข้อความยาวเกินขอบ */
}

/* --- Ad Section --- */
.ad-section { grid-column: 1 / -1; background: #fff; text-align: center; padding: 20px; margin: 10px 0; border-radius: 20px; border: 1px dashed #ddd; }

/* --- Load More --- */
.load-more-container { text-align: center; margin: 50px 0; }
#loadMoreBtn { padding: 15px 40px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; border-radius: 50px; cursor: pointer; font-weight: 600; transition: 0.3s; }

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .top-header { position: relative; padding: 10px 0; }
    .header-container { flex-direction: column; gap: 10px; }
    .main-logo { height: 35px; }
    .header-ad { width: 100%; justify-content: center; min-height: 50px; }
}