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

.knowledge_and_innovation_header {
    background-image: url("/images/background_header.png");
    display: flex;
    /* จัดกึ่งกลางในแนวนอน */
    background-size: cover;
    background-position: center;
    justify-content: center;
    min-height: 100%;
    padding-left: 30%;
    padding-right: 30%;
}

.knowledge_and_innovation_header h1 {
    color: #ffffff;
    font-size: 36px;
    padding-top: 60px;
    padding-bottom: 60px;
    font-family: "Mitr", sans-serif;
    font-weight: 400;
    font-style: normal;
    text-align: center;
}

.subtitle {
    display: flex;
    margin-top: 60px;
}

.subtitle img {
    width: 644px;
    height: 322px;
    object-fit: contain;
    margin-left: 7%;
    margin-right: 7%;
}

.subtitle_data {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #752f8b;
    width: 100%;
}

.subtitle_data h1 {
    font-size: 30px;
    color: #ffffff;
    margin-bottom: 40px;
}

.subtitle_data p {
    font-size: 20px;
    color: #ffffff;
}

.category_course {
    display: flex;
    flex-wrap: wrap;
    gap: 100px;
    justify-content: center;
    margin-top: 50px;
    padding-bottom: 100px;
    color: #ffffff;
    text-align: center;
    width: 100%;
}

.knowledge_and_innovation {
    background-color: transparent;
    width: 289px;
    height: 352px;
    perspective: 1000px;
}

.knowledge_and_innovation-inner {
    position: relative;
    background-color: #752f8b;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.knowledge_and_innovation:hover .knowledge_and_innovation-inner {
    transform: rotateY(180deg);
}

.knowledge_and_innovation-front,
.knowledge_and_innovation-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    top: 0; /* จัดตำแหน่งให้อยู่ด้านบน */
    left: 0; /* จัดตำแหน่งให้อยู่ด้านซ้าย */
}

.knowledge_and_innovation-front {
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2%;
    position: relative; /* ทำให้สามารถจัดตำแหน่งลูกได้ */
}

.knowledge_and_innovation-front img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปภาพเต็มพื้นที่ container */
    position: absolute; /* วางรูปภาพให้อยู่ด้านล่าง */
    top: 0;
    left: 0;
    z-index: 0; /* ทำให้แน่ใจว่ารูปอยู่ด้านหลัง */
}

.knowledge_and_innovation-front h1 {
    position: absolute; /* วางตำแหน่งข้อความให้อยู่ด้านบน */
    top: 30%; /* จัดให้ข้อความอยู่ตรงกลางแนวตั้ง */
    left: 50%; /* จัดให้ข้อความอยู่ตรงกลางแนวนอน */
    transform: translate(-50%, -50%); /* ทำให้ข้อความอยู่กลาง container */
    color: white; /* สีของข้อความ */
    z-index: 1; /* ทำให้แน่ใจว่าข้อความอยู่ด้านหน้ารูป */
    font-size: 25px;
    font-weight: 400;
    text-align: center;
    width: 80%;
}

.knowledge_and_innovation-front p {
    position: absolute; /* วางตำแหน่งข้อความให้อยู่ด้านบน */
    top: 70%; /* จัดให้ข้อความอยู่ตรงกลางแนวตั้ง */
    left: 50%; /* จัดให้ข้อความอยู่ตรงกลางแนวนอน */
    transform: translate(-50%, -50%); /* ทำให้ข้อความอยู่กลาง container */
    color: white; /* สีของข้อความ */
    z-index: 1; /* ทำให้แน่ใจว่าข้อความอยู่ด้านหน้ารูป */
    font-size: 18px;
    font-weight: 400;
    text-align: center;
    width: 90%;
}

.knowledge_and_innovation-back {
    background-color: #752f8b;
    font-size: 22px;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2%;
    transform: rotateY(180deg); /* คงการหมุน 180 องศาไว้ */
}

.main_container_course {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 5%;
    margin-right: 5%;
    padding-bottom: 70px;
}

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

.header_course h1 {
    font-size: 25px;
    color: #f28b20;
    text-align: center;
}

.header_course h2 {
    font-size: 32px;
    color: #752f8b;
    text-align: center;
}

.header_course h3 {
    font-size: 27px;
    color: #614b3c;
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.course {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.container_course {
    background-color: transparent;
    width: 289px;
    height: 352px;
    perspective: 1000px;
}

.course-inner {
    position: relative;
    background-color: #752f8b;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.container_course:hover .course-inner {
    transform: rotateY(180deg);
}

.course-front,
.course-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    top: 0; /* จัดตำแหน่งให้อยู่ด้านบน */
    left: 0; /* จัดตำแหน่งให้อยู่ด้านซ้าย */
}

.course-front {
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2%;
    position: relative; /* ทำให้สามารถจัดตำแหน่งลูกได้ */
}

.course-front img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปภาพเต็มพื้นที่ container */
    position: absolute; /* วางรูปภาพให้อยู่ด้านล่าง */
    top: 0;
    left: 0;
    z-index: 0; /* ทำให้แน่ใจว่ารูปอยู่ด้านหลัง */
}

.course-front h1 {
    position: absolute; /* วางตำแหน่งข้อความให้อยู่ด้านบน */
    top: 30%; /* จัดให้ข้อความอยู่ตรงกลางแนวตั้ง */
    left: 50%; /* จัดให้ข้อความอยู่ตรงกลางแนวนอน */
    transform: translate(-50%, -50%); /* ทำให้ข้อความอยู่กลาง container */
    color: white; /* สีของข้อความ */
    z-index: 1; /* ทำให้แน่ใจว่าข้อความอยู่ด้านหน้ารูป */
    font-size: 22px;
    font-weight: 400;
    text-align: center;
    width: 80%;
}

.course-front p {
    position: absolute; /* วางตำแหน่งข้อความให้อยู่ด้านบน */
    top: 70%; /* จัดให้ข้อความอยู่ตรงกลางแนวตั้ง */
    left: 50%; /* จัดให้ข้อความอยู่ตรงกลางแนวนอน */
    transform: translate(-50%, -50%); /* ทำให้ข้อความอยู่กลาง container */
    color: white; /* สีของข้อความ */
    z-index: 1; /* ทำให้แน่ใจว่าข้อความอยู่ด้านหน้ารูป */
    font-size: 18px;
    font-weight: 400;
    text-align: center;
    width: 80%;
}

.course-back {
    background-color: #752f8b;
    font-size: 22px;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2%;
    transform: rotateY(180deg); /* คงการหมุน 180 องศาไว้ */
}

@media (max-width: 1024px) {
    .subtitle {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .image_subtitle {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .subtitle_data {
        padding-top: 50px;
        padding-bottom: 50px;
        padding-left: 20px;
        padding-right: 20px;
    }
}
