:root {
  --bg: #e5e7eb;
  /* page grey strip */
  --panel: #ffffff;
  /* pill bg */
  --ink: #0f172a;
  --muted: #6b7280;
  --brand: #256a63;
  /* deep teal */
  --line: #e5e7eb;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  --radius: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Noto Sans Thai", sans-serif;
  background: var(--bg);
}

/* Layout container like your mockup */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* 1) ลดร่องข้าง container บนจอเล็กให้กว้างขึ้นจริง ๆ */
@media (max-width: 1024px) {
  .container {
    padding: 0 24px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  /* เดิม 40px ต่อข้าง → เหลือ 16px */
}

/* 2) ทำให้ intro เป็นคอลัมน์เดียวและกินความกว้างเต็ม */
.intro-brand {
  background: #e5e7eb;
}

@media (max-width: 980px) {
  .intro-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: left !important;
    /* ให้อ่านง่ายขึ้นบนมือถือ */
  }

  .intro-left,
  .intro-right {
    justify-content: stretch;
  }
}

/* 3) ข้อความ: เอา max-width ออก, ปรับขนาด/บรรทัดให้อ่านง่ายบนมือถือ */
@media (max-width: 640px) {
  .intro-quote {
    max-width: none !important;
    /* สำคัญ: ไม่บีบความกว้าง */
    margin: 0 !important;
    padding: 0 2px;
    /* กันชิดขอบเล็กน้อย */
    font-size: 16.75px;
    /* อ่านสบายบนมือถือ */
    line-height: 1.95;
    text-align: left;
    word-break: break-word;
    /* ป้องกันคำยาวหลุดกรอบ */
    overflow-wrap: anywhere;
    line-break: loose;
    /* ช่วยตัดบรรทัดภาษาไทย */
    text-wrap: pretty;
    /* เบราว์เซอร์รองรับจะจัดบรรทัดสวยขึ้น */
  }

  .intro-logo {
    width: 128px;
  }
}

/* 4) กันกรณีมีสไตล์ซ้ำซ้อนมาก่อนหน้า (มี .intro-quote ซ้ำ) */
.intro-quote {
  max-width: 72ch;
}

/* เดสก์ท็อปยังคุมความยาวบรรทัดให้อ่านง่าย */
@media (max-width: 980px) {
  .intro-quote {
    max-width: none;
  }

  /* แท็บเล็ตลงมาไม่จำกัดความกว้างแล้ว */
}


/* Focus (a11y) */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #86efac;
  outline-offset: 2px;
  border-radius: 12px
}


/* Wrap + z-index above hero */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  padding: 12px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
margin-bottom: 20px; /* ระยะห่างคงที่ */
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  height: 56px;
  padding: 0 12px
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit
}

.brand-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover
}

.brand-text b {
  color: var(--brand);
  line-height: 1.1
}

.brand-text small {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px
}


.links {
  display: flex;
  align-items: center;
  gap: 8px
}

.link {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer
}

.link:hover {
  background: #f3f4f6
}

.chev {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  opacity: .6
}

.dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  min-width: 220px
}

.link.open+.dropdown {
  display: grid;
  margin-top: 8px
}


/* Hamburger */
.hamb {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  place-items: center;
  cursor: pointer
}

.hamb span,
.hamb span::before,
.hamb span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  transition: 200ms ease
}

.hamb span::before,
.hamb span::after {
  content: "";
  position: absolute;
  left: 0
}

.hamb span::before {
  top: -6px
}

.hamb span::after {
  top: 6px
}

.hamb[aria-expanded="true"] span {
  background: transparent
}

.hamb[aria-expanded="true"] span::before {
  transform: rotate(45deg);
  top: 0
}

.hamb[aria-expanded="true"] span::after {
  transform: rotate(-45deg);
  top: 0
}


/* Mobile sheet */
.sheet {
  position: fixed;
  inset: calc(56px + 12px) 0 auto 0;
  padding: 0 16px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 210
}

.sheet-inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  overflow: hidden
}

.sheet.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  min-height: 52px
}

