/* หน้า "กำลังปรับปรุง" ของ www.laothani.com — mobile-first
   สีและรูปทรงทั้งหมดมาจากโลโก้ Laothani: น้ำเงิน + เหลือง + ขาว / สามเหลี่ยม สี่เหลี่ยม วงกลม

   หน้าเดียวพอดีจอ: body สูงอย่างน้อยเท่าจอ (min-height ไม่ใช่ height) แบ่งเป็น
   header (บาง) → hero (ยืดเต็มพื้นที่ที่เหลือ) → footer (แถบติดต่อ + ลิขสิทธิ์)
   จอปกติ (มือถือ 360×740 ขึ้นไป / คอม 1280×720 ขึ้นไป) ไม่ต้อง scroll
   จอเตี้ยกว่านั้น เนื้อหาจะดันหน้ายาวขึ้นแล้ว scroll ได้ตามปกติ — ไม่มีอะไรถูกตัดหรือซ้อนกัน */

:root {
  /* ---- สีองค์กร (ดึงจากพิกเซลจริงของ Logo.png) ---- */
  --brand-blue: #1f4396;
  --brand-yellow: #fdc50c;
  --brand-white: #ffffff;

  /* ---- โทนที่แตกจากสีองค์กร ---- */
  --brand-blue-dark: #16306e; /* พื้นแถบติดต่อ */
  --brand-blue-deep: #0e2250; /* ตัวอักษรหัวข้อ + ตัวอักษรบนพื้นเหลือง */
  --brand-blue-tint: #e9eef8; /* ลายตกแต่ง */
  --brand-blue-tint-strong: #d3ddf1;
  --brand-yellow-dark: #e6ad00; /* hover ของปุ่มเหลือง */
  --brand-yellow-tint: #fff4cc; /* ลายตกแต่ง */

  /* ---- สีตัวอักษรและพื้น ---- */
  --color-text: #1a2238;
  --color-muted: #4a5673; /* contrast กับพื้นขาว ~7:1 */
  --color-surface: var(--brand-white);
  --color-border: #e1e7f2;

  --container-width: 1080px;

  /* ฟอนต์สำรองของเครื่อง (ใช้เมื่อโหลด Google Fonts ไม่ได้)
     ลาว: Phetsarath OT / Saysettha OT / Lao UI (Windows) / Lao Sangam MN (Apple)
     ไทย: Leelawadee UI (Windows) / Thonburi (Apple) / Tahoma */
  --font-latin: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-lao: "Noto Sans Lao", "Phetsarath OT", "Saysettha OT", "Lao UI", "Lao Sangam MN",
    "Leelawadee UI", var(--font-latin);
  --font-thai: "Noto Sans Thai", "Leelawadee UI", "Thonburi", Tahoma, var(--font-latin);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  /* 100dvh = ความสูงจอจริงบนมือถือ (ไม่รวมแถบที่อยู่ของเบราว์เซอร์) · 100vh เป็นค่าสำรองของเบราว์เซอร์เก่า */
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-latin);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.6;
  overflow-wrap: anywhere; /* กันคำยาว (เช่นอีเมล) ดันหน้าเกินจอมือถือ */
}

/* main ยืดกินพื้นที่ที่เหลือระหว่าง header กับ footer */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* เลือกฟอนต์ตามภาษาของข้อความ (อัปเดตจาก <html lang> และ lang="..." ของแต่ละส่วน) */
:lang(lo) {
  font-family: var(--font-lao);
}
:lang(th) {
  font-family: var(--font-thai);
}
:lang(en) {
  font-family: var(--font-latin);
}

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 480px) {
  .container {
    padding: 0 24px;
  }
}

/* ซ่อนจากจอ แต่ screen reader ยังอ่านได้ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ลายตกแต่งทั้งหมด: วางซ้อนหลังเนื้อหา ไม่รับคลิก และไม่ดันหน้ากว้าง/ยาวเกินจอ (parent ตั้ง overflow: hidden) */
.shape {
  position: absolute;
  display: block;
  pointer-events: none;
}

