/* บริษัท วิส-แพลนนิ่ง จำกัด — สไตล์ชีตหลัก
   แนวคิด: หน้าเว็บจัดวางแบบ "แผ่นแบบวิศวกรรม" — กรอบแผ่นแบบ ตารางรายการแบบ (title block)
   เส้นบอกระยะ และหมุดแนวเสา ใช้สีแดงแบบหมึกตรวจแก้แบบ (red-line) เป็นสีเน้นสีเดียว */

:root {
  --paper: #edf1f3;      /* กระดาษไขสีเทาอมฟ้า */
  --sheet: #ffffff;      /* แผ่นแบบ */
  --ink: #12283a;        /* หมึกน้ำเงินเข้ม */
  --line: #2f6690;       /* เส้นแบบ */
  --muted: #566673;      /* ตัวหนังสือรอง */
  --rule: #c5d0d8;       /* เส้นตาราง */
  --red: #c8102e;        /* หมึกแดงตรวจแก้แบบ */

  --display: "Bai Jamjuree", "IBM Plex Sans Thai Looped", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --body: "IBM Plex Sans Thai Looped", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;

  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.5rem;
  --step-3: 1.95rem;
  --step-4: 2.5rem;
  --step-5: 3.2rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --wrap: 74rem;
}

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

html { font-size: 106.25%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--line); text-underline-offset: 0.2em; }
a:hover { color: var(--red); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(var(--step-3), 4.6vw, var(--step-5)); line-height: 1.3; }
h2 { font-size: clamp(var(--step-2), 3vw, var(--step-4)); }
h3 { font-size: var(--step-1); font-weight: 600; }

p { margin: 0 0 1em; max-width: 40em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.6em 1em; z-index: 50;
}
.skip:focus { left: 0; }

/* ---------- ส่วนหัว ---------- */
.site-head {
  background: var(--sheet);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 20;
}
.site-head__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.4rem;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 2.5rem; height: 2.5rem; flex: none; }
.brand__name {
  font-family: var(--display); font-weight: 700; font-size: var(--step-1);
  line-height: 1.2; display: block;
}
.brand__legal { font-size: var(--step--1); color: var(--muted); line-height: 1.3; display: block; }

.nav ul { list-style: none; display: flex; gap: 0.25rem; }
.nav a {
  display: block; padding: 0.55em 0.8em;
  color: var(--ink); text-decoration: none;
  font-family: var(--display); font-weight: 500; font-size: 0.97rem;
  border-bottom: 3px solid transparent;
}
.nav a:hover { border-bottom-color: var(--rule); color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--red); font-weight: 700; }

.nav-toggle {
  display: none;
  font: inherit; font-family: var(--display); font-weight: 600;
  background: var(--sheet); color: var(--ink);
  border: 2px solid var(--ink); padding: 0.35em 0.9em; cursor: pointer;
}

@media (max-width: 60rem) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--sheet); border-bottom: 2px solid var(--ink);
    padding: 0.5rem var(--gutter) 1rem;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; padding: 0.8em 0.6em; }
  .nav a[aria-current="page"] { border-bottom-color: var(--rule); border-left-color: var(--red); }
}

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-block;
  font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.4;
  padding: 0.8em 1.4em;
  border: 2px solid var(--red); background: var(--red); color: #fff;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #a30d26; border-color: #a30d26; color: #fff; }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: #fff; border-color: #fff; color: var(--ink); }
