/* ===========================================================
   สไตล์หน้าบทความ — ใช้ร่วมกันทุกบทความ
   โทนสีและฟอนต์เดียวกับหน้าแรก
   =========================================================== */

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

body {
  font-family: "Noto Sans Thai", "Inter", sans-serif;
  color: #1e2631;
  overflow-x: hidden;
  max-width: 100vw;
  /* พื้นหลังไล่สีเคลื่อนไหวชุดเดียวกับหน้าแรก */
  background: linear-gradient(135deg, #ffffff 0%, #eaf2ff 50%, #f8f9fb 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  background-attachment: fixed;
}

/* ลายตารางบาง ๆ ทับพื้นหลัง เหมือน holo-grid ของหน้าแรก */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(110, 197, 255, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(110, 197, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
}

/* Particle network: อยู่เหนือลายตาราง แต่ใต้เนื้อหาทุกส่วน
   pointer-events: none เพื่อไม่ให้ขวางการคลิก/เลือกข้อความ */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

@keyframes gridMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 50px 50px;
  }
}

h1,
h2,
h3 {
  font-family: "Noto Sans Thai", "Space Grotesk", sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: 1200px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #ee6926;
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 20px;
  background: #ee6926;
  color: #fff;
  border-radius: 0 0 12px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Navbar ---------- */
.nav-pill {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(30, 38, 49, 0.07);
  border-radius: 9999px;
}

@supports not (backdrop-filter: blur(1px)) {
  .nav-pill {
    background: rgba(255, 255, 255, 0.96);
  }
}

.nav-link {
  color: #1e2631;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #ee6926;
}

.nav-link.is-current {
  color: #ee6926;
  font-weight: 700;
}

/* ช่วง 1024–1279px เมนูเดสก์ท็อปเพิ่งโผล่มาแต่ที่ยังแคบ ถ้าไม่ลดขนาด
   ข้อความไทยจะตัดขึ้นสองบรรทัด (เช่น "ขั้นตอนการ / ทำงาน") ทำให้แถบเมนูสูงผิดรูป
   ใช้ .navbar นำหน้าเพื่อชนะ utility ของ Tailwind ที่ inject ทีหลัง */
@media (min-width: 1024px) and (max-width: 1279px) {
  .navbar .nav-link {
    font-size: 14px;
    white-space: nowrap;
  }
}

/* เมนูมือถือ: ตัวลิงก์เดิมสูงแค่ 23px ซึ่งเล็กกว่าขนาดพื้นที่กดที่แนะนำ (44px)
   จึงขยายพื้นที่กดให้ครบ โดยไม่เปลี่ยนขนาดตัวอักษร */
#mobileMenu .nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.navbar {
  transition: all 0.3s ease;
}

.navbar.scrolled .nav-pill {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 40px rgba(30, 38, 49, 0.12);
}

/* ---------- ตัวเลือกภาษา ---------- */
.flag {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(30, 38, 49, 0.12);
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border-radius: 9999px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.25s ease;
}

.lang-trigger:hover {
  background: rgba(30, 38, 49, 0.06);
}

#langLabel {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e2631;
}

@media (max-width: 639px) {
  #langLabel {
    display: none;
  }
}

.lang-chevron {
  font-size: 0.62rem;
  color: rgba(30, 38, 49, 0.6);
  transition: transform 0.25s ease;
}

.lang-trigger[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

#langMenu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 11rem;
  max-width: none;
  list-style: none;
  padding: 6px;
  border-radius: 16px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 36px rgba(30, 38, 49, 0.16);
}

#langMenu.hidden {
  display: none;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: #1e2631;
  text-align: left;
  transition: background 0.2s ease;
}

.lang-option:hover {
  background: rgba(238, 105, 38, 0.08);
}

.lang-option[aria-selected="true"] {
  background: rgba(238, 105, 38, 0.12);
  font-weight: 700;
}