/* ================= แถบบน ================= */

.site-header {
  flex: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

/* แถบสีองค์กรบาง ๆ ด้านบนสุด: น้ำเงิน | เหลือง */
.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue) 0 70%, var(--brand-yellow) 70% 100%);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 56px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
}

.brand-name {
  color: var(--brand-blue-deep);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* มือถือ: ซ่อนชื่อข้างสัญลักษณ์ เพราะชื่อบริษัทแสดงตัวใหญ่อยู่ใน hero แล้ว
   (ชื่อลาว/ไทยยาวกว่าอังกฤษ ถ้าแสดงบนมือถือ header จะตกเป็น 2 แถว เสียพื้นที่แนวตั้ง) */
@media (max-width: 559px) {
  .brand-name {
    display: none;
  }
}

.language-switcher {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #f6f8fc;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.language-switcher button {
  min-height: 34px;
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.language-switcher button:hover {
  color: var(--brand-blue);
}

.language-switcher button[aria-pressed="true"] {
  background: var(--brand-blue);
  color: var(--brand-white);
}

.language-switcher button:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ================= Hero (ยืดเต็มพื้นที่ที่เหลือ เนื้อหาอยู่กลางแนวตั้ง) ================= */

.hero {
  position: relative;
  overflow: hidden; /* กันลายตกแต่งล้นออกนอก hero — ตั้งที่ hero เท่านั้น ไม่ใช่ body */
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding: 24px 0 40px;
}

/* ลายตกแต่ง: สามเหลี่ยมน้ำเงินอ่อนมุมขวาบน (ล้อสามเหลี่ยมในโลโก้) */
.shape-triangle {
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--brand-blue-tint);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* สี่เหลี่ยมเหลืองอ่อนมุมซ้ายล่าง — มือถือโผล่แค่ 36px ให้อยู่ในช่องว่างใต้ข้อความ (padding-bottom 40px) */
.shape-square {
  bottom: -36px;
  left: -36px;
  width: 72px;
  height: 72px;
  background: var(--brand-yellow-tint);
}

/* วงกลมกลวง + สี่เหลี่ยมเหลืองเล็ก — แสดงเฉพาะจอกว้าง เพื่อไม่ให้มือถือรก */
.shape-ring,
.shape-dot {
  display: none;
}

.hero-inner {
  position: relative; /* ให้อยู่เหนือลายตกแต่ง */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* โลโก้อยู่บนแผ่นขาวเสมอ เพราะวงกลมในโลโก้เป็นส่วนโปร่งใส ต้องเห็นเป็นสีขาว */
.hero-logo-plate {
  flex: none;
  padding: 14px;
  background: var(--brand-white);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 12px 32px -16px rgba(14, 34, 80, 0.35);
}

/* ขนาดโลโก้ผูกกับความสูงจอ (vh) — จอเตี้ยโลโก้เล็กลง ทั้งหน้าจึงยังอยู่ในจอเดียว
   และไม่กว้างเกิน 45% ของความกว้างจอ (มือถือแนวตั้ง) */
.hero-logo {
  width: auto;
  height: clamp(88px, 25vh, 240px);
  max-width: 45vw;
  object-fit: contain;
}

.hero-text {
  margin-top: 20px;
  max-width: 600px;
}

.company-name {
  margin: 0;
  color: var(--brand-blue-deep);
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.4;
}

/* บรรทัดรอง: ชื่ออังกฤษตัวพิมพ์ใหญ่ (ภาษาอังกฤษไม่มีบรรทัดนี้ เพราะชื่อหลักเป็นอังกฤษอยู่แล้ว) */
.company-name-sub {
  margin: 0;
  color: var(--brand-blue);
  font-size: clamp(0.8rem, 3.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ค่าคำแปลว่าง → ไม่แสดง element (ไม่ต้องใช้ inline style) */
.company-name-sub:empty {
  display: none;
}

/* ป้าย "กำลังปรับปรุง": พื้นเหลือง + ตัวอักษรน้ำเงินเข้ม (contrast ~9.7:1 ผ่าน WCAG AA) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--brand-blue-deep);
  font-size: 0.875rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-blue);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none;
  }
}

.hero h1 {
  margin: 12px 0 0;
  color: var(--color-text);
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
}

.lead {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.55;
}

/* จอกว้าง: โลโก้ซ้าย ข้อความขวา + ลายตกแต่งเต็มชุด */
@media (min-width: 880px) {
  .hero {
    padding: 40px 0;
  }

  .hero-inner {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(40px, 5vw, 72px);
    text-align: left;
  }

  .hero-logo-plate {
    padding: 22px;
    border-radius: 22px;
  }

  .hero-logo {
    height: clamp(180px, 42vh, 420px);
    max-width: none;
  }

  .hero-text {
    margin-top: 0;
  }

  .status-badge {
    margin-top: 22px;
    padding: 6px 16px;
  }

  .hero h1 {
    margin-top: 14px;
  }

  .lead {
    margin-top: 8px;
    font-size: 1.05rem;
  }

  .shape-triangle {
    width: clamp(220px, 38vh, 420px);
    height: clamp(220px, 38vh, 420px);
  }

  .shape-square {
    bottom: -60px;
    left: -60px;
    width: clamp(150px, 26vh, 260px);
    height: clamp(150px, 26vh, 260px);
  }

  .shape-ring {
    display: block;
    right: 7%;
    bottom: 32px;
    width: 96px;
    height: 96px;
    border: 14px solid var(--brand-blue-tint-strong);
    border-radius: 50%;
  }

  .shape-dot {
    display: block;
    top: 40px;
    left: 46%;
    width: 18px;
    height: 18px;
    background: var(--brand-yellow);
  }
}

/* จอคอมที่สูง (เช่น 1440×900, 1920×1080): ขยายตัวอักษรให้สมดุลกับโลโก้ที่ใหญ่ขึ้น */
@media (min-width: 1200px) and (min-height: 860px) {
  .company-name {
    font-size: 3rem;
  }

  .company-name-sub {
    font-size: 1.15rem;
  }

  .status-badge {
    margin-top: 28px;
    font-size: 0.95rem;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .lead {
    font-size: 1.2rem;
  }
}

/* ================= ท้ายหน้า: แถบติดต่อ + ลิขสิทธิ์ ================= */

.site-footer {
  position: relative;
  overflow: hidden; /* กันลายตกแต่งมุมล้น */
  flex: none;
  background: var(--brand-blue-dark);
  color: rgba(255, 255, 255, 0.88);
}

/* สามเหลี่ยมเหลืองมุมซ้ายล่าง (ล้อสามเหลี่ยมในโลโก้) */
.shape-footer-corner {
  bottom: 0;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--brand-yellow);
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.footer-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 14px;
  text-align: center;
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.contact-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ปุ่มอีเมล: พื้นเหลือง + ตัวอักษรน้ำเงินเข้ม (ห้ามตัวขาวบนเหลือง) */
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--brand-blue-deep);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.contact-email:hover {
  background: var(--brand-yellow-dark);
}

.contact-email:focus-visible {
  outline: 3px solid var(--brand-white);
  outline-offset: 3px;
}

.contact-email svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* มือถือจอแคบ: ลดขอบในให้อีเมลอยู่บรรทัดเดียว (ถ้าไม่พอจริง ๆ จะตัดบรรทัดหลัง @ ตาม <wbr> ใน HTML) */
@media (max-width: 419px) {
  .contact-email {
    padding: 8px 14px;
    font-size: 0.95rem;
  }
}

/* จอกว้าง: แถบเดียวแนวนอน — ข้อความติดต่อ + ปุ่มอีเมล (ซ้าย) · ลิขสิทธิ์ (ขวา) */
@media (min-width: 880px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
    text-align: left;
  }

  .contact {
    flex-direction: row;
    gap: 20px;
  }

  .shape-footer-corner {
    width: 44px;
    height: 44px;
  }
}
