.carouselnews {
    font-family: Arial, 'Noto Sans Thai', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.carouselnews-container {
    position: relative;
    width: 100%; /* ใช้พื้นที่เต็ม */
    max-width: 1000px; /* ขนาดสูงสุด */
    overflow: hidden; /* ซ่อนกล่องที่อยู่นอกพื้นที่ */
    margin: 0 auto;
}

.carouselnews-track {
    display: flex;
    width: max-content;
    gap: 0; /* เอาช่องว่างระหว่างกล่องออก */
    transition: transform 0.5s ease-in-out;
    white-space: nowrap;
}

.carouselnews-item {
    min-width: 11%;
    text-align: center;
    box-sizing: border-box;
    padding: 10px; /* เพิ่ม Padding ถ้าต้องการ */
}

.carouselnews-item div {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    background-color: #006666;
    border-radius: 8px;
    overflow: hidden;
}

.carouselnews-item p {
    margin-top: 10px;
    font-size: 16px;
    color: #333;
    width: 200px;
    overflow: hidden;
}

.carouselnews-item div img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

.carouselnews-buttons {
    position: absolute;
    top: 50%; /* ตำแหน่งแนวตั้งกลาง */
    width: 100%; /* ใช้ความกว้างเต็ม */
    display: flex;
    justify-content: space-between; /* จัดปุ่มไปซ้ายและขวาสุด */
    transform: translateY(-50%); /* ปรับตำแหน่ง */
    z-index: 10; /* แสดงบนสุด */
    pointer-events: auto; /* ป้องกันไม่ให้บังเนื้อหาอื่น */
}

.carouselnews-buttons button {
    background-color: #ffffff85;  /* สีพื้นหลังของปุ่ม */
    border: 2px solid #006666;  /* ขอบสี #006666 ของปุ่ม */
    border-radius: 50%;  /* ทำให้ปุ่มเป็นวงกลม */
    font-size: 20px;  /* ขนาดฟอนต์ของลูกศร */
    color: #006666;  /* สีของลูกศร */
    padding: 15px;  /* เพิ่มพื้นที่ภายในปุ่ม */
    width: 50px;  /* กำหนดความกว้างของปุ่ม */
    height: 50px;  /* กำหนดความสูงของปุ่ม */
    cursor: pointer;  /* เปลี่ยนเป็นรูปมือเมื่อ hover */
    z-index: 11;  /* แสดงเหนือทุกอย่าง */
    pointer-events: all; /* เปิดให้คลิกได้ */
    margin: 0; /* ลบ Margin ออก */
    display: flex;
    justify-content: center;
    align-items: center;  /* จัดให้อยู่กลางปุ่ม */
    transition: background-color 0.3s ease;  /* เพิ่มการเปลี่ยนสีพื้นหลังเมื่อ hover */
}

.carouselnews-buttons button:hover {
    background-color: rgba(0, 102, 102, 0.1);  /* สีพื้นหลังเมื่อ hover */
    border-radius: 50%;  /* รูปทรงกลม */
}

.carouselnews-buttons .prev {
    left: -20px; /* ดันออกจากกรอบ */
}

.carouselnews-buttons .next {
    right: -20px; /* ดันออกจากกรอบ */
}

.carouselnews-dots {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.carouselnews-dots span {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background-color: #ddd;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.carouselnews-dots .active {
    background-color: #006666;
}

.more-link {
    text-align: right;
    margin-top: 30px; /* เพิ่มพื้นที่เพื่อเลี่ยงการถูกบัง */
    width: 90%;
    max-width: 1000px;
    position: relative;
}

.more-link a {
    text-decoration: none;
    font-size: 16px;
    color: #006666;
    font-family: Arial, 'Noto Sans Thai', sans-serif;
    font-weight: bold;
}

.more-link a:hover {
    text-decoration: underline;
}

/* สำหรับมือถือหรือหน้าจอขนาดเล็ก */
@media (max-width: 768px) {
    .carouselnews-item {
        flex: 0 0 50%; 
        min-width: 50%;
    }

    .carouselnews-buttons button {
        background-color: rgba(0, 102, 102, 0.85);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

.carouselnews-item {
    transition: all 0.3s ease; /* เพิ่ม transition เพื่อให้การเปลี่ยนแปลงลื่นไหล */
}

.carouselnews-item:hover {
    transform: scale(1.05); /* ขยายเล็กน้อย */
    filter: brightness(0.8); /* ลดความสว่าง */
}

.carouselnews-image {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.carouselnews-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