.row:last-child {
  border-bottom: 0
}

.row small {
  color: var(--muted)
}


/* Backdrop */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .36);
  backdrop-filter: saturate(120%) blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 205
}

.backdrop.show {
  opacity: 1;
  pointer-events: auto
}


/* Responsive */
@media(max-width:919px) {
  .links {
    display: none
  }

  .hamb {
    display: grid
  }
}

/* Links (desktop) */
.links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.link:hover {
  background: #f3f4f6;
}

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.link.open+.dropdown {
  display: grid;
}

/* Hamburger (mobile) */
.hamb {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  place-items: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.hamb span,
.hamb span::before,
.hamb span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease;
}

.hamb span::before,
.hamb span::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamb span::before {
  top: -6px;
}

.hamb span::after {
  top: 6px;
}

.hamb.active span {
  background: transparent;
}

.hamb.active span::before {
  transform: rotate(45deg);
  top: 0;
}

.hamb.active span::after {
  transform: rotate(-45deg);
  top: 0;
}

/* Mobile Sheet */
.sheet {
  display: none;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  padding: 0 16px;
  z-index: 99;
}

.sheet-inner {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.sheet.show {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
}

.row:last-child {
  border-bottom: none;
}

.row small {
  color: var(--muted);
  font-size: 13px;
}

/* Responsive behavior */
@media (max-width: 920px) {
  .links {
    display: none;
  }

  .hamb {
    display: grid;
  }
}



/* Mobile sheet */
.sheet {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  padding: 0 16px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}

.sheet.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.row {
  min-height: 52px;
}


.sheet-inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}

.row:last-child {
  border-bottom: 0;
}

.row small {
  color: var(--muted);
}

.row .chev {
  transform: rotate(-45deg);
}

.sheet.show {
  display: block;
}

/* ===== HERO IMAGE CENTERED ===== */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  /* ระยะบนล่างให้รูปหายใจ */
  background: linear-gradient(180deg, #f0f7f5 0%, #ffffff 100%);
}

.hero-figure {
  max-width: 1000px;
  /* จำกัดความกว้างของรูป */
  width: 90%;
  border-radius: 24px;
  /* มุมโค้งมน */
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 3s ease;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 24px;
  transition: transform 4s ease;
}

/* เอฟเฟกต์เมื่อ hover */
.hero-figure img:hover {
  transform: scale(1.05);
}