.btn--line { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

/* ---------- แบนเนอร์หน้าแรก: แผ่นแบบ ---------- */
.hero { padding: clamp(0.8rem, 2vw, 1.5rem) 0 0; }
.sheet-frame {
  position: relative;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  grid-template-rows: 1.6rem 1fr;
}
.sheet-frame__corner { background: var(--sheet); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.sheet-ref {
  display: flex; background: var(--sheet); color: var(--muted);
  font-family: var(--display); font-size: 0.72rem; font-weight: 600; line-height: 1;
}
.sheet-ref span { flex: 1; display: grid; place-items: center; }
.sheet-ref--x { border-bottom: 1px solid var(--ink); }
.sheet-ref--x span + span { border-left: 1px solid var(--ink); }
.sheet-ref--y { flex-direction: column; border-right: 1px solid var(--ink); }
.sheet-ref--y span + span { border-top: 1px solid var(--ink); }

.hero__stage {
  position: relative; overflow: hidden;
  min-height: min(76vh, 44rem);
  display: grid; align-items: end;
  background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    var(--ink);
}
.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hero__stage::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(95deg, rgba(18,40,58,.94) 0%, rgba(18,40,58,.82) 42%, rgba(18,40,58,.35) 100%);
}
.hero__body {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem; align-items: end;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}
.hero__copy { max-width: 40rem; }
.hero__lead { font-size: var(--step-1); line-height: 1.8; margin-top: 1.2rem; color: #e6edf2; }
.hero__credit { position: absolute; z-index: 1; top: 0.6rem; right: 0.8rem; font-size: 0.72rem; color: #c9d5dd; }
.hero__credit a { color: inherit; }

.title-block {
  background: var(--sheet); color: var(--ink);
  border: 2px solid var(--ink);
  width: 21rem; max-width: 100%;
  font-size: var(--step--1); line-height: 1.5;
  margin: 0;
}
.title-block div { display: grid; grid-template-columns: 7.2rem 1fr; }
.title-block div + div { border-top: 1px solid var(--ink); }
.title-block dt { padding: 0.5em 0.7em; color: var(--muted); border-right: 1px solid var(--ink); }
.title-block dd { margin: 0; padding: 0.5em 0.7em; font-family: var(--display); font-weight: 600; }

@media (max-width: 62rem) {
  .hero__body { grid-template-columns: 1fr; }
  .title-block { width: 100%; max-width: 26rem; }
}
@media (max-width: 40rem) {
  .sheet-frame { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .sheet-frame__corner, .sheet-ref { display: none; }
  .hero__stage { min-height: 0; }
  .hero__credit { position: static; padding: 0.4rem 1.5rem 0; display: block; }
}

/* ---------- แบนเนอร์หน้าใน ---------- */
.page-head { padding: clamp(0.8rem, 2vw, 1.5rem) 0 0; }
.page-head__frame {
  position: relative; overflow: hidden;
  border: 2px solid var(--ink); color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    var(--ink);
}
.page-head__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-head__frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(95deg, rgba(18,40,58,.95) 0%, rgba(18,40,58,.8) 55%, rgba(18,40,58,.45) 100%);
}
.page-head__body { position: relative; z-index: 1; padding: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3.5rem); }
.page-head__body p { font-size: var(--step-1); line-height: 1.8; margin-top: 1rem; color: #e6edf2; max-width: 36em; }
.page-head__credit { position: absolute; z-index: 1; right: 0.8rem; bottom: 0.5rem; font-size: 0.72rem; color: #c9d5dd; }
.page-head__credit a { color: inherit; }
.page-head--plain .page-head__frame::after { display: none; }

/* ---------- ส่วนเนื้อหา ---------- */
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band--sheet { background: var(--sheet); border-block: 1px solid var(--rule); }
.band--ink { background: var(--ink); color: #fff; }
.band--ink a { color: #fff; }
.band--ink p { color: #dbe4ea; }

.band__head { margin-bottom: clamp(1.8rem, 4vw, 3rem); max-width: 46rem; }
.band__head p { margin-top: 1rem; color: var(--muted); font-size: var(--step-1); line-height: 1.8; }
.band--ink .band__head p { color: #dbe4ea; }

/* เส้นบอกระยะ: ใช้ใต้หัวข้อส่วน */
.dim {
  display: block; width: 7rem; height: 0.9rem; margin-top: 0.9rem;
  background:
    linear-gradient(var(--red), var(--red)) 0 50% / 100% 2px no-repeat,
    linear-gradient(var(--red), var(--red)) 0.35rem 0 / 2px 100% no-repeat,
    linear-gradient(var(--red), var(--red)) calc(100% - 0.35rem) 0 / 2px 100% no-repeat;
}

.split {
  display: grid; gap: clamp(1.8rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.split--wide-text { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
@media (max-width: 54rem) { .split, .split--wide-text { grid-template-columns: 1fr; } }

/* ---------- ภาพถ่าย ---------- */
.photo { margin: 0; }
.photo__frame {
  aspect-ratio: 4 / 3; overflow: hidden;
  border: 2px solid var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 2rem 2rem,
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 2rem 2rem,
    var(--ink);
}
.photo--wide .photo__frame { aspect-ratio: 16 / 10; }
.photo--tall .photo__frame { aspect-ratio: 4 / 5; }
.photo__frame img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { font-size: 0.74rem; color: var(--muted); margin-top: 0.4rem; }
.photo figcaption a { color: inherit; }
.band--ink .photo__frame { border-color: #fff; }
.band--ink .photo figcaption { color: #b9c7d1; }
img.is-missing { visibility: hidden; }

/* ---------- บริการ ---------- */
.services { list-style: none; display: grid; gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 46rem) { .services { grid-template-columns: 1fr; } }
.service h3 { margin-top: 1.1rem; font-size: var(--step-2); font-weight: 700; }
.service p { margin-top: 0.6rem; color: var(--muted); }
.service .more { display: inline-block; margin-top: 0.8rem; font-family: var(--display); font-weight: 600; }

.service-detail { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--rule); }
.service-detail:first-of-type { border-top: 0; }
.service-detail h2 { font-size: clamp(var(--step-2), 2.6vw, var(--step-3)); }
.service-detail h3 { margin-top: 1.8rem; }
.service-detail p { margin-top: 1rem; }
.service-detail:nth-of-type(even) .split > .photo { order: -1; }
@media (max-width: 54rem) { .service-detail .split > .photo { order: -1; } }

.ticks { list-style: none; margin-top: 0.8rem; }
.ticks li { position: relative; padding-left: 1.6rem; margin-top: 0.4rem; max-width: 38em; }
.ticks li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.72em;
  width: 0.85rem; height: 2px; background: var(--red);
}

/* ---------- ขั้นตอนการทำงาน: หมุดแนวเสา ---------- */
.gridlines { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: gl; }
.gridlines li {
  counter-increment: gl; position: relative;
  padding: 4.6rem 1.2rem 0.5rem 1.4rem;
  border-left: 2px dashed rgba(255,255,255,.45);
}
.gridlines li::before {
  content: counter(gl);
  position: absolute; left: -1.5rem; top: 0;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); border: 2px solid #fff; color: #fff;
  font-family: var(--display); font-weight: 700; font-size: var(--step-1);
}
.gridlines h3 { color: #fff; }
.gridlines p { margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.75; }
.gridlines-wrap { padding-left: 1.5rem; }
@media (max-width: 62rem) {
  .gridlines { grid-template-columns: 1fr; }
  .gridlines li { padding: 0.4rem 0 2rem 2.6rem; }
  .gridlines li:last-child { padding-bottom: 0.4rem; }
}
.note { margin-top: 2rem; font-size: 0.95rem; color: var(--muted); }
.band--ink .note { color: #b9c7d1; }

/* ---------- หลักการทำงาน / กลุ่มผู้ใช้บริการ ---------- */
.deflist { margin: 0; }
.deflist div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 0.5rem 2rem; padding: 1.3rem 0; border-top: 1px solid var(--rule); }
.deflist div:last-child { border-bottom: 1px solid var(--rule); }
.deflist dt { font-family: var(--display); font-weight: 700; font-size: var(--step-1); line-height: 1.45; }
.deflist dd { margin: 0; color: var(--muted); max-width: 40em; }
@media (max-width: 46rem) { .deflist div { grid-template-columns: 1fr; } }

.audience { list-style: none; display: grid; gap: 1.6rem 2.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 46rem) { .audience { grid-template-columns: 1fr; } }
.audience li { border-left: 3px solid var(--line); padding-left: 1.1rem; }
.audience p { margin-top: 0.3rem; color: var(--muted); }

/* ---------- คำถามที่พบบ่อย ---------- */
.faq { max-width: 50rem; }
.faq details { border-top: 1px solid var(--ink); }
.faq details:last-child { border-bottom: 1px solid var(--ink); }
.faq summary {
  cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 600; font-size: var(--step-1); line-height: 1.5;
  padding: 1.05rem 2.5rem 1.05rem 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%);
  font-size: 1.6rem; font-weight: 500; color: var(--red); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 1.2rem; color: var(--muted); }

/* ---------- ช่องติดต่อท้ายหน้า ---------- */
.cta { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(1.8rem, 5vw, 4rem); align-items: center; }
@media (max-width: 54rem) { .cta { grid-template-columns: 1fr; } }
.cta__lines { list-style: none; font-family: var(--display); font-size: var(--step-1); line-height: 1.6; }
.cta__lines li { padding: 0.7rem 0; border-top: 1px solid rgba(255,255,255,.3); }
.cta__lines li:last-child { border-bottom: 1px solid rgba(255,255,255,.3); }
.cta__lines small { display: block; font-family: var(--body); font-size: var(--step--1); color: #b9c7d1; }
.cta__lines a { text-decoration: none; font-weight: 600; }
.cta__lines a:hover { text-decoration: underline; color: #fff; }

/* ---------- ตารางข้อมูลบริษัท ---------- */
.spec { width: 100%; border-collapse: collapse; border: 2px solid var(--ink); background: var(--sheet); }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 0.8em 1em; border-top: 1px solid var(--ink); }
.spec tr:first-child th, .spec tr:first-child td { border-top: 0; }
.spec th { width: 13rem; font-weight: 500; color: var(--muted); border-right: 1px solid var(--ink); font-family: var(--body); }
.spec td { font-family: var(--display); font-weight: 600; }
@media (max-width: 40rem) {
  .spec th, .spec td { display: block; width: auto; border-right: 0; }
  .spec td { border-top: 0; padding-top: 0; }
}

/* ---------- หน้าเนื้อหายาว (นโยบาย) ---------- */
.prose { max-width: 46rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin-top: 0.9rem; }
.prose ul { padding-left: 1.4rem; }
.prose li { margin-top: 0.35rem; max-width: 38em; }
.prose .meta { color: var(--muted); font-size: 0.95rem; }

/* ---------- หน้าติดต่อ ---------- */
.contact-list { margin: 0; }
.contact-list div { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.contact-list div:last-child { border-bottom: 1px solid var(--rule); }
.contact-list dt { color: var(--muted); font-size: var(--step--1); }
.contact-list dd { margin: 0.15rem 0 0; font-family: var(--display); font-weight: 600; font-size: var(--step-1); line-height: 1.6; }
.contact-list dd a { text-decoration: none; }
.contact-list dd a:hover { text-decoration: underline; }
.contact-list dd small { display: block; font-family: var(--body); font-weight: 400; font-size: var(--step--1); color: var(--muted); }

.form { background: var(--sheet); border: 2px solid var(--ink); padding: clamp(1.2rem, 3vw, 2rem); }
.form h2 { font-size: var(--step-2); }
.form > p { color: var(--muted); margin-top: 0.6rem; font-size: 0.95rem; }
.field { margin-top: 1.1rem; }
.field label { display: block; font-family: var(--display); font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.65em 0.8em; background: #fff;
  border: 1.5px solid var(--muted); border-radius: 0;
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--line); outline-offset: 0; border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 34rem) { .field-row { grid-template-columns: 1fr; } }
.form .btn { margin-top: 1.4rem; }
.form__hint { font-size: var(--step--1); color: var(--muted); margin-top: 0.8rem; }

.map { border: 2px solid var(--ink); background: var(--sheet); }
.map iframe { display: block; width: 100%; height: clamp(18rem, 45vw, 26rem); border: 0; }
.map p { padding: 0.7rem 1rem; font-size: 0.95rem; max-width: none; border-top: 1px solid var(--ink); }

/* ---------- ส่วนท้าย ---------- */
.site-foot { background: var(--ink); color: #dbe4ea; padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; font-size: 0.95rem; }
.site-foot a { color: #fff; }
.site-foot__grid { display: grid; gap: 2rem 3rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr); }
@media (max-width: 54rem) { .site-foot__grid { grid-template-columns: 1fr; } }
.site-foot h2 { font-size: var(--step-1); color: #fff; margin-bottom: 0.7rem; }
.site-foot ul { list-style: none; }
.site-foot li { margin-top: 0.3rem; }
.site-foot address { font-style: normal; }
.site-foot__base {
  margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.25);
  display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; justify-content: space-between;
  font-size: var(--step--1); color: #b9c7d1;
}
.site-foot__base p { max-width: none; margin: 0; }

/* ---------- การเคลื่อนไหว: เฉพาะตอนโหลดแบนเนอร์ครั้งเดียว ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy, .title-block { animation: rise 0.7s ease-out both; }
  .title-block { animation-delay: 0.25s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .site-head { position: static; }
  .nav, .nav-toggle, .btn-row, .map { display: none; }
}