.lang-check {
  margin-left: auto;
  color: #ee6926;
  font-size: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, #ee6926 0%, #ff7b39 100%);
  color: #fff;
  padding: 11px 24px;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.4s ease;
  display: inline-block;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(238, 105, 38, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(238, 105, 38, 0.45);
}

.btn-outline {
  padding: 11px 24px;
  border-radius: 9999px;
  border: 2px solid #3d4255;
  color: #1e2631;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.4s ease;
}

.btn-outline:hover {
  background: rgba(61, 66, 85, 0.08);
  transform: translateY(-3px);
}

/* ---------- ส่วนหัวบทความ ---------- */
.article-hero {
  padding: 130px 0 40px;
  /* ปล่อยให้เห็นพื้นหลังเคลื่อนไหวของ body */
  background: transparent;
}

/* ส่วนหัวใช้คอลัมน์กว้าง 780px จัดกลาง เท่ากับ .article-figure / .article-body
   ไม่งั้นบนจอ >= 830px หัวข้อจะชิดซ้ายขอบ container ขณะที่เนื้อหาอยู่กลางจอ */
.article-hero .breadcrumb,
.article-hero-inner {
  max-width: 780px;
  margin-inline: auto;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(30, 38, 49, 0.55);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: rgba(30, 38, 49, 0.65);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: #ee6926;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 9999px;
  background: rgba(238, 105, 38, 0.1);
  color: #ee6926;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.article-title {
  font-size: clamp(1.6rem, 4.6vw, 2.3rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 22px;
}

/* บนจอกว้าง: คอลัมน์กว้างสุด 780px อยู่แล้ว จึงตรึงขนาดฟอนต์ไม่ให้โตตามจอ
   หัวข้อของบทความที่มีอยู่พอดีบรรทัดเดียว และถ้าหัวข้อใหม่ยาวกว่าก็ขึ้นบรรทัดใหม่
   แบบแบ่งบรรทัดสวย ไม่ล้นออกนอกคอลัมน์ (นี่คือเหตุที่เลิกใช้ white-space: nowrap) */
@media (min-width: 1024px) {
  .article-title {
    font-size: 1.9rem;
    text-wrap: balance;
  }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-size: 0.88rem;
  color: rgba(30, 38, 49, 0.6);
}

.article-meta i {
  color: #ee6926;
  margin-right: 6px;
}

/* ---------- ภาพประกอบ ---------- */
.article-figure {
  max-width: 780px;
  margin: -10px auto 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(30, 38, 49, 0.1);
}

.article-figure img {
  width: 100%;
  border-radius: 18px;
  display: block;
}

/* ---------- เนื้อหา ---------- */
.article-body {
  max-width: 780px;
  margin: 48px auto 0;
  padding: 44px 40px 36px;
  border-radius: 28px;
  /* พื้นทึบ: ส่วนเนื้อหาไม่ใช้พื้นหลังเคลื่อนไหว เพื่อให้อ่านสบายตา */
  background: #ffffff;
  border: 1px solid rgba(30, 38, 49, 0.06);
  box-shadow: 0 16px 44px rgba(30, 38, 49, 0.07);
  font-size: 1.05rem;
  line-height: 1.95;
  color: rgba(30, 38, 49, 0.82);
}

@media (max-width: 640px) {
  .article-body {
    padding: 28px 22px 22px;
    border-radius: 22px;
  }
}

.article-body .lead {
  font-size: 1.18rem;
  line-height: 1.85;
  color: #1e2631;
  font-weight: 500;
  padding-left: 20px;
  border-left: 4px solid #ee6926;
  margin-bottom: 32px;
}

.article-body p {
  margin-bottom: 26px;
}

.article-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #1e2631;
  margin: 44px 0 18px;
  line-height: 1.4;
}

.article-body blockquote {
  margin: 36px 0;
  padding: 26px 28px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(238, 105, 38, 0.07),
    rgba(110, 197, 255, 0.07)
  );
  border: 1px solid rgba(238, 105, 38, 0.16);
  font-size: 1.08rem;
  line-height: 1.8;
  color: #1e2631;
  font-weight: 500;
}