/* จัดให้อยู่ตรงกลางแนวตั้งทั้งหน้า ถ้าต้องการเต็ม viewport */
.fullscreen-hero {
  min-height: calc(100vh - 80px);
  /* ลบส่วน navbar ออก */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== ปรับขนาดข้อความ intro-brand ===== */
.intro-brand {
  background: #e5e7eb;
  padding: 80px 0;
  /* เพิ่มความสูงโดยรวม */
}

.intro-grid {
  display: grid;
  gap: 60px;
  /* เพิ่มระยะห่างระหว่างซ้าย-ขวา */
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ===== ปรับเฉพาะมือถือ ===== */
@media (max-width: 768px) {
  .fullscreen-hero {
    min-height: auto;
    /* ไม่ต้องบังคับสูง */
  }

  .hero {
    padding: 0;
    margin-bottom: 0;
    /* ลดช่องว่างด้านล่าง */
  }

  .hero-figure {
    border-radius: 0;
    /* ชิดขอบจอมือถือ */
    box-shadow: none;
    /* ลดเงาให้เรียบ */
  }

  .hero-figure img {
    border-radius: 0;
    object-fit: cover;
    height: auto;
  }
}

/* ปรับเพิ่มสำหรับจอเล็กมาก (<480px) */
@media (max-width: 480px) {
  .hero-figure img {
    margin-bottom: -4px;
    /* เอาช่องว่างจิ๋วออก */
  }
}

/* ปรับโลโก้ซ้ายให้ใหญ่ขึ้น */
.intro-logo {
  width: 200px;
  height: auto;
  margin-bottom: 24px;
}

/* ปรับข้อความด้านขวาให้ใหญ่และอ่านง่าย */
.intro-quote {
  max-width: 700px;
  font-size: 22px;
  /* จากเดิม 18px → 22px */
  line-height: 1.9;
  color: #111827;
  font-weight: 600;
  text-align: center;
  margin: 0 auto;
}

@media (min-width: 980px) {
  .intro-quote {
    font-size: 24px;
    /* Desktop ใหญ่ขึ้นอีกนิด */
    text-align: left;
  }
}

.intro-quote .q {
  color: #256a63;
  font-weight: 700;
  font-style: italic;
}


/* ด้านซ้าย โลโก้ KH */
.intro-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.intro-logo {
  width: 160px;
  height: auto;
  margin-bottom: 20px;
}

.intro-mark .kh {
  font-weight: 800;
  font-size: 56px;
  letter-spacing: 4px;
  color: #256a63;
  margin-bottom: 6px;
}

.intro-mark .sub {
  color: #374151;
  font-size: 14px;
  letter-spacing: 2px;
}

.intro-mark .sub small {
  display: block;
  font-size: 12px;
  color: #6b7280;
  letter-spacing: 1.5px;
}

/* ด้านขวา ข้อความปรัชญา */
.intro-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-quote {
  max-width: 600px;
  font-size: 18px;
  line-height: 1.9;
  color: #111827;
  font-weight: 600;
  text-align: center;
}

@media (min-width: 980px) {
  .intro-quote {
    text-align: left;
  }
}

.intro-quote .q {
  color: #256a63;
  font-weight: 700;
  font-style: italic;
}

/* ===== HERO IMAGE ONLY SECTION ===== */
.hero {
  padding: 0;
  margin: 0;
}

.hero-inner {
  display: block;
  margin: 0;
  padding: 0;
}

.hero-figure {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  border: none;
  box-shadow: none;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 0 0 24px 24px;
  transition: transform 3s ease;
}

.hero-figure img:hover {
  transform: scale(1.05);
}

/* Background gradient behind full hero image */
body {
  background: linear-gradient(180deg, #f0f7f5 0%, #ffffff 100%);
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans Thai", sans-serif;
}


/* ===== Subsidiaries list ===== */
.subs {
  background: #e5e7eb;
  padding: 36px 0;
}

.subs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #d1d5db;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  overflow: hidden;
}

.subs-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}

.subs-item+.subs-item {
  border-top: 1px solid #e5e7eb;
}

.ico {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: #f3f4f6;
  color: #0f172a;
}

.subs-text h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #0f172a;
}

.subs-text p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
}

@media(min-width:980px) {
  .subs-item {
    grid-template-columns: 56px 1fr;
    padding: 18px 24px;
  }

  .subs-text h3 {
    font-size: 20px;
  }
}

/* ===== Subsidiaries Grid (Final Polished Layout) ===== */
.subs-grid {
  background: #e5e7eb;
  padding: 80px 0;
}

.subs-grid .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  justify-content: center;
  align-items: stretch;
}

/* การ์ดหลัก */
.card {
  background: #f9fafb;
  border: 1.5px solid #9ca3af;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* รูปภาพสมดุล (4 เหลี่ยมมาตรฐาน) */
.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  /* ให้ทุกภาพเท่ากันแบบ 4:3 */
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* แถบชื่อด้านล่าง */
.card-text {
  background: #f3f4f6;
  border-top: 1.5px solid #d1d5db;
  padding: 16px 20px;
  text-align: center;
}

.card-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .card img {
    aspect-ratio: 16 / 10;
  }
}

/* ===== Footer Message Section ===== */
.footer-message {
  background: #e5e7eb;
  padding: 60px 20px;
  text-align: center;
}

.footer-message .container {
  max-width: 800px;
  margin: 0 auto;
}

.footer-message h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 18px;
}

.footer-message p {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.8;
  margin: 6px 0;
}

.footer-message .quote {
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  color: #256a63;
  margin-top: 16px;
}

/* A11y focus */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #86efac;
  outline-offset: 2px;
  border-radius: 12px;
}