body {
    font-family: "Kanit", sans-serif;
}

.news_header {
    background-image: linear-gradient(
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.1)
        ),
        url("/images/Background_header_companyProfile.jpg");
    display: flex;
    background-size: cover;
    min-height: 100%;
}

.news_header h1 {
    color: #ffffff;
    font-size: 34px;
    padding-top: 30px;
    padding-bottom: 30px;
    padding-left: 10%;
    font-weight: 300;
    font-style: normal;
}

.background {
    padding-left: 10%;
    padding-right: 10%;
    box-shadow: 0px 14px 5px rgba(0, 0, 0, 0.2);
}

.background h1 {
    font-size: 22px;
    text-align: center;
    margin-top: 70px;
    margin-bottom: 50px;
    margin-left: 10%;
    margin-right: 10%;
}

.news_data {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news_data p {
    font-size: 18px;
    text-align: center;
    margin-left: 5%;
    margin-right: 5%;
}

.news_data img {
    width: 100%;
    object-fit: cover;
    object-position: center;
    margin-top: 50px;
    margin-bottom: 50px;
    padding-left: 10%;
    padding-right: 10%;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding-top: 50px;
    padding-bottom: 100px;
}

.gallery img {
    width: 245px;
    height: 180px;
    object-fit: cover;
    margin: 14px;
}

.interesting_activities {
    margin-left: 10%;
    margin-right: 10%;
    padding-bottom: 50px;
    margin-top: 40px;
}

.interesting_activities_header h1 {
    color: #752f8b;
    font-size: 36px;
    margin-bottom: 50px;
}

.activities {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px;
}

.main_news_container {
    position: relative;
    overflow: hidden; /* ซ่อนส่วนที่ขยายเกินออกมานอกขอบ */
    width: 290px; /* กำหนดขนาดของ container */
    height: 323px; /* กำหนดขนาดของ container */
    margin-bottom: 50px;
    margin-right: 30px;
    margin-left: 30px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
}

.main_news_container .news_img img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease; /* เพิ่ม transition เพื่อให้การขยายดูนุ่มนวล */
}

.main_news_container .news_interesting_data h1,
.main_news_container .news_interesting_data h2,
.main_news_container .news_interesting_data p {
    margin: 0; /* ลบ margin ของทุกองค์ประกอบภายใน */
    padding: 0; /* ลบ padding ภายในถ้ามี */
    text-align: left; /* จัดตำแหน่ง text ให้อยู่ชิดซ้าย */
}

.main_news_container .news_interesting_data h1 {
    font-size: 14px;
    text-align: left;
    padding-top: 5px;
    padding-right: 10px;
}

.main_news_container .date {
    display: flex;
    padding-top: 7px;
    padding-bottom: 7px;
    width: 100%; /* ให้ date กินพื้นที่เต็มความกว้าง */
}

.main_news_container .calendar_icon {
    height: 20px;
    width: auto;
    color: #666262; /* สีเริ่มต้น */
    margin-right: 10px;
    transition: fill 0.3s ease;
}

.main_news_container .news_interesting_data h2 {
    font-size: 13px;
    color: #666262;
}

.main_news_container .news_interesting_data p {
    font-size: 11px;
    color: #666262;
}

.main_news_container .news_interesting_data {
    position: absolute;
    bottom: 0; /* ให้ .news_data อยู่ติดด้านล่างของคอนเทนเนอร์ */
    left: 0;
    right: 0;
    max-height: 130px;
    height: auto; /* ความสูงของข้อมูล */
    background-color: #ffffff;
    border-radius: 0px 57px 0px 0px;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden; /* ซ่อนเนื้อหาที่เกินออกไป */
    z-index: 10; /* ให้อยู่ด้านบนสุด */
    transition: background-color 0.5s ease, max-height 0.5s ease,
        color 0.5s ease, filter 0.5s ease;
    opacity: 1; /* แสดงเนื้อหาด้วย opacity */
}

.main_news_container:hover .news_interesting_data {
    max-height: 300px; /* เพิ่มความสูงเมื่อ hover */
    background-color: rgba(117, 47, 139, 0.85);
}

.main_news_container:hover .news_interesting_img img {
    transform: scale(1.5);
}

.main_news_container:hover .news_interesting_data h1 {
    color: #ffffff;
}

.main_news_container:hover .news_interesting_data h2 {
    color: #ffffff;
}

.main_news_container:hover .news_interesting_data p {
    color: #ffffff;
}

.main_news_container:hover .calendar_icon {
    color: #ffffff;
}
