body {
    font-family: "Kanit", sans-serif;
}

.events_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%;
}

.events_header h1 {
    color: #ffffff;
    font-size: 34px;
    padding-top: 30px;
    padding-bottom: 30px;
    padding-left: 10%;
    font-weight: 400;
}

.main_container {
    margin-left: 10%;
    margin-right: 10%;
    margin-top: 100px;
    margin-bottom: 100px;
}

.event_container {
    display: flex;
    height: 100%;
    margin-top: 100px;
    margin-bottom: 100px;
}

.event_image,
.event_detail {
    flex-basis: 0; /* ทำให้สามารถคำนวณขนาดได้ตาม flex-grow */
    flex-grow: 1; /* ใช้ค่านี้เพื่อให้สามารถเติบโตได้ในแนว flex */
}

.event_image {
    flex-grow: 3; /* กำหนดให้ .event_image ใช้พื้นที่ 2 ส่วน */
}

.event_detail {
    flex-grow: 7; /* กำหนดให้ .event_detail ใช้พื้นที่ 8 ส่วน */
}

.event_image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #ffffff;
}

.event_container img {
    width: 347px;
    height: 286px;
    object-fit: cover;
    object-position: center;
}

.event_detail {
    display: flex;
    flex-direction: column;
    margin-left: 40px;
}

.event_detail h1 {
    color: #666262;
    font-size: 22px;
    margin-bottom: 20px;
}

.date {
    display: flex;
}

.calendar {
    width: 21px;
    height: 23px;
    margin-right: 10px;
}

.date p {
    font-size: 18px;
    color: #666262;
}

.location {
    display: flex;
    margin-top: 10px;
    align-items: center;
}

.location_icon {
    width: 21px;
    height: 22px;
    margin-right: 10px;
    fill: #666262;
}

.location p {
    font-size: 18px;
    color: #666262;
}

.detail p {
    font-size: 18px;
    color: #666262;
    margin-top: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* จำนวนบรรทัดสูงสุดที่จะแสดง */
    -webkit-box-orient: vertical;
    overflow: hidden; /* ซ่อนข้อความที่เกินออกไป */
    text-overflow: ellipsis; /* เพิ่ม "..." เมื่อข้อความเกิน */
}

@media (min-width: 768px) and (max-width: 1024px) {
    .event_image {
        flex-grow: 4; /* กำหนดให้ .event_image ใช้พื้นที่ 2 ส่วน */
    }

    .event_detail {
        flex-grow: 6; /* กำหนดให้ .event_detail ใช้พื้นที่ 8 ส่วน */
    }
}

@media (max-width: 768px) {
    .event_container {
        flex-direction: column;
    }

    .event_container img {
        margin-bottom: 30px;
    }

    .event_detail {
        margin-left: 0;
    }

    .event_detail h1 {
        text-align: center;
    }
}
