/* =========================================================
   cms.css — สไตล์ที่มีเฉพาะ sh.cms (ส่วนที่ static site D:\Project\sh ไม่มี เพราะเกิดจากข้อมูลหลังบ้าน)
   ไฟล์ style.css เป็นสำเนาของเว็บ sh (convert_sh.py คัดลอกทับได้) — กฎใหม่ให้เขียนที่ไฟล์นี้เท่านั้น
   ========================================================= */

/* ---------- สไลด์ hero (หน้าหลัก > รูปสไลด์หน้าแรก) ---------- */

/* หลังบ้านกรอก URL + URL Target → รูปทั้งใบเป็นลิงก์ (<a class="hero__link"> ครอบ <picture>) */
.hero__link {
  position: absolute;
  inset: 0;
  display: block;
}
.hero__link:focus-visible {
  outline: 3px solid var(--blue-700);
  outline-offset: -6px;
}
/* กล่องข้อความกว้างเท่า container และอยู่ชั้นบนรูป — ให้คลิกทะลุไปถึงลิงก์ของรูป ยกเว้นปุ่มในกล่อง */
.hero__slide--link .hero__content { pointer-events: none; }
.hero__slide--link .hero__content a { pointer-events: auto; }
/* ชั้นไล่สีขาวบนมือถือ (.hero__slide::before) ต้องไม่บังการคลิก */
.hero__slide::before { pointer-events: none; }

/* มีรูปมือถือของตัวเอง (หลังบ้านตัดสัดส่วน 750×1040 มาแล้ว) → จัดกลาง ไม่ต้องเลื่อนไปขวา 72% แบบรูปจอใหญ่ */
@media (max-width: 768px) {
  .hero__media--has-mobile img { object-position: 50% 50%; }
}

/* หัวข้อใหญ่: [[คำ]] จากหลังบ้าน = คำเน้นสี (ไม่เอียง) */
.hero__title em {
  font-style: normal;
  color: var(--blue-700);
}

/* ปุ่มที่หลังบ้านไม่ได้กรอก URL (ไม่มี href) — คงหน้าตาปุ่มแต่ไม่ทำเหมือนกดได้ */
.hero__actions a.btn:not([href]) { cursor: default; }

/* ---------- หน้า Intro (หน้าหลัก > หน้า Intro Page · /th/intro-page) ----------
   หน้าคั่นก่อนเข้าหน้าแรก ไม่มี header/footer · สีพื้นหลังและสีปุ่มมาจากหลังบ้านเป็น inline style
   ที่นี่คุมการจัดวาง + ค่าเริ่มต้น (โครงจาก egth.cms .intro-* · สี/ฟอนต์ตามเว็บ Shintaeki) */
.intro-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  font-family: var(--font-th);
  color: var(--text);
}
.intro-card {
  width: 100%;
  max-width: 960px;
  text-align: center;
}
.intro-logo {
  display: inline-block;             /* พื้นที่คลิกพอดีโลโก้ (จัดกลางด้วย text-align ของการ์ด) */
  margin: 0 0 26px;
}
.intro-logo img {
  display: block;
  width: 240px;
  max-width: 62vw;
  height: auto;
}
.intro-image {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  margin: 0 auto 30px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(6, 20, 59, .18);
}
.intro-title {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy-950);
}
.intro-info {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: left;     /* เท่าหน้าจอแก้ไข CKEditor (ชิดซ้าย) — ย่อหน้าที่จัดกึ่งกลางในหลังบ้านมี style text-align ของตัวเองอยู่แล้ว */
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.intro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 28px;
  border: 1.5px solid var(--navy-950);
  border-radius: 999px;
  background: var(--navy-950);
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s var(--ease);
}
.intro-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(6, 20, 59, .18); filter: brightness(1.06); }
.intro-btn:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 3px; }
@media (max-width: 560px) {
  .intro-actions { flex-direction: column; align-items: stretch; }
}

/* ---------- เนื้อหาจากตัวแก้ไข CKEditor ของหลังบ้าน (.cms-content) ----------
   ค่าต้องตรงกับธีม .ck-editor__editable.ck-content ใน admin.sh core_admin/Areas/Admin/Views/Shared/_AdminLayout.cshtml
   (หน้าจอแก้ไข = หน้าเว็บจริง) · ห้ามใช้ clamp()/vw ในบล็อกนี้ — ความกว้างพื้นที่พิมพ์กับหน้าเว็บไม่เท่ากัน */
