/* ============================================================
   Custom Style for Wapi Pathum Hospital (Joomla Cassiopeia)
   จัดการส่วนข่าว: เส้นประสีดำ + ลำดับเลข + ป้าย NEW + ระยะชิด
   ============================================================ */

/* 1. ตั้งค่าตัวนับลำดับข่าว (Counter) */
.mod-articlescategory, .latestnews, .category-module {
    counter-reset: news-counter;
    padding-left: 0 !important;
    margin: 0 !important;
}

/* 2. ปรับแต่งรายการข่าวแต่ละแถว (List Item) */
.mod-articlescategory li, 
.latestnews li, 
.category-module li {
    position: relative;
    list-style: none !important;
    border-bottom: 1px dashed #000000 !important; /* เส้นประสีดำ */
    
    /* บีบระยะห่างให้ชิดกันที่สุด */
    padding-top: 2px !important;    
    padding-bottom: 2px !important; 
    padding-left: 35px !important;  /* เว้นที่ว่างด้านซ้ายสำหรับตัวเลข */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    
    /* ปรับความสูงบรรทัดตัวอักษร */
    line-height: 1.4 !important;
    display: block;
}

/* 3. แสดงหมายเลขลำดับ (1. 2. 3.) */
.mod-articlescategory li::before,
.latestnews li::before {
    counter-increment: news-counter;
    content: counter(news-counter) ".";
    position: absolute;
    left: 5px;
    top: 2px; /* ให้ตรงกับ padding-top */
    font-weight: bold;
    color: #000000;
    width: 25px;
    text-align: right;
}

/* 4. ป้าย NEW สำหรับข่าวใหม่ (แสดงเฉพาะ 2 ข่าวแรก) */
.mod-articlescategory li:nth-child(-n+2) a::after,
.latestnews li:nth-child(-n+2) a::after {
    content: "NEW";
    font-size: 10px;
    background-color: #ff0000; /* สีแดงเข้ม */
    color: #ffffff !important;
    padding: 1px 5px;
    margin-left: 8px;
    border-radius: 3px;
    display: inline-block;
    font-weight: bold;
    vertical-align: middle;
}

/* 5. ลบเส้นประรายการสุดท้ายเพื่อความสวยงาม */
.mod-articlescategory li:last-child,
.latestnews li:last-child {
    border-bottom: none !important;
}

/* 6. กำจัดช่องว่างส่วนเกินจาก Tag ภายใน (ถ้ามี) */
.mod-articlescategory li a,
.mod-articlescategory li span,
.mod-articlescategory li p {
    margin: 0 !important;
    padding: 0 !important;
    text-decoration: none !important;
    color: #333; /* สีข้อความข่าว */
}

.mod-articlescategory li a:hover {
    color: #0056b3; /* สีตอนเอาเมาส์ชี้ */
    text-decoration: underline !important;
}

/* 7. สไตล์ปุ่ม "อ่านข่าวทั้งหมด" (ถ้าคุณสร้างปุ่มด้วย Class: btn-read-all) */
.btn-read-all {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 15px;
    background-color: #ffffff;
    color: #000000 !important;
    border: 1.5px solid #000000;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-read-all:hover {
    background-color: #000000;
    color: #ffffff !important;
}

.text-center { text-align: center; }