/* =============================================
   INFO HUB — คู่มือเตรียมตัวก่อนออกทริป
   ยกมาจาก <style> ที่เคยฝังอยู่ในหน้า info-hub ทั้ง TH/EN
   ใช้ตัวแปรและค่ามุม/เงาชุดเดียวกับทั้งเว็บ (style.css)
   ============================================= */

/* มุมโค้ง: การ์ดนอก 28px · กล่องซ้อนข้างใน 20px (เล็กกว่ากรอบนอกเสมอ) · ปุ่ม 999px */
:root {
  --hub-radius: 28px;
  --hub-radius-inner: 20px;
}

/* ---------- HERO ---------- */
.hub-hero {
  text-align: center;
  padding: 56px 20px 36px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}
.hub-hero h1 {
  font-family: 'Kanit', sans-serif;
  font-size: clamp(34px, 5vw, 52px);
  color: var(--dark);
  line-height: 1.15;
  margin: 0 0 12px;
}
.hub-hero p {
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- BREADCRUMB ---------- */
.hub-crumb {
  width: min(1160px, calc(100% - 32px));
  margin: 18px auto 0;
  font-size: 14px;
  color: var(--muted);
}
.hub-crumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.hub-crumb a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 2px;
}
.hub-crumb a:hover { text-decoration: underline; }
.hub-crumb li + li::before {
  content: '›';
  margin-right: 8px;
  color: var(--muted);
}
.hub-crumb [aria-current='page'] { color: var(--text); }

/* ---------- สารบัญในหน้า ----------
   5 ปุ่มต้องใช้ 811px (ไทย) / 852px (อังกฤษ) ถึงจะเรียงแถวเดียว
   ของเดิมล็อกไว้ 760px พอเพิ่มปุ่ม "เฉพาะที่นี่" เข้ามาเลยตกเป็น 4+1
   ใบสุดท้ายอยู่คนเดียว — ขยายให้พอทั้งสองภาษา */
.hub-toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 26px auto 0;
  max-width: 900px;
}
.hub-toc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(14, 165, 233, .18);
  color: var(--blue);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.hub-toc-link:hover {
  background: #eef8ff;
  border-color: rgba(14, 165, 233, .38);
}
.hub-toc-link svg { flex: none; }
.hub-hero .btn { margin-top: 22px; }

/* หัวข้อที่ถูกลิงก์จากสารบัญต้องไม่ถูกแถบเมนู sticky บังตอนเลื่อนถึง */
.guide-card[id],
.faq-section[id],
#only { scroll-margin-top: 118px; }

/* ---------- การ์ดคู่มือ 4 ใบ ---------- */
.guide-grid-title {
  font-family: 'Kanit', sans-serif;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  color: var(--dark);
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 22px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 72px;
}
.guide-card {
  background: rgba(255, 255, 255, .88);
  border-radius: var(--hub-radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .9);
  transition: transform .25s ease;
}
.guide-card:hover { transform: translateY(-4px); }

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.guide-icon {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: #eef8ff;
  color: var(--blue);
  display: grid;
  place-items: center;
}
.guide-card:nth-child(even) .guide-icon {
  background: #f0fdf4;
  color: #3f8f28; /* เขียวเข้มกว่า --green เพื่อให้ไอคอนบนพื้นอ่อนยังอ่านออก */
}
.guide-card-header h3 {
  font-family: 'Kanit', sans-serif;
  font-size: 22px;
  color: var(--dark);
  margin: 0;
}

.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}
.guide-list li:last-child { margin-bottom: 0; }
.guide-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.guide-card:nth-child(even) .guide-list li::before { background: #3f8f28; }

/* ---------- แถบ "เฉพาะที่นี่" ----------
   เป็นป้ายบอกจุดขาย ไม่ใช่ที่อธิบาย — รายละเอียดเต็มอยู่ในการ์ดคู่มือที่ต่อ
   ลงไปทันที เขียนยาวตรงนี้ = คนอ่านเจอเรื่องเดียวกันสองรอบติดกัน

   ⚠️ ไล่สีต้องจบในโซนน้ำเงินเข้ม อย่าวิ่งไปถึงฟ้าสว่าง (#0ea5e9)
   ของเดิมไล่ไปถึง rgba(14,165,233,.88) ทำให้ตัวหนังสือขาวบนการ์ดฝั่งขวา
   เหลือคอนทราสต์ 2.36:1 (วัดจากพิกเซลจริง) ต่ำกว่าเกณฑ์อ่านออก 4.5 */
.only-section {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}
.only-box {
  background: linear-gradient(135deg, #053f78, #0a5b90);
  color: #fff;
  border-radius: var(--hub-radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .14);
}
.only-head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.only-box h2 {
  font-family: 'Kanit', sans-serif;
  font-size: clamp(22px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: .5px;
  color: #fff;
  margin: 0;
}
.only-head .only-sub {
  font-size: 14px;
  font-weight: 700;
  color: #c9f79a;
}
.only-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.only-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, .07);
  padding: 16px;
  /* การ์ดย่อยที่ซ้อนในกล่องใหญ่ ใช้ค่ามุม "ชั้นใน" ของระบบ ไม่ตั้งค่าใหม่เอง */
  border-radius: var(--hub-radius-inner);
  border: 1px solid rgba(255, 255, 255, .16);
}
.only-item svg {
  flex: none;
  color: #c9f79a;
  margin-top: 2px;
}
.only-item h3 {
  font-family: 'Kanit', sans-serif;
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.only-item p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .95);
}

