/* ==========================================================================
   Smart Cyber Tech — pages.css
   คอมโพเนนต์เฉพาะหน้าลูก (about / services / process / work / pricing / faq /
   หน้ารายละเอียดบริการ และหน้านโยบาย)
   ใช้ design tokens ร่วมกับ base.css — โหลดต่อจาก style.css เสมอ
   ========================================================================== */

/* ---------- Page Hero (แบนเนอร์หัวหน้า) ---------- */
.phero {
  position: relative;
  display: flex; align-items: center;
  min-height: clamp(380px, 46vh, 520px);
  padding: calc(var(--header-h) + 48px) 0 56px;
  background: var(--grad-soft);
  overflow: hidden;
}
.phero__media { position: absolute; inset: 0; z-index: 0; }
.phero__media img { width: 100%; height: 100%; object-fit: cover; object-position: right center; }
/* ภาพถูกสร้างให้ครึ่งซ้ายโล่งอยู่แล้ว — เกรเดียนต์ขาวช่วยการันตีความคมของตัวอักษรอีกชั้น */
.phero__media::after {
  content: ""; position: absolute; inset: 0;
  /* หน้ารายละเอียดใช้ภาพสไลด์ 16:9 ที่เว้นว่างแค่หนึ่งในสาม เมื่อถูก crop เป็นแบนเนอร์เตี้ย
     ตัวแบบจึงเลื่อนเข้ามาทับพื้นที่ข้อความ ต้องเพิ่มความทึบของชั้นขาวให้ตัวอักษรอ่านออกเสมอ */
  background: linear-gradient(90deg,
    rgba(255,255,255,.99) 0%, rgba(255,255,255,.97) 40%,
    rgba(255,255,255,.78) 60%, rgba(255,255,255,.22) 84%, rgba(255,255,255,0) 100%);
}
.phero__content { position: relative; z-index: 1; max-width: 640px; }
.phero__title { font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.3rem); line-height: 1.28; letter-spacing: -.01em; margin: 14px 0 16px; }
.phero__desc { color: var(--ink-2); font-size: 1.06rem; max-width: 560px; }
.phero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- Breadcrumb ---------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  font-size: .9rem; font-weight: 500; color: var(--muted);
}
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "›"; color: #a9bcd8; font-weight: 400; }
.crumbs a { color: var(--blue); transition: color .25s var(--ease); }
.crumbs a:hover { color: var(--blue-700); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--muted); }

/* ---------- แถบตัวเลขสรุป ---------- */
.pstats { background: var(--paper); border-block: 1px solid var(--line-2); }
.pstats__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 40px 0; text-align: center;
}
.pstats__grid li b { display: block; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 700; color: var(--ink); font-family: var(--f-en); }
.pstats__grid li b { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pstats__grid li span { color: var(--muted); font-size: .95rem; }

/* ---------- สองคอลัมน์ ภาพ+ข้อความ (สลับฝั่งได้) ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
.duo--flip .duo__media { order: 2; }
.duo__media { position: relative; }
.duo__media img { width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-md); }
.duo__body .ticks { margin-top: 26px; }
.duo + .duo { margin-top: clamp(56px, 7vw, 96px); }

/* ---------- Figure / Infographic ---------- */
.figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-sm); border: 1px solid var(--line-2); }
.figure figcaption { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 14px; }
.figure--plain img { box-shadow: none; }

/* ---------- แกลเลอรีภาพ ---------- */
.gallery { display: grid; gap: 22px; }
.gallery--2 { grid-template-columns: repeat(2, 1fr); }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery .figure img { aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- ไทม์ไลน์แนวตั้ง ---------- */
.tline { position: relative; max-width: 860px; margin-inline: auto; padding-left: 30px; }
.tline::before {
  content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--sky) 100%);
  border-radius: 99px; opacity: .35;
}
.tline__item { position: relative; padding: 0 0 34px 26px; }
.tline__item:last-child { padding-bottom: 0; }
.tline__item::before {
  content: ""; position: absolute; left: -29px; top: 8px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--white);
  border: 4px solid var(--blue); box-shadow: 0 0 0 5px var(--blue-100);
}
.tline__year {
  display: inline-block; font-family: var(--f-en); font-weight: 700; color: var(--blue);
  background: var(--blue-100); border: 1px solid #cfe0ff; border-radius: var(--r-pill);
  font-size: .9rem; padding: 3px 14px; margin-bottom: 10px;
}
.tline__item h3 { margin-bottom: 6px; }
.tline__item p { color: var(--ink-2); }

