body{
    margin: 0;
    padding: 0;
}

.tfoot{
  background: linear-gradient(to bottom, #FFD700, #ffffff);
  height: 180px;
}


.box-banner {
  background: linear-gradient(to bottom, #ffffff, #ffd700, #ffa200);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.slider {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.slide {
  min-width: 100%;
  height: 100%;
  opacity: 0;
  position: absolute;
  left: 0;
  transition: opacity 1s ease-in-out;
}

.slide img {
  width: 100%;
  height: 80vh; /* 80% ของความสูงหน้าจอ */
  object-fit: cover;
}

.slide.active {
  opacity: 1;
  position: relative;
}

.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5em;
  height: 2.5em;
  font-size: 1.5em;
  color: #fff;
  background: linear-gradient(to bottom, #FFD90D, #FFA200);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.prev:hover, .next:hover {
  transform: translateY(-50%) scale(1.1);
}

.prev { left: 2%; }
.next { right: 2%; }

/* ---------------------------------------------- */
.ourpro {
  padding: 50px 20px;
  background-color: #fff;
  text-align: center;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;  
  margin-bottom: 20px;
}

.underline {
  width: 80px;
  height: 7px;
  background-color: #FFD90D;
  border-radius: 15px;
  margin-top: 5px;
  margin-right: 130px;

  /* animation */
  transform-origin: left;
  transform: translateX(0) scaleX(1); /* เริ่มต้นตรงกลาง */
  transition: transform 0.4s ease;
}

.header:hover .underline {
  transform: scaleX(2.7); /* ยาวขึ้น 2 เท่า ไปทางขวา */
}

.ourpro h1 {
  font-size: clamp(2rem, 2.5vw, 3em);
  font-weight: bold;
  background: linear-gradient(to right, #FFD90D, #998208);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  text-align: center; /* จัดกลาง */
}

.ourpro p {
  max-width: 80%;          /* ใช้ % แทน px */
  margin: 0 auto 2em auto; /* margin auto กลาง container */
  line-height: 1.6;
  color: #998208;
  font-size: clamp(1rem, 1.1vw, 2em); /* ปรับตาม viewport */
  text-align: center;
}


.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
  max-width: 70%;
  margin: 0 auto;
}

.project-item.wide-item {
  height: 30vh; /* 25% ของความสูง viewport */
  overflow: hidden;
}

.project-item.wide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a.project-item {
  display: block; /* สำคัญ: ทำให้ <a> มีพฤติกรรมเหมือน block element */
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden; /* ควรใส่ overflow: hidden เพื่อให้มุมโค้งของรูปภาพแสดงผลถูกต้อง */
  min-height: 300px;
  height: 70vh;
}

a.project-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block; /* ไม่จำเป็นต้องมี border-radius ที่รูปแล้ว เพราะเราใช้ overflow:hidden ที่ <a> */
}

a.wide-item {
  grid-column: span 2;
  height: 30vh; /* ปรับความสูงของ wide-item ตามต้องการ */
}

/* ================= Mobile Responsive ================= */
@media (max-width: 768px) {
  /* Banner */
  .slide img {
    width: 100%;        /* กว้างเต็มจอ */
    height: auto;       /* สูงปรับอัตโนมัติ */
    object-fit: cover;  /* กันรูปยืด */
  }

  .prev, .next {
    width: 2em;
    height: 2em;
    font-size: 1.2em;
  }

  /* Our Projects */
  .project-grid {
    grid-template-columns: 1fr; /* 1 คอลัมน์ในมือถือ */
    max-width: 100%;
    gap: 15px;
  }

  a.project-item {
    height: auto;      /* ปรับตามรูป */
    min-height: 200px; /* กันรูปเล็กเกินไป */
  }

  a.wide-item {
    grid-column: span 1;
    height: auto;
  }

  .ourpro p {
    max-width: 95%;
    font-size: 0.95rem;
  }

  .underline {
    margin-right: 0; /* เอาออกเพื่อให้เส้นอยู่ตรงกลาง */
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .slide img {
    width: 100%;
    height: auto;
  }

  a.project-item {
    height: auto;
    min-height: 180px;
  }

  .ourpro h1 {
    font-size: 1.5rem;
  }

  .ourpro p {
    font-size: 0.85rem;
  }
}



/* --------------------------------------------------- */
.arrow-section {
  max-width: 1200px;
  margin: 0 auto; /* <-- บรรทัดนี้ทำให้กล่องอยู่กลาง */
}

.arrow1 {
  /* สั่งให้ไอเท็มนี้ "ไปอยู่ท้ายสุด" ของแนวขวาง (ชิดขวา) */
  align-self: flex-end; 
}

.arrow2 {
  /* สั่งให้ไอเท็มนี้ "ไปอยู่จุดเริ่มต้น" ของแนวขวาง (ชิดซ้าย) */
  /* ในกรณีนี้ไม่จำเป็นต้องใส่ เพราะ align-items กำหนดให้เป็น flex-start อยู่แล้ว */
  align-self: flex-start; 
}


/* --------------------------------------------------------- */
.contentfa {
  padding: 50px 20px;
  background-color: #ffffff;
}

.content-header {
  display: inline-block;
  cursor: pointer;
  margin-bottom: 30px;
}

.content-header h2 {
  font-size: 2em;
  font-weight: bold;
  color: #998208;
  margin: 0;
  margin-left: 230px;
}

.underline1 {
  width: 80px;
  height: 7px;
  background-color: #FFD90D;
  margin-top: 5px;
  margin-left: 230px;
  border-radius: 15px;

  transform-origin: left; 
  transform: scaleX(1);
  transition: transform 0.4s ease;
}

.content-header:hover .underline1 {
  transform: scaleX(3.6);
}

.content-wrapper {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

a.content-box {
  display: block;
  width: 60vw;
  height: 70vh;     
  max-width: 600px;  
  max-height: 500px;
  background-color: #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-decoration: none;
}

a.content-box img {
  width: 100%;
  height: 100%; 
  object-fit: cover; 
  display: block;
}

.content-box:hover {
  transform: scale(1.05) translateY(-5px);
  transition: transform 0.3s ease;
}

.content-box {
  display: block;
  width: 55vw;
  height: 70vh;     
  max-width: 500px;  
  max-height: 500px;
  background-color: #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-decoration: none;
}

.content-box img {
  width: 100%;
  height: 100%; 
  object-fit: cover; 
  display: block;
}



/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .content-header h2 {
    margin-left: 0;       /* รีเซ็ต */
    text-align: center;   /* จัดกลาง */
    font-size: 1.5em;
  }

  .underline1 {
    margin-left: 0;       /* รีเซ็ต */
    margin: 5px auto 0;   /* จัดกลาง */
    display: block;
  }

  a.content-box {
    width: 100%;         /* เต็มจอมือถือ */
    height: auto;        /* ให้สูงตามสัดส่วนรูป */
    min-height: 200px;   /* กันไม่ให้เล็กเกิน */
  }
  
  .content-box {
    width: 100%;         /* เต็มจอมือถือ */
    height: auto;        /* ให้สูงตามสัดส่วนรูป */
    min-height: 200px;   /* กันไม่ให้เล็กเกิน */
  }
}

@media (max-width: 480px) {
  .content-header h2 {
    font-size: 1.2em;
  }

  .underline1 {
    width: 60px;
    height: 5px;
  }

  a.content-box {
    min-height: 150px;
  }
}

/* --------------------------------------------------- */
.Knowhouses {
    text-align: center;
    padding: 20px;
}

.Knowhouses h1 {
  font-size: 2.5em;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
  font-weight: bold;
  background: linear-gradient(to right, #FFD90D, #998208); /* ปรับสีตามต้องการ */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; /* ทำให้ตัวอักษรโปร่งเพื่อให้เห็น gradient */
  margin: 0;
}

.konetext {
  display: inline-block; /* hover ได้เฉพาะกรอบนี้ */
  cursor: pointer;
}

.underline2 {
  width: 80px;
  height: 7px;
  background-color: #FFD90D;
  margin-top: 5px;
  border-radius: 15px;

  transform-origin: left;  /* เริ่มขยายจากด้านซ้าย */
  transform: scaleX(1);
  transition: transform 0.4s ease;
}

.konetext:hover .underline2 {
  transform: scaleX(2); /* ยาวขึ้น 2 เท่าไปทางขวา */
}


.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* แถวละ 3 */
    gap: 40px;
    margin: 50px 100px 100px 100px;
}

.card {
    background-color: white;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.05) translateY(-5px); /* hover นิดหน่อย */
}

.card-content {
    width: 100%;
    height: 50vh;  /* สูง 40% ของความสูงหน้าจอ */
    max-height: 600px; /* จำกัดไม่ให้สูงเกิน */
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}


.card-content img {
    width: 100%; 
    height: 100%;
    object-fit: cover;
    border-radius: 25px;
    border: 5px solid #FFD700;
}

.card h3 {
    font-size: 1.5em;
    color: #998208;
    margin: 0;
    padding: 0 5px;
}

.card-link {
  text-decoration: none; /* ตัดเส้นใต้ลิงก์ */
  color: inherit;        /* ใช้สีตามปกติ */
  display: block;        /* ให้ลิงก์เป็น block เหมือนการ์ด */
}


/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr); /* ✅ tablet แสดง 2 คอลัมน์ */
        margin: 40px;
        gap: 20px;
    }
    .card-content {
        height: 40vh; /* ลดลงหน่อยใน tablet */
    }
}

@media (max-width: 768px) {
    .Knowhouses h1 {
        font-size: 1.8em; /* ตัวเล็กลง */
    }
    .card-grid {
        grid-template-columns: 1fr; /* ✅ mobile แถวละ 1 */
        margin: 20px;
        gap: 15px;
    }
    .card-content {
        height: auto;       /* ให้ยืดตามรูป */
        min-height: 200px;  /* กันไม่ให้เล็กเกิน */
    }
    .card-content img {
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    .Knowhouses h1 {
        font-size: 1.5em;
    }
    .underline2 {
        width: 60px;
        height: 5px;
    }
    .card h3 {
        font-size: 1.2em;
    }
}