/* ภาษาไทยไม่มีช่องว่างระหว่างคำ เบราว์เซอร์ตัดกลางคำได้ ("สตรีท/ฟู้ด")
   ครอบคำที่ห้ามขาดไว้ด้วยคลาสนี้ */
.nobr { white-space: nowrap; }

/* ---------- FAQ (details/summary — ทำงานได้แม้ปิด JS) ---------- */
.faq-section {
  width: min(800px, calc(100% - 32px));
  margin: 0 auto 72px;
}
.faq-title {
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: clamp(26px, 3.4vw, 32px);
  color: var(--dark);
  margin: 0 0 32px;
}
.faq-item {
  background: #fff;
  border-radius: var(--hub-radius-inner);
  margin-bottom: 14px;
  border: 1px solid #eef6fc;
  box-shadow: 0 4px 12px rgba(6, 75, 142, .03);
}
.faq-item[open] { border-color: rgba(14, 165, 233, .28); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  min-height: 44px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
  color: var(--dark);
  cursor: pointer;
  border-radius: var(--hub-radius-inner);
  list-style: none;
}
/* ซ่อนสามเหลี่ยมเริ่มต้นของเบราว์เซอร์ (Safari ต้องใช้ ::-webkit-details-marker) */
.faq-question::-webkit-details-marker { display: none; }
.faq-question::marker { content: ''; }
.faq-question:hover { color: var(--blue); }
.faq-question svg {
  flex: none;
  transition: transform .25s ease;
}
.faq-item[open] .faq-question svg { transform: rotate(180deg); }

.faq-answer {
  padding: 0 22px 20px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 15px;
}
.faq-answer :last-child { margin-bottom: 0; }

/* ---------- แถบปิดท้าย (ใช้ .split-card ร่วมกับทั้งเว็บ) ---------- */
.hub-cta {
  max-width: 1100px;
  margin: 0 auto 72px;
}

/* ---------- โฟกัสคีย์บอร์ด ---------- */
.hub-toc-link:focus-visible,
.hub-crumb a:focus-visible,
.faq-question:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- มือถือ ---------- */
@media (max-width: 1024px) {
  .only-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .guide-grid { grid-template-columns: 1fr; gap: 18px; }
  .guide-card { padding: 26px; }
  .only-box { padding: 24px 20px; }
  .hub-hero { padding: 40px 16px 28px; }
  .hub-toc { gap: 8px; }
  .hub-toc-link { font-size: 14px; padding: 10px 14px; }
}

@media (max-width: 600px) {
  .only-grid { grid-template-columns: 1fr; }
}

/* จอแคบ: เรียงสารบัญเป็น 2 คอลัมน์เท่ากัน ไม่งั้นความยาวข้อความไม่เท่ากัน
   จะตกบรรทัดเป็น 2-1-1 ใบเดี่ยว ๆ ดูไม่เป็นชุด */
/* จอกลาง (561–1023px): กว้างไม่พอให้ 5 ปุ่มเรียงแถวเดียว แต่ปล่อยให้ flex
   ตัดเองจะได้ 4+1 ใบสุดท้ายลอยเดี่ยวกลางจอ — บังคับเป็น 3+2 เต็มแถวแทน
   (6 คอลัมน์: สามใบแรกกิน 2 ช่อง สองใบท้ายกิน 3 ช่อง = ลงตัวพอดีทั้งสองแถว) */
@media (min-width: 561px) and (max-width: 1023px) {
  .hub-toc {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    max-width: 760px;
  }
  .hub-toc-link { justify-content: center; text-align: center; }
  .hub-toc-link:nth-child(-n+3) { grid-column: span 2; }
  .hub-toc-link:nth-child(n+4)  { grid-column: span 3; }
}

@media (max-width: 560px) {
  .hub-toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hub-toc-link {
    justify-content: center;
    text-align: center;
  }
  /* 5 ปุ่มใน 2 คอลัมน์ = ใบที่ 5 เหลืออยู่คนเดียวครึ่งแถว
     ให้กินเต็มแถวไปเลย จะได้ดูตั้งใจ ไม่ใช่ตกหล่น */
  .hub-toc-link:last-child { grid-column: 1 / -1; }
}

/* ---------- เคารพการปิดแอนิเมชันของระบบ ---------- */
@media (prefers-reduced-motion: reduce) {
  .guide-card,
  .hub-toc-link,
  .faq-question svg {
    transition: none;
  }
  .guide-card:hover { transform: none; }
}