.article-body ul {
  margin: 0 0 26px 4px;
  list-style: none;
}

.article-body ul li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
}

.article-body ul li::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 1px;
  color: #ee6926;
}

/* ---------- แชร์ ---------- */
.article-share {
  max-width: 780px;
  margin: 48px auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(30, 38, 49, 0.1);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(30, 38, 49, 0.7);
}

.share-links {
  display: flex;
  gap: 10px;
}

.share-links a,
.share-links button {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(30, 38, 49, 0.1);
  color: #1e2631;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-links a:hover,
.share-links button:hover {
  background: #ee6926;
  color: #fff;
  transform: translateY(-3px);
  border-color: transparent;
}

.copy-status {
  font-size: 0.85rem;
  color: #15803d;
  font-weight: 600;
}

/* ---------- บทความถัดไป ---------- */
.article-next {
  max-width: 780px;
  margin: 56px auto 0;
}

.article-next h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.next-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border-radius: 24px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(30, 38, 49, 0.07);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.next-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(30, 38, 49, 0.13);
}

.next-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
}

.next-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ee6926;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.next-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e2631;
  margin: 6px 0 8px;
  line-height: 1.5;
}

.next-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ee6926;
}

@media (max-width: 520px) {
  .next-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .next-card img {
    width: 100%;
    height: 160px;
  }
}

/* ---------- ชวนติดต่อ ---------- */
.article-cta {
  max-width: 780px;
  margin: 56px auto 0;
  padding: 40px 28px;
  border-radius: 28px;
  text-align: center;
  background-color: #fff;
  border: 1px solid rgba(238, 105, 38, 0.18);
}

.article-cta h2 {
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 10px;
}

.article-cta p {
  color: rgba(30, 38, 49, 0.7);
  margin-bottom: 26px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Footer ---------- */
/* ---------- Footer: พื้นหลังและโครงเดียวกับหน้าแรก ---------- */
.article-footer {
  margin-top: 72px;
  padding: 48px 0 28px;
  position: relative;
  z-index: 1;
  /* ไล่สีแนวเดียวกับ footer ของหน้าแรก (bg-gradient-to-br from-white to-#f8f9fb) */
  background: linear-gradient(to bottom right, #ffffff, #f8f9fb);
}

/* เส้นเรืองแสงด้านบนแบบเดียวกับหน้าแรก */
.article-footer .glow-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3d4255, transparent);
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.footer-grid {
  display: grid;
  gap: 32px;
  margin-bottom: 40px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: span 2;
  }
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px;
  }
  .footer-brand {
    grid-column: span 2;
  }
}

.footer-desc {
  font-size: 0.92rem;
  line-height: 1.8;
  color: rgba(30, 38, 49, 0.6);
  max-width: 28rem;
  margin-bottom: 16px;
}

.footer-addr {
  font-style: normal;
  font-size: 0.88rem;
  line-height: 1.9;
  color: rgba(30, 38, 49, 0.6);
  margin-bottom: 22px;
}

.footer-addr a {
  color: rgba(30, 38, 49, 0.75);
  text-decoration: none;
}

.footer-addr a:hover {
  color: #ee6926;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e2631;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.footer-social a:hover {
  color: #ee6926;
  transform: scale(1.1);
}

.footer-head {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e2631;
  margin-bottom: 16px;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-list a {
  font-size: 0.88rem;
  color: rgba(30, 38, 49, 0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-list a:hover {
  color: #ee6926;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(30, 38, 49, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(30, 38, 49, 0.5);
}

.footer-top-link {
  color: rgba(30, 38, 49, 0.6);
  text-decoration: none;
}

.footer-top-link:hover {
  color: #ee6926;
}

@media (max-width: 767px) {
  .article-hero {
    padding: 110px 0 32px;
  }
  .article-figure {
    padding: 12px;
    border-radius: 22px;
  }
  .article-body {
    margin-top: 40px;
    font-size: 1rem;
  }
}
