/* CSS สำหรับจำกัดเนื้อหาย่อของบทความให้แสดงเพียง 2 บรรทัด */

/* ทุก card-text ในส่วนบทความ */
.blog-card .card-text,
.blog-section-homepage .card-text,
.blog-section .card-text,
.blog-cards-grid-5col .card-text,
.compact-blog-card .card-text,
[class*="blog"] .card-text,
[class*="blog"] p:not(.card-title):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.card-body p:not(.card-title) {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important; /* จำกัดให้แสดง 2 บรรทัด */
    line-clamp: 2 !important;
    max-height: 2.75em !important; /* เพิ่มความสูงให้มากขึ้นเพื่อให้เห็นบรรทัดที่ 2 เต็ม */
    padding-bottom: 3px !important; /* เพิ่ม padding ด้านล่าง */
    margin-bottom: 3px !important; /* เพิ่ม margin ด้านล่าง */
}

/* เฉพาะเจาะจงสำหรับเนื้อหาย่อในส่วนบทความ */
.blog-excerpt,
.blog-summary,
.blog-description,
.article-excerpt,
.article-summary,
.article-description {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    max-height: 2.75em !important; /* เพิ่มความสูงให้มากขึ้น */
    line-height: 1.25em !important; /* ปรับระยะห่างระหว่างบรรทัด */
    padding-bottom: 3px !important;
}

/* บังคับให้เนื้อหาในส่วน blog ทั้งหมดถูกจำกัด */
.blog-section-homepage .card p,
.blog-section .card p,
article p {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    max-height: 2.75em !important; /* เพิ่มความสูงให้มากขึ้นเพื่อให้เห็นบรรทัดที่ 2 เต็ม */
    margin-bottom: 3px !important; /* เพิ่ม margin ด้านล่างนิดหน่อย */
    line-height: 1.25em !important; /* ปรับระยะห่างระหว่างบรรทัด */
}

/* เนื้อหาของบทความในหน้า index */
.blog-section-homepage .card-body p:not(.card-title):not(h5):not(h3),
.blog-section .card-body p:not(.card-title):not(h5):not(h3) {
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    max-height: 2.75em !important; /* เพิ่มความสูงให้มากขึ้น */
    line-height: 1.25em !important; /* ปรับระยะห่างระหว่างบรรทัด */
}

/* ปรับขนาดความสูงของ card-body ให้พอดีกับเนื้อหา 2 บรรทัด */
.blog-card .card-body,
.compact-blog-card .card-body {
    padding-bottom: 0.75rem !important; /* เพิ่ม padding ด้านล่าง */
    height: auto !important;
    min-height: 80px !important; /* กำหนดความสูงขั้นต่ำ */
}