/* ---------- การ์ดทีมงาน ---------- */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.tcard {
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tcard:hover { transform: translateY(-8px); box-shadow: var(--sh-md); }
.tcard__img { aspect-ratio: 4 / 5; overflow: hidden; }
.tcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tcard:hover .tcard__img img { transform: scale(1.05); }
.tcard__body { padding: 20px 22px 24px; }
.tcard__body b { display: block; color: var(--ink); font-size: 1.04rem; }
.tcard__body span { display: block; color: var(--blue); font-size: .9rem; font-weight: 600; margin-top: 2px; }
.tcard__body p { color: var(--muted); font-size: .92rem; margin-top: 10px; line-height: 1.7; }

/* ---------- ชิป / ป้ายเทคโนโลยี ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  font-family: var(--f-en); font-size: .88rem; font-weight: 600; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 7px 16px;
}

/* ---------- กล่องไฮไลต์ / การ์ดข้อมูล ---------- */
.hl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.hl-grid--4 { grid-template-columns: repeat(4, 1fr); }
.hl-grid--2 { grid-template-columns: repeat(2, 1fr); }
.hl {
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 28px 26px; box-shadow: var(--sh-xs);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.hl:hover { transform: translateY(-6px); box-shadow: var(--sh-md); border-color: #cfe0ff; }
.hl__ico {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px;
  background: var(--blue-100); color: var(--blue); margin-bottom: 18px;
}
.hl__ico .icon { width: 1.5em; height: 1.5em; }
.hl h3 { font-size: 1.08rem; margin-bottom: 8px; }
.hl p { color: var(--ink-2); font-size: .97rem; }
.hl ul { margin-top: 12px; display: grid; gap: 7px; }
.hl ul li { position: relative; padding-left: 22px; font-size: .94rem; color: var(--ink-2); }
.hl ul li::before { content: "✓"; position: absolute; left: 0; color: var(--blue); font-weight: 700; }

/* ---------- ตารางเปรียบเทียบ ---------- */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.cmp { width: 100%; min-width: 760px; border-collapse: collapse; background: var(--white); }
.cmp th, .cmp td { padding: 16px 20px; text-align: center; border-bottom: 1px solid var(--line-2); font-size: .97rem; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp thead th { background: var(--paper); color: var(--ink); font-size: 1rem; }
.cmp thead th.is-featured { background: var(--blue); color: #fff; }
.cmp tbody td.is-featured { background: #f4f8ff; }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp .ok { color: var(--blue); font-weight: 700; }
.cmp .no { color: #b9c6da; }
.cmp td small { display: block; color: var(--muted); }

/* ---------- แถบ CTA ย่อ ---------- */
.band {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  background: var(--deep); color: #fff;
  padding: clamp(40px, 5vw, 64px) clamp(28px, 5vw, 72px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(720px 300px at 85% 20%, rgba(0, 168, 240, .28), transparent 65%),
              radial-gradient(560px 300px at 8% 90%, rgba(18, 86, 224, .3), transparent 60%);
}
.band > * { position: relative; }
.band h2 { color: #fff; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); max-width: 640px; }
.band p { color: #b9cbe6; margin-top: 8px; max-width: 560px; }

/* ---------- สารบัญบริการ (ลิงก์ไปหน้ารายละเอียด) ---------- */
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.dir {
  display: flex; align-items: center; gap: 16px;
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 18px 22px; box-shadow: var(--sh-xs); font-weight: 600; color: var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.dir:hover { transform: translateY(-4px); border-color: #cfe0ff; box-shadow: var(--sh-sm); color: var(--blue); }
.dir__ico {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  border-radius: 14px; background: var(--blue-100); color: var(--blue);
}
.dir .icon { width: 1.35em; height: 1.35em; }
.dir > .icon:last-child { margin-left: auto; color: #a9bcd8; width: 1em; height: 1em; }

/* ---------- เนื้อหาแบบเอกสาร (หน้านโยบาย) ---------- */
.prose { max-width: 860px; margin-inline: auto; }
.prose h2 { font-size: 1.45rem; margin: 44px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.12rem; margin: 28px 0 10px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 16px 24px; display: grid; gap: 7px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose ul li::marker, .prose ol li::marker { color: var(--blue); }
.prose a { color: var(--blue); text-decoration: underline; }
.prose .note {
  background: var(--paper); border-left: 4px solid var(--blue);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 20px; margin: 20px 0;
  color: var(--ink-2); font-size: .97rem;
}
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: .95rem; }
.prose table th, .prose table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.prose table thead th { background: var(--paper); color: var(--ink); }
.prose .updated { color: var(--muted); font-size: .92rem; margin-bottom: 28px; }

/* ---------- FAQ หมวดหมู่ ---------- */
.faq-cats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

/* ---------- พื้นหลังสลับ ---------- */
.section--paper { background: var(--paper); }
.section--soft { background: var(--grad-soft); }

/* ---------- ขั้นตอนแบบตัวเลข (ย่อ) ---------- */
.mini-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: mstep; }
.mini-step {
  position: relative; background: var(--white); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 26px 24px; box-shadow: var(--sh-xs); counter-increment: mstep;
}
.mini-step::before {
  content: counter(mstep, decimal-leading-zero);
  font-family: var(--f-en); font-weight: 700; font-size: 1rem; color: var(--blue);
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: var(--blue-100); border-radius: 50%; margin-bottom: 14px;
}
.mini-step h3 { font-size: 1.04rem; margin-bottom: 6px; }
.mini-step p { font-size: .94rem; color: var(--ink-2); }

/* ---------- การ์ดข่าว / บทความ ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-xs);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.post:hover { transform: translateY(-8px); box-shadow: var(--sh-md); border-color: #cfe0ff; }
.post__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper); }
/* <picture> เป็น inline โดยดีฟอลต์ ทำให้รูปไม่ยืดเต็มกรอบการ์ดแนวนอน จึงบังคับเป็นบล็อกเต็มพื้นที่ */
.post__img picture { display: block; width: 100%; height: 100%; }
.post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post:hover .post__img img { transform: scale(1.05); }
.post__cat {
  position: absolute; left: 14px; top: 14px; z-index: 1;
  font-family: var(--f-en); font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; background: rgba(18, 86, 224, .92); backdrop-filter: blur(4px);
  padding: 5px 13px; border-radius: var(--r-pill);
}
.post__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 26px; }
.post__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: .84rem; color: var(--muted); margin-bottom: 10px;
}
.post__meta .icon { width: 1em; height: 1em; }
.post__meta span { display: inline-flex; align-items: center; gap: 5px; }
.post h3 { font-size: 1.1rem; line-height: 1.45; margin-bottom: 10px; }
.post h3 a { transition: color .25s var(--ease); }
.post:hover h3 a { color: var(--blue); }
.post p { color: var(--ink-2); font-size: .95rem; flex: 1; }
.post__more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-weight: 600; font-size: .93rem; color: var(--blue);
  transition: gap .3s var(--ease);
}
.post:hover .post__more { gap: 13px; }
.post__more .icon { width: 1em; height: 1em; }

/* การ์ดเด่นชิ้นแรก */
.post--feature { grid-column: span 2; flex-direction: row; }
.post--feature .post__img { aspect-ratio: auto; flex: 0 0 46%; }
.post--feature .post__body { padding: 30px 32px; }
.post--feature h3 { font-size: 1.35rem; }

/* ---------- บทความ: เนื้อหาแบบมีรูปประกอบ ---------- */
.article { max-width: 820px; margin-inline: auto; }
.article > p { margin-bottom: 18px; }
.article h2 { font-size: 1.45rem; margin: 44px 0 14px; }
.article h3 { font-size: 1.1rem; margin: 26px 0 8px; }
.article figure { margin: 30px 0; }
.article figure img { width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.article figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 12px; }
.article ul, .article ol { margin: 0 0 18px 24px; display: grid; gap: 8px; }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li::marker { color: var(--blue); }
.article a { color: var(--blue); text-decoration: underline; }
.article__lead { font-size: 1.12rem; color: var(--ink); line-height: 1.85; margin-bottom: 26px; }
.article__meta {
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  padding: 16px 0 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .92rem;
}
.article__meta span { display: inline-flex; align-items: center; gap: 7px; }
.article__meta .icon { width: 1.05em; height: 1.05em; color: var(--blue); }
.article__source {
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 18px 22px; margin: 32px 0; font-size: .95rem; color: var(--ink-2);
}
.article__source b { display: block; color: var(--ink); margin-bottom: 4px; }
.article__key {
  background: var(--grad-soft); border: 1px solid #d8e8ff; border-radius: var(--r-lg);
  padding: 26px 28px; margin: 34px 0;
}
.article__key h3 { margin: 0 0 14px; font-size: 1.08rem; }
.article__key ul { list-style: none; margin: 0; display: grid; gap: 11px; }
.article__key li { position: relative; padding-left: 30px; color: var(--ink-2); }
.article__key li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 21px; height: 21px; display: grid; place-items: center;
  background: var(--blue); color: #fff; border-radius: 50%; font-size: .72rem; font-weight: 700;
}
.article__share { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.article__share b { color: var(--ink); font-size: .95rem; }

/* ---------- ตำแหน่งงาน ---------- */
.jobs { display: grid; gap: 20px; }
.job {
  display: grid; grid-template-columns: 1fr auto; gap: 20px 28px; align-items: center;
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 26px 30px; box-shadow: var(--sh-xs);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.job:hover { transform: translateY(-5px); box-shadow: var(--sh-md); border-color: #cfe0ff; }
.job h3 { font-size: 1.18rem; margin-bottom: 8px; }
.job p { color: var(--ink-2); font-size: .96rem; margin-bottom: 14px; }
.job__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.job__tags li {
  font-size: .84rem; font-weight: 600; color: var(--blue);
  background: var(--blue-100); border: 1px solid #cfe0ff;
  border-radius: var(--r-pill); padding: 4px 13px;
}
.job__tags li.is-plain { color: var(--muted); background: var(--paper); border-color: var(--line); }

/* ---------- สวัสดิการ ---------- */
.perk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.perk {
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-xs);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.perk:hover { transform: translateY(-6px); box-shadow: var(--sh-md); }
.perk__img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper); }
.perk__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.perk:hover .perk__img img { transform: scale(1.06); }
.perk__body { padding: 20px 22px 24px; }
.perk h3 { font-size: 1.04rem; margin-bottom: 7px; }
.perk p { color: var(--ink-2); font-size: .93rem; }

/* ---------- การ์ดที่ใช้รูปแทนไอคอน ---------- */
.hl--photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.hl--photo .hl__img { display: block; overflow: hidden; background: var(--paper); }
.hl--photo .hl__pic { display: block; }
.hl--photo .hl__img img { width: 100%; height: 190px; object-fit: cover; transition: transform .6s var(--ease); }
.hl--photo:hover .hl__img img { transform: scale(1.05); }
.hl--photo .hl__text { padding: 24px 26px 28px; flex: 1; }
.hl--photo .hl__text h3 { margin-bottom: 8px; }

/* การ์ดรูปที่เป็นลิงก์ทั้งใบ (หมวดข่าว/ความรู้/ร่วมงาน บนหน้าแรก) */
a.hl--photo { color: inherit; text-decoration: none; }
a.hl--photo .hl__text h3 { transition: color .3s var(--ease); }
a.hl--photo:hover .hl__text h3 { color: var(--blue); }
a.hl--photo .link-arrow { display: inline-flex; }

/* ---------- แถบตัวกรอง/ค้นหาในหน้า listing ---------- */
.listing-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  margin-bottom: 36px;
}
.listing-bar__count { color: var(--muted); font-size: .95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .team-grid, .hl-grid--4, .mini-steps { grid-template-columns: repeat(2, 1fr); }
  .hl-grid, .dir-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery--3 { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post--feature { grid-column: span 2; }
  .perk-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .post--feature { flex-direction: column; }
  .post--feature .post__img { flex: none; aspect-ratio: 16 / 10; }
  .post--feature .post__body { padding: 22px 24px 26px; }
  .post--feature h3 { font-size: 1.15rem; }
  .job { grid-template-columns: 1fr; }
  .job .btn { justify-self: start; }
}
@media (max-width: 860px) {
  .duo, .duo--flip { grid-template-columns: 1fr; }
  .duo--flip .duo__media { order: 0; }
  .pstats__grid { grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 30px 0; }
  .phero { min-height: 340px; padding-top: calc(var(--header-h) + 36px); }
  .phero__media::after {
    background: linear-gradient(90deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.9) 55%, rgba(255,255,255,.62) 100%);
  }
}
@media (max-width: 640px) {
  .hl-grid, .hl-grid--2, .dir-grid, .gallery--2, .gallery--3,
  .team-grid, .hl-grid--4, .mini-steps,
  .post-grid, .perk-grid { grid-template-columns: 1fr; }
  .post--feature { grid-column: span 1; }
  .band { text-align: left; }
  .cmp th, .cmp td { padding: 12px 14px; }
}
