:root {
    --full-size-width: 1920px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: gray;
    display: flex;
    color: #fff;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

@font-face {
    font-family: 'Montserrat Light';
    src: url('https://gemicklabel.com/Stable/pimchill/Font/Montserrat/Montserrat-Light.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'TH Sarabun New';
    src: url('https://gemicklabel.com/Stable/pimchill/Font/THsarabun/THSarabunNew.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ใช้ฟอนต์สำหรับหัวเรื่อง */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat Light', sans-serif;
}

/* ใช้ฟอนต์สำหรับเนื้อหา */
p,
span,
div,
a,
li {
    font-family: 'TH Sarabun New', sans-serif;
}

.nav_row2 {
    display: flex;
    justify-content: center;
    position: sticky;
    width: var(--full-size-width);
    height: 88px;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #6894B1;
    align-items: center;
}

.nav_row2_container a:hover {
    color: #9bd1f8;
    /* สีฟ้าเมื่อ hover */

}

.nav_row2_container a:active {
    color: #6B94B1;
    /* สีฟ้าอ่อนเมื่อ active */

}

#section1_main {
    background-color: rgb(255, 255, 255);
    width: var(--full-size-width);
    height: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container_sec1 {
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
}

.headtext_sec1 {
    font-size: 60px;
    margin: 30px;
    font-weight: normal;
    display: flex;
    justify-content: center;
    color: #78A5C5;
}


.container_box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

}

.container_inbox1 {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.box_sec1,
.box_sec2,
.box_sec3,
.box_sec4 {
    background-color: rgba(120, 165, 197, 0.4);
    width: 600px;
    height: 300px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    margin: 20px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;

}

.text_infobox {
    color: #FFFFFF;
}

.box_sec1:hover {
    background-color: #6894B1;
}

.box_sec1:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec2:hover {
    background-color: #6894B1;
}

.box_sec2:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec3:hover {
    background-color: #6894B1;
}

.box_sec3:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec3:hover {
    background-color: #6894B1;
}

.box_sec3:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec4:hover {
    background-color: #6894B1;
}

.box_sec4:hover .text_infobox {
    color: #FFFFFF;
}

.box_sec4:hover {
    background-color: #6894B1;
}

.box_sec4:hover .text_infobox {
    color: #FFFFFF;
}

.container_img {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    z-index: 1
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ซ่อนภาพที่สอง (img_inbox1_1) โดยค่าเริ่มต้น */
.box_sec1 .img_inbox1_1,
.box_sec2 .img_inbox2_1,
.box_sec3 .img_inbox3_1,
.box_sec4 .img_inbox4_1 {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    /* ทำให้ภาพซ้อนทับกัน */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* แสดงภาพที่สองเมื่อ hover ที่ box_sec1 */
.box_sec1:hover .img_inbox1_1,
.box_sec2:hover .img_inbox2_1,
.box_sec3:hover .img_inbox3_1,
.box_sec4:hover .img_inbox4_1 {
    opacity: 1;
    /* เปลี่ยนให้ภาพที่สองแสดง */
}

.box_sec1:hover .thumbnail {
    opacity: 0;
    /* ซ่อนภาพแรกเมื่อ hover */
    transition: opacity 0.3s ease;
}

/* จัดให้ภาพอยู่ในตำแหน่งเดียวกัน */
.container_img {
    position: relative;
}


.container_text {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 2;
    /* ทำให้แน่ใจว่าข้อความอยู่เหนือทั้งรูปและพื้นหลัง */
    font-size: 40px;
    text-align: center;
}

.text_infobox {
    font-size: 40px;
    color: #78A5C5;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.bg_lightbox {
    background-color: #99caffd1;
    display: flex;
    width: 60%;
    height: 60%;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
}

.lightbox-left {
    flex: 1;
    text-align: center;
    width: 40%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-image-name {
    margin: 10px;
    text-align: center;
    font-size: 30px;
    font-weight: normal;
    color: #fff;
    height: 10%;
}

.lightbox-left img {
    width: 90%;
    height: 90%;
    border-radius: 20px;
}
.container_right{
    width: 50%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-right {
    flex: 1;
    overflow: hidden;
    width: 100%;
    /* height: 90%; */
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    /* max-height: 300px; */
    /* overflow-y: auto; */
    width: 90%;
    justify-content: center;
    height: 80%;
    align-content: center;

}

.image-gallery img {
    width: 150px;
    height: 150px;
    cursor: pointer;
    object-fit: cover;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    width: 90%;
    height: 10%;
}

#pagination-info {
    font-size: 30px;
    color: #fff;
}

.pagination button {
    background-color: #99caffd1;
    color: white;
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    border: none;
    width: 40px;
    height: 40px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); /* เพิ่มเงา */
}

.pagination button :hover {
    background-color: #ffffff;
    color: #99caffd1;
}

.pagination button:disabled {
    background-color: #ccc;
}

.selected-image {
    border: 10px solid #6894B1;
    /* กำหนดกรอบสีน้ำเงิน */
    border-radius: 5px;
    /* ทำให้กรอบมีมุมมน */
}

#close-lightbox {
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid rgb(255 255 255);
    cursor: pointer;
    /* ตั้งตำแหน่งให้ปุ่มอยู่ที่มุมขวาบน */
    position: absolute;
    top: 22%;
    right: 21%;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}


@media (min-width: 1200px) and (max-width: 1919px) {

    .nav_row1,
    .nav_row2 {
        width: 100%;
    }

    /* Media Query สำหรับหน้าจอมือถือ */
    #nav {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    #section1_main {
        width: 100%;
    }

    #lightbox-image-name,
    #pagination-info {
        font-size: 18px;
    }

    .close-lightbox {
        position: absolute;
        top: 10px;
        right: 20px;
        background-color: transparent;
        border: none;
        color: white;
        font-size: 14px;
        cursor: pointer;
    }

    .close-lightbox:hover {
        color: red;
    }

    #close-lightbox {
        color: #fff;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: transparent;
        border: 2px solid rgb(255 255 255);
        cursor: pointer;
        /* ตั้งตำแหน่งให้ปุ่มอยู่ที่มุมขวาบน */
        position: absolute;
        top: 23%;
        right: 22%;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    }
    .image-gallery img {
        width: 80px;
        height: 80px;
        cursor: pointer;
        object-fit: cover;
    }

}

@media (max-width: 1199px) {

    .nav_row1,
    .nav_row2 {
        width: 100%;
    }

    /* Media Query สำหรับหน้าจอมือถือ */
    #nav {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav_row1 {
        width: 100%;
        height: auto;
        justify-content: center;
        padding: 10px 20px;
        background-color: #78a5c5;
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .logomain {
        width: 100px;
        height: 70px;
    }

    .nav_col2 {
        width: auto;
        justify-content: flex-end;
    }

    .nav_col2_container {
        width: auto;
        display: none;
    }

    /* ซ่อน navbar โดยค่าเริ่มต้น */
    .nav_row2 {
        display: none;
        background-color: #78a5c5;
        /* สีพื้นหลังของ navbar */
        width: 100%;
    }


    .nav_row2.show {
        display: block;
        /* แสดงเมนูเมื่อถูกคลิก */
    }

    .nav_row2_container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background-color: rgb(255, 255, 255);
        width: 100%;
    }

    .containernav1 {
        width: 90%;
        display: flex;
        flex-direction: column;
    }


    .dropdown-content {
        background-color: #ffffff;
        box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);

    }

    /* แสดง navbar เมื่อมีคลาส show-nav */
    .show-nav {
        display: block;
    }

    /* ปุ่ม hamburger สำหรับเปิดเมนู */
    .hamburger {
        font-size: 30px;
        cursor: pointer;
        color: white;
        display: inline-block;
        width: 20px;
        height: 20px;
    }

    /* ปุ่ม close สำหรับปิดเมนู (ซ่อนปุ่มนี้ตอนแรก) */
    .close-button {
        font-size: 30px;
        cursor: pointer;
        color: white;
        display: none;
        width: 20px;
        height: 20px;
    }

    /* แสดงปุ่ม close เมื่อเมนูถูกแสดง */
    .show-nav .close-button {
        display: inline-block;
    }

    /* ซ่อนปุ่ม hamburger เมื่อเมนูถูกแสดง */
    .show-nav .hamburger {
        display: none;
    }

    /* ขนาดและตำแหน่งของปุ่มเปิดเมนู */
    #hamburgerMenu {
        width: 20px;
        height: 20px;
        top: 40px;
        right: 5%;
        position: absolute;
        cursor: pointer;
        display: block;
    }

    /* ขนาดและตำแหน่งของปุ่มปิดเมนู (ซ่อนตอนแรก) */
    #closeMenu {
        width: 20px;
        height: 20px;
        top: 40px;
        right: 5%;
        position: absolute;
        cursor: pointer;
        display: none;
    }


    .show-nav .hamburger {
        display: none;
        /* ซ่อน hamburger เมื่อแสดงเมนู */
    }

    .nav_row2_container a {
        display: block;
        padding: 10px 0;
        text-align: center;
        color: #78a5c5;
        text-decoration: none;
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }


    /* Calculator Icon Box */
    .calculator-container {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 15px;
    }

    .calculator-container .cal {
        width: 50px;
        height: 50px;
        background-color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 5px;
    }

    .cal img {
        width: 30px;
        height: 30px;
    }

    .cal img {
        width: 15px;
        height: auto;
        filter: brightness(0.600);
    }


    #section1_main {
        width: 100%;
        height: auto;
    }

    .container_box {
        display: flex;
        flex-direction: column;
    }

    .headtext_sec1 {
        font-size: 36px;
        text-align: center;
        margin: 20px;
    }

    .text_infobox {
        font-size: 26px;
    }

    .box_sec1,
    .box_sec2,
    .box_sec3,
    .box_sec4 {
        width: 340px;
        height: 200px;
        margin: 10px;
    }

    .container_inbox1 {
        display: flex;
        flex-direction: column;
    }

    .bg_lightbox {
        background-color: #99caffd1;
        display: flex;
        width: 90%;
        height: 90%;
        justify-content: center;
        align-items: center;
        border-radius: 10px;
        flex-direction: column;
    }

    .lightbox-left {
        flex: 1;
        text-align: center;
        width: 100%;
        height: 50%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .lightbox-left img {
        width: 90%;
        height: 80%;
        border-radius: 15px;
        object-fit: cover;
    }
    .container_right {
        width: 90%;
        height: 50%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .lightbox-right {
        flex: 1;
        overflow: hidden;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }


    .pagination {
        width: 90%;
        height: 20%;
    }
    .image-gallery {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        width: 100%;
        justify-content: center;
        height: 80%;
        align-content: center;
        justify-items: center;
        align-items: center;
    }
    .image-gallery img{
        width: 60px;
        height: 60px;
        cursor: pointer;
        object-fit: cover;
    }
    #lightbox-image-name {
        margin: 0px;
        text-align: center;
        font-size: 20px;
        font-weight: normal;
        color: #fff;
        height: 0%;
    }
    #close-lightbox {
        color: #fff;
        width: 15px;
        height: 15px;
        top: 9%;
        right: 11%;
        font-size: 10px;
    }
    #pagination-info {
        font-size: 18px;
        color: #fff;
    }
    .pagination button {
        width: 20px;
        height: 20px;
        padding: 0px 5px;
        font-size: 12px;

    }
    .selected-image {
        border: 8px solid #6894B1;
        border-radius: 5px;
    }
}