.cms-content {
  font-size: 17px;
  line-height: 1.7;
  color: #2b3a55;
}
.cms-content::after { content: ""; display: table; clear: both; }
.cms-content p { margin: 0 0 10px; }
.cms-content h2, .cms-content h3, .cms-content h4, .cms-content h5 { color: #004b9c; line-height: 1.3; margin: 0 0 12px; }
.cms-content h2 { font-size: 28px; font-weight: 700; }
.cms-content h3 { font-size: 23px; font-weight: 700; }
.cms-content h4 { font-size: 19px; font-weight: 600; }
.cms-content h5 { font-size: 17px; font-weight: 600; }
.cms-content strong, .cms-content b { font-weight: 700; color: inherit; }
.cms-content a { color: #0a5cb8; text-decoration: underline; text-underline-offset: 2px; }
.cms-content ul, .cms-content ol { list-style: revert; padding-left: 1.5em; margin: 0 0 10px; text-align: left; }
.cms-content li { margin-bottom: .5em; }
.cms-content li::marker { color: #0a5cb8; }
.cms-content blockquote { padding: 1em 1.5em; margin: 0 0 12px; border-left: 4px solid #0a5cb8; background: #f9f9f9; border-radius: 0 8px 8px 0; color: #4a4a4a; font-style: italic; text-align: left; }
.cms-content img { max-width: 100%; height: auto; border-radius: 16px; }
.cms-content figcaption { font-size: 15px; color: #656565; text-align: center; }
.cms-content table { width: 100%; border: 0; border-collapse: collapse; margin: 0 0 12px; }
.cms-content th, .cms-content td { border: 1px solid #ececec; padding: .7em 1em; }
.cms-content th { background: #0a5cb8; color: #fff; font-weight: 600; border-color: #0a5cb8; text-align: left; }
.cms-content tbody tr:nth-child(even) td { background: #f9f9f9; }
.cms-content figure.table { margin: 0 0 12px; overflow-x: auto; }
.cms-content figure.image { display: table; clear: both; text-align: center; margin: 0 auto 12px; }
.cms-content figure.image img { display: block; margin: 0 auto; max-width: 100%; min-width: 100%; height: auto; }
.cms-content .image-style-align-left { float: left; margin-right: 1.5em; }
.cms-content .image-style-align-right { float: right; margin-left: 1.5em; }
.cms-content .custom-block-indent-a { text-indent: 40px; }
.cms-content .custom-block-indent-b { text-indent: 80px; }
.cms-content .custom-block-indent-c { text-indent: 120px; }
@media (max-width: 600px) {
  .cms-content .image-style-align-left, .cms-content .image-style-align-right { float: none; margin-left: auto; margin-right: auto; }
}

/* ===== ป๊อปอัพประชาสัมพันธ์ (Views/Shared/_PopUp.cshtml · หลังบ้าน: หน้าเว็บไซต์ > หน้า Pop-Up) =====
   ลอกจาก egth.cms style.css ส่วน .popup-* แล้วเปลี่ยนสีเขียว ENERGROW → navy/น้ำเงินของเว็บ sh
   รูปสัดส่วน 1530 × 665 ตามที่ฟอร์มหลังบ้านกำหนด · z-index สูงกว่า header (100) / lightbox (300) ของ style.css */
.popup-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.popup-modal[hidden] { display: none; }
.popup-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 20, 59, .62);
  backdrop-filter: blur(2px);
}
/* กว้างไม่เกินที่ความสูงจอรับได้ (เว้นบนล่างรวม 48px) — จอเตี้ยแล้วปุ่มปิดไม่หลุดขอบบน (egth แก้ 24 ก.ย. 2569) */
.popup-dialog {
  position: relative;
  width: min(960px, 100%, (100vh - 48px) * 1530 / 665);
  width: min(960px, 100%, (100dvh - 48px) * 1530 / 665);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 70px rgba(6, 20, 59, .4);
  animation: popup-in .35s var(--ease, ease);
}
@keyframes popup-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.popup-track { position: relative; aspect-ratio: 1530 / 665; background: var(--sky-50, #eef5fc); }
.popup-slide {
  position: absolute; inset: 0; margin: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
}
.popup-slide.active { opacity: 1; pointer-events: auto; }
.popup-slide a { display: block; height: 100%; }
.popup-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.popup-close,
.popup-arrow {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer;
  color: var(--navy-950, #06143b);
  transition: background .2s, color .2s;
}
.popup-close {
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 14px rgba(6, 20, 59, .22);
}
.popup-close svg { width: 14px; height: 14px; }
.popup-arrow {
  top: 50%; z-index: 2;
  width: 42px; height: 42px; margin-top: -21px;
  background: rgba(255, 255, 255, .85);
}
.popup-arrow svg { width: 10px; height: 16px; }
.popup-close:hover, .popup-arrow:hover { background: var(--navy-950, #06143b); color: #fff; }
.popup-close:focus-visible, .popup-arrow:focus-visible, .popup-dot:focus-visible, .popup-slide a:focus-visible {
  outline: 3px solid #8fc3f5; outline-offset: 2px;
}
.popup-slide a:focus-visible { outline-offset: -4px; }
.popup-prev { left: 12px; }
.popup-next { right: 12px; }
.popup-dots {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2;
  display: flex; gap: 8px; justify-content: center;
  pointer-events: none;   /* แถบกว้างเต็มกรอบ — ไม่บังปุ่มลูกศร/ลิงก์รูป รับคลิกเฉพาะตัวจุด */
}
.popup-dot { pointer-events: auto; }
.popup-dot {
  width: 10px; height: 10px; padding: 0;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 1px rgba(6, 20, 59, .18);
  cursor: pointer;
  transition: width .2s, background .2s;
}
.popup-dot.active { width: 26px; background: var(--blue-700, #004b9c); }
body.popup-open { overflow: hidden; }
@media (max-width: 600px) {
  .popup-close { width: 34px; height: 34px; top: 8px; right: 8px; }
  /* จอเล็ก: ลูกศร + จุดย้ายลงแถบขาวใต้รูป ไม่ทับข้อความบนรูป (ปัดนิ้วซ้าย-ขวาเลื่อนรูปได้ — cms.js) */
  .popup-dialog--multi { padding-bottom: 48px; }
  .popup-dialog--multi .popup-arrow {
    top: auto; bottom: 7px; margin-top: 0;
    width: 34px; height: 34px;
    background: var(--sky-50, #eef5fc);
  }
  .popup-dialog--multi .popup-prev { left: 10px; }
  .popup-dialog--multi .popup-next { right: 10px; }
  .popup-dialog--multi .popup-dots { bottom: 19px; }
  .popup-dialog--multi .popup-dot { background: rgba(6, 20, 59, .22); box-shadow: none; }
  .popup-dialog--multi .popup-dot.active { background: var(--blue-700, #004b9c); }
}
@media (prefers-reduced-motion: reduce) {
  .popup-dialog { animation: none; }
  .popup-slide { transition: none; }
}

/* ===== หน้าเอกสารกฎหมายจากฐาน (Views/Site/_LegalDoc.cshtml · หลังบ้าน: Privacy Policy / Terms of Use) ===== */
.legal--solo { grid-template-columns: minmax(0, 1fr); }
.legal .prose img { max-width: 100%; height: auto; border-radius: 12px; }
.legal .prose figure { margin: 0 0 18px; }
.legal .prose figure.table { overflow-x: auto; }
.legal .prose blockquote { margin: 0 0 18px; padding: 12px 20px; border-left: 4px solid #2c8fd8; background: #f2f8fd; }
.footer__social a svg[style] { width: 15px; height: 15px; }

/* ===== หน้าติดต่อเรา ===== */
.cform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot กันสแปม — คนมองไม่เห็น */
.cmap__map + .cmap__map { margin-top: 24px; }

/* ===== รายการข่าว: ไม่มีข่าว + แบ่งหน้า (หน้า /th/news) ===== */
.news-empty { margin: 34px 0 0; padding: 48px 24px; text-align: center; color: #5b6b86; background: #f4f7fb; border-radius: 16px; }
.news-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 38px; }
.news-pager__link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #d8e5f4; color: #0b1a3d; background: #fff; font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.news-pager__link:hover { border-color: #004b9c; color: #004b9c; }
.news-pager__link.is-current { background: #004b9c; border-color: #004b9c; color: #fff; }

/* ===== วันที่ข่าว: การ์ด + หน้าบทความ ===== */
.ncard__date { display: block; margin-top: 6px; font-size: 14px; line-height: 1.5; color: #5b6b86; }
.news-date { margin: 12px 0 0; font-size: 16px; color: #3a5877; }

/* ===== ภาษาอังกฤษ: ข้อความยาวกว่าไทย ไม่ให้ล้นจอ ===== */
html[lang="en"] .svc-card__title span { white-space: normal; }
@media (max-width: 1400px) { html[lang="en"] .main-nav__list { gap: 12px; margin-right: 18px; } }

/* [SH] รูปแผนภาพและไอคอนจาก File Manager (แทน SVG เดิม) — ขนาดเท่า SVG เดิม */
.hp-how__diagram img { display: block; width: 100%; height: auto; }
.reason__icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.svc-card__icon img, .cinfo__icon img { width: 32px; height: 32px; object-fit: contain; }
.cinfo__icon--fb img { width: 28px; height: 28px; }
.ptype__icon img { width: 38px; height: 38px; object-fit: contain; }
.hr-stat__icon img { width: 26px; height: 26px; object-fit: contain; }
/* ตอนชี้ พื้นวงกลมเป็นสีเข้ม — ไอคอนต้องเปลี่ยนเป็นสีขาวเหมือน SVG เดิม */
.svc-card:hover .svc-card__icon img, .ptype:hover .ptype__icon img { filter: brightness(0) invert(1); }
