@import url('https://fonts.googleapis.com/css2?family=Playwrite+SK:wght@100..400&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    text-decoration: none;
}

html {
    /* 1rem = 10px */
    font-size: 62.5%;
    overflow-x: scroll;
    overflow-y: scroll;
    scroll-padding-top: 7rem;
    scroll-behavior: smooth;
}

body {
    background-color: white;
}

ul {
    list-style: none;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "header"
        "about"
        "blog"
        "service"
        "contact"
        "footer";
}

/* ========================================================= */
/* Global Fixes (สำหรับทุกขนาดจอ) */
/* ========================================================= */

main {
    height: auto; 
    min-height: 0; 
    overflow: hidden !important;
    position: relative !important;
    z-index: 10;
}

/* ========================================================= */
/* Header */
/* ========================================================= */

.header_menu {
    grid-area: header;
    width: 100%;
    height: 85vh; 
    background-image: url(../images/hero-bg.jpg);
    background-size: cover;
    color: white;
    display: block;
    position: relative; 
    z-index: 99; 
}

.menubar {
    width: 100%;
    height: 10vh;
    margin: 0;
    padding: 0 100px;
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.logo {
    width: 100%;
    display: flex;
    gap: 5px;
}

.logo img {
    width: 25px;
    height: 25px;
}

.logo a span {
    color: white;
    font-size: 2rem;
    font-weight: 550;
}

/* DESKTOP: ซ่อนปุ่ม Menu Mobile */
.logo .navbartogger {
    display: none;
}

/* ICON CONTROL (Desktop): ซ่อน Icon Mobile ทั้งคู่ในมุมมองปกติ */
.logo .navbartogger .menuopen,
.logo .navbartogger .menuclose {
    display: none !important; 
}

.navbarmenu {
    width: 100%;
}

.navbarmenu ul {
    display: flex;
    justify-content: end;
    gap: 20px;
}

.navbarmenu ul li a {
    color: #fff;
}

.navbarmenu ul li a .un {
    color: white;
    padding: 5px;
    font-size: 2rem;
    font-weight: 550;
    text-transform: capitalize;
    display: inline-block;
}

.navbarmenu ul li a .un::after {
    content: '';
    width: 0;
    height: 2px;
    display: block;
    margin-top: -5px;
    background-color: white;
    transition: 300ms;
}

.navbarmenu ul li .un:hover::after {
    width: 100%;
}

.home {
    width: 100%;
    height: 100%;
    padding: 0 100px;
}

.home .home-content {
    width: 100%;
    height: 100%;
    align-items: center;
    display: flex;
    justify-content: center;
}

.home .home-content .home-col {
    display: block;
    text-align: center;
}

.home .home-content .home-col h1 {
    font-size: 5rem;
}

.home .home-content .home-col h1 span {
    font-size: 4rem;
    color: #e93f1a;
}

.home .home-content .home-col p {
    font-size: 1.3rem;
    margin-bottom: 35px;
}

.home .home-content .home-col a {
    padding: 10px 40px;
    background-color: #e93f1a;
    font-size: 2rem;
    font-weight: 600;
    color: white;
    border-radius: 10px;
}

.home .home-content .home-col a:hover {
    padding: 10px 40px;
    border: 1px solid #e93f1a;
    background-color: transparent;
    font-size: 2rem;
    font-weight: 600;
    color: #e93f1a;
    border-radius: 10px;
}

/* ========================================================= */
/* About Section Fixes */
/* ========================================================= */

.about_main { 
    grid-area: about; 
    width: 100%; 
    height: auto; 
    padding: 0 100px; 
    margin: 20px 0; 
}

.about_container { 
    display: flex; 
    height: 65vh !important; 
    align-items: center !important; 
    justify-content: space-between; 
}

.detail-about{ 
    width: 45%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.box-about {
    width: 100%;
    max-width: 500px; 
    margin-right: 20px;
}

.box-about h2{ 
    text-align: start; 
    font-size: 3rem; 
    text-decoration: underline; 
    padding: 10px 0; 
}

.box-about p{ 
    text-align: start; 
    font-size: 1.5rem; 
    margin-bottom: 20px;
}

.img-about{ 
    width: 55%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.img-about img{ 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

/* ========================================================= */
/* Blog Section */
/* ========================================================= */

.blog_main { 
    background: #e6e0e0; 
    grid-area: blog; 
    width: 100%; 
    height: 100%; 
    padding: 0 100px; 
}

.heading_blog{ 
    text-align: center; 
}

.heading_blog h2{ 
    font-size: 3rem; 
    text-decoration: underline; 
    padding: 10px 0; 
}

.blog_group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.blog_card {
    border: 1px solid #000;
    margin: 10px;
    border-radius: 20px;
    background: #fff;
    border-top-right-radius: 20px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

.blog_card .box-container-blog .box .image img{
    width: 100%; 
    height: 280px; 
    object-fit: cover;
    border-top-right-radius: 20px;
    border-top-left-radius: 20px;
}

.blog_card .box-container-blog .box .blog-card-content{
    margin: 10px;
    padding: 10px;
    background: #fff;
}

.blog_card .box-container-blog .box .blog-card-content h3{
    font-size: 3rem
}

.blog_card .box-container-blog .box .blog-card-content p{
    font-size: 1.15rem;
    height: 100px;
}

.blog_card .box-container-blog .box .blog-card-content .blog-read-more{
    width: 100%;
    height: 10px;
    text-align: end;
    margin-bottom: 10px;
}

.blog_card .box-container-blog .box .blog-card-content .blog-read-more a span{
    background: #e93f1a;
    font-size: 15px;
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.blog_card .box-container-blog .box .blog-card-content .blog-read-more a span:hover {
    background-color: transparent;
    border-color: #e93f1a;
    color: #e93f1a;
}

/* ========================================================= */
/* Service Section */
/* ========================================================= */

.service_main {
    grid-area: service;
}

.service_header{
    width: 100%;
    text-align: center;
    padding: 20px;
    font-size: 3rem;
    font-weight: 600;
    text-decoration: underline;
}

.service_container {
    display: flex;
    margin: 0 100px 5px ;
    gap: 2rem;
    flex-direction: column;
}

.service_container:nth-child(1) {
    flex-direction: row;
}

.service_container:nth-child(2) {
    flex-direction: row-reverse;
}

.service_container:nth-child(3) {
    flex-direction: row;
}

.service_container:nth-child(4) {
    flex-direction: row-reverse;
}

.service_container:nth-child(5) {
    flex-direction: row;
}

.service_container:nth-child(6) {
    flex-direction: row-reverse;
}

.service_container:nth-child(7) {
    flex-direction: row;
}

.service_container:nth-child(8) {
    flex-direction: row-reverse;
}

.detail-service {
    width: 50%;
    height: 50vh;
    border: 1px solid black;
    padding: 30px;
}

.img-service {
    width: 50%;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-service img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.detail-service h3 {
    font-size: 35px;
    color: black;
}

.detail-service ul{
    display: block;
    padding: 45px;
}

.detail-service ul li {
    list-style: disc;
    font-size: 25px;
}

/* ========================================================= */
/* Contact Section */
/* ========================================================= */

.contact_main {
    grid-area: contact;
    background: #F5F5F5;
    margin-top: 50px;
    height: auto; 
    min-height: 100px;
}

.contact_header {
    width: 100%;
    text-align: center;
    padding: 20px;
    font-size: 3rem;
    font-weight: 600;
    text-decoration: underline;
}

.contact_container {
    width: 86%;
    height: auto;
    margin: 0px 100px;
    align-items: center;
    display: flex;
    text-align: center;
    justify-content: space-around;
}

.detail-contact {
    width: 100%;
    height: 100%;
    align-items: center;
    display: flex;
    text-align: center;
}

.row-contact {
    width: 100%;
    height: 100%;
    align-items: center;
    display: flex;
    justify-content: center;
}

.col-contact {
    width: 100%;
}

.col-contact div {
    width: 100%;
    height: 100%;
    padding: 15px;
}

.col-contact div input {
    width: 50%;
    padding: 10px;
    border: 1px solid #000;
    border-radius: 10px;
}

.col-contact div input::placeholder {
    font-size: 1.5rem;
    font-weight: 600;
}

.col-contact div input::-ms-input-placeholder {
    font-size: 1.5rem;
    font-weight: 600;
}

.col-contact div .message-box {
    width: 50%;
    padding: 10px;
    border: 1px solid #000;
    border-radius: 10px;
}

.col-contact div .message-box::placeholder {
    font-size: 1.5rem;
    font-weight: 600;
}

.col-contact div .message-box::-ms-input-placeholder {
    font-size: 1.5rem;
    font-weight: 600;
}

.col-contact .send-contact button{
    width: 25%;
    background: #e93f1a;
    margin-left: 25%;
    color: #fff;
    padding: 10px;
    font-size: 1.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    margin-top: -10px;
}

.col-contact .send-contact button:hover {
    background-color: transparent;
    border: 1px solid #e93f1a;
    color: #e93f1a;
}

.contact-map {
    width: 100%;
    height: 400px !important;
    min-height: 400px !important;
    position: relative !important;
    z-index: 1000 !important;
    border: 3px solid #e93f1a !important; 
    margin: 20px 0 !important;
    padding: 0 !important;
}

.contact-map iframe {
    width: 100% !important;
    height: 100% !important; 
    display: block !important;
    border: none !important;
}


/* ========================================================= */
/* Footer */
/* ========================================================= */

footer {
    background-color: black;
    color: white;
    grid-area: footer;
    display: block;
    width: 100%;
    padding: 50px 100px;
    text-align: center;
    color: white;
}


/* ========================================================= */
/* Responsive Mobile @media (max-width: 800px) */
/* ========================================================= */

@media (max-width: 800px) {
    
    /* ---------------------------------------------------------------- */
    /* 1. Mobile Header & Home Fixes: กำหนดความสูงไม่เกิน 600px */
    /* ---------------------------------------------------------------- */
    .header_menu {
        /* FIX: กำหนดความสูงสูงสุดเป็น 600px ตามที่ต้องการ */
        height: 600px !important; 
        min-height: 600px !important; 
        max-height: 600px !important; 
        overflow: hidden !important; 
        background-size: cover; 
        background-position: center; 
    }

    .menubar {
        padding: 0 20px;
        height: 50px; 
    }

    /* FIX: แสดงปุ่ม Menu Icon Container ใน Mobile View */
    .logo .navbartogger {
        display: flex; 
        align-items: center;
        cursor: pointer;
        width: 30px;
        height: 30px;
        position: absolute; 
        right: 20px;
        top: 25px; 
        z-index: 10000; 
    }
    
    /* ICON CONTROL: การควบคุมการแสดงผลของ Menu Icon */
    .navbartogger .menuopen,
    .navbartogger .menuclose {
        width: 100%;
        height: 100%;
        display: none !important; 
    }

    .navbartogger .menuopen.active {
        display: block !important; 
    }

    .navbartogger .menuclose.active {
        display: block !important; 
    }

    /* Home Section Centering */
    .home {
        /* FIX: ให้ Home Section ใช้ความสูงที่เหลือจาก Header 600px ลบ Menu Bar 50px */
        height: calc(600px - 50px) !important; 
        padding: 0 20px; 
        display: flex;
        align-items: center; /* ค่าเริ่มต้น: จัดให้อยู่ตรงกลาง (เมื่อเมนูปิด) */
        justify-content: center; 
    }

    .home .home-content {
        width: 100%;
        height: auto;
    }
    
    .home .home-content .home-col {
        text-align: center;
        width: 100%;
        display: block;
    }

    .home .home-content .home-col h1 {
        font-size: 3.5rem; 
    }

    .home .home-content .home-col h1 span {
        font-size: 3rem; 
    }

    .home .home-content .home-col p {
        font-size: 1.2rem; 
        margin-bottom: 20px;
    }

    .home .home-content .home-col a {
        font-size: 1.8rem; 
    }
    
    /* ---------------------------------------------------------------- */
    /* FIX: 2. Navbarmenu & Mobile Menu Styling (โค้งมน, โปร่งใส, ไม่เต็มจอ) */
    /* ---------------------------------------------------------------- */

    /* Navbarmenu (Container หลัก) */
    .navbarmenu {
        position: absolute; 
        top: 50px; 
        left: 0;
        width: 100%;
        min-height: calc(100vh - 50px); /* ใช้พื้นที่ที่เหลือเต็มหน้าจอ */
        overflow-y: hidden;
        background: transparent;
        z-index: 9999; 
        
        /* ใช้ Flexbox เพื่อจัดเมนู (ul.active) ให้อยู่ตรงกลางแนวนอน/ชิดบน */
        display: flex;
        justify-content: center; /* กึ่งกลางแนวนอน */
        align-items: flex-start; /* จัดเมนูให้อยู่ด้านบน */
    }
    
    .navbarmenu ul {
        display: none;
    }
    
    /* Mobile Menu ที่เปิดใช้งาน (UL) */
    .navbarmenu ul.active {
        display: block;
        width: 90%; /* FIX: ลดขนาดความกว้าง ไม่ให้เต็มจอ */
        padding: 30px 0; /* เพิ่ม Padding ด้านบน/ล่าง */
        
        /* FIX: พื้นหลังสีดำโปร่งใส (opacity 0.8) */
        background: rgba(0, 0, 0, 0.8); 
        
        /* FIX: เพิ่มขอบโค้งมน */
        border-radius: 20px; 
        
        /* FIX: จัดให้อยู่ตรงกลางของหน้าจอ */
        margin: 10px auto; 
        
        height: auto; 
        min-height: auto; /* ให้ความสูงยืดหยุ่นตามเนื้อหา */
        
        text-align: center;
        position: relative; 
        z-index: 99999; 
    }

    .navbarmenu ul li {
        margin: 10px 0;
    }
    
    .navbarmenu ul li a {
        color: #fff !important; 
    }
    
    .navbarmenu ul li a .un {
        font-size: 2.5rem;
        position: relative; 
    }
    
    /* เพิ่มขีดใต้เมื่อมีการชี้หรือมีการ Focus (Mobile Hover/Active Effect) */
    .navbarmenu ul li a .un:hover::after,
    .navbarmenu ul li a .un:active::after {
        content: '';
        width: 100%;
        height: 2px;
        display: block;
        margin-top: -5px;
        background-color: white;
        transition: 300ms;
    }

    /* ---------------------------------------------------------------- */
    /* FIX: 3. การปรับตำแหน่งและขนาดตัวอักษร Home Section เมื่อเมนูเปิด (.home.active) */
    /* ---------------------------------------------------------------- */
    
    .home.active {
        /* OVERRIDE: เปลี่ยนการจัดวางจากกึ่งกลางเป็นชิดด้านล่าง */
        align-items: flex-end !important; 
        
        /* เพิ่ม Padding ด้านล่างเพื่อไม่ให้ชิดขอบจอเกินไป */
        padding-bottom: 30px !important; 
        
        /* ตรวจสอบให้แน่ใจว่า home-content ยังอยู่ตรงกลางแนวนอน */
        justify-content: center !important; 
    }
    
    /* ปรับขนาดตัวอักษรให้เล็กลงเมื่อเมนูเปิด เพื่อหลีกเลี่ยงการซ้อนทับ */
    .home.active .home-content .home-col h1 {
        font-size: 2.5rem !important; 
    }
    
    .home.active .home-content .home-col h1 span {
        font-size: 2rem !important; 
    }
    
    .home.active .home-content .home-col p {
        font-size: 1.1rem !important; 
        margin-bottom: 15px !important;
    }
    
    .home.active .home-content .home-col a {
        font-size: 1.6rem !important; 
    }


    /* ---------------------------------------------------------------- */
    /* FIX: 4. Mobile General Layout Fixes (ปรับปรุง About Section) */
    /* ---------------------------------------------------------------- */

    .grid-container, main { 
        padding: 0 !important; 
        margin: 0 !important; 
        height: auto !important; 
        min-height: auto !important; 
        display: block !important; 
        overflow: hidden !important; 
        width: 100% !important; 
    }
    
    /* About Mobile Fixes */
    .about_main{ 
        max-width: 100%; 
        /* FIX: เพิ่ม Padding ด้านข้างให้มีช่องว่าง (จากเดิม 0 10px) */
        padding: 0 20px !important; 
    }
    
    .about_container { 
        display: block; 
        width: 100%; 
        height: auto !important; 
        margin: 0 auto; 
    }

    .detail-about, .img-about {
        width: 100%;
        display: block; 
        margin-bottom: 20px; 
        align-items: flex-start; 
        justify-content: flex-start;
    }

    .box-about {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
    }
    
    /* FIX: ทำให้หัวข้อและเนื้อหาข้อความเยื้องเข้า */
    .box-about h2 { 
        font-size: 2.5rem; 
        padding-left: 0px !important; 
    }
    
    /* FIX: จำกัดความกว้างของข้อความ (Text Content) ให้แคบลงจากขอบขวาเล็กน้อยเพื่อให้เหมือน Host */
    .box-about p{ 
        font-size: 1.5rem; 
        margin-bottom: 20px;
        /* ใช้ Max-width เพื่อไม่ให้ข้อความยาวเต็มขอบจอเกินไป */
        max-width: 90%; 
    }

    .box-about a {
         margin-left: 0 !important; 
    }
    
    /* Blog Mobile Fixes */
    .blog_main { 
        max-width: 100%; 
        padding: 0 0px; 
    }
    .heading_blog h2 { 
        font-size: 2.5rem; 
    }
    .blog_group { 
        grid-template-columns: repeat(1, 1fr); 
        max-width: 300px; 
        margin: 0 auto; 
        padding-bottom: 20px; 
    }
    
    /* Service Mobile Fixes */
    .service_container { 
        display: block; 
        margin: 0 20px 5px; 
        flex-direction: column !important; 
    }
    .detail-service { 
        width: 100%; 
        height: 200px; 
        padding: 15px; 
    }
    .img-service { 
        width: 100%; 
        height: 200px; 
    }
    
    /* Contact Mobile Fixes */
    .contact_main { 
        grid-area: contact; 
        background: #F5F5F5; 
        margin-top: 50px; 
        height: auto; 
        min-height: 100px; 
    }

    .contact_header { 
        width: 100%; 
        text-align: center; 
        padding: 20px; 
        font-size: 3rem; 
        font-weight: 600; 
        text-decoration: underline; 
    }

    .contact_container { 
        display: block !important; 
        width: 100% !important; 
        height: auto !important; 
        margin: 0 !important; 
        padding: 0 !important; 
    }

    .detail-contact { 
        width: 100% !important; 
        display: block !important; 
        height: auto !important; 
    }
    
    .contact-map {
        width: 100% !important; 
        display: block !important; 
        float: none !important; 
        clear: both !important; 
        
        position: relative !important; 
        z-index: 999 !important; 
        
        height: 350px !important; 
        min-height: 350px !important; 
        margin: 20px 0 !important; 
        padding: 0 10px !important;
    }
    
    .contact-map iframe { 
        width: 100% !important; 
        height: 100% !important; 
        display: block !important; 
        border: none !important; 
    }

    .col-contact div input, 
    .col-contact div .message-box { 
        width: 100%; 
        margin: 10px auto; 
    }

    .col-contact .send-contact button{ 
        margin-left: auto !important; 
        margin-right: auto !important; 
        display: block !important; 
        width: 50% !important; 
        float: none !important; 
        clear: both !important; 
        margin-bottom: 20px !important; 
    }
    
    /* Footer Mobile Fixes */
    footer { 
        width: 100% !important; 
        display: block !important; 
        padding: 30px 10px !important; 
        clear: both !important; 
        text-align: center; 
        background-color: black; 
        color: white; 
    }
}