/* home.css — หน้าแรก (index2.php) แบบ 3 คอลัมน์: เมนูซ้าย · ส่วนกลาง · เมนูขวา
   ต่อยอดจาก site.css (ตัวแปรสี/ฟอนต์/.card/.btn/.hero/.act-grid/.videos/.badge-new ใช้ร่วมกัน) — โหลดผ่าน $extraCss */

.hm-wrap { max-width: 1400px; margin-inline: auto; padding-inline: 20px; }

/* ── แถบข้อความต้อนรับ (ข้อความนิ่ง อยู่กึ่งกลางแถบ) ── */
.hm-ticker { background: var(--navy); color: #fff; font-size: .92rem; border-bottom: 3px solid var(--gold); }
.hm-ticker .in { display: block; padding: 8px 0; text-align: center; line-height: 1.6; }

/* ── โครง 3 คอลัมน์ ─────────────────────────────────────────── */
.hm-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 20px; padding-block: 20px 28px; align-items: start; }
.hm-center { display: grid; gap: 20px; min-width: 0; }
.hm-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.hm-center .card > h2, .hm-center .act-head h2 { font-size: 1.35rem; }
.hm-center .hero { border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; contain: paint; width: 100%; max-width: 100%; min-width: 0; }
.hm-center .hero .track { width: 100%; }
.hm-center .hero .slide { flex: 0 0 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.hm-center .hero .slide img { width: 100%; max-width: 100%; height: auto; display: block; }

/* ── กล่องเมนูข้าง ──────────────────────────────────────────── */
.hm-box { background: var(--card); border: 1px solid #e9eef7; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hm-box > h2 { margin: 0; padding: 11px 14px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font: 600 .95rem/1.45 var(--font-head); }
.hm-menu { list-style: none; margin: 0; padding: 4px 0; }
.hm-menu li { margin: 0; }
.hm-menu a, .hm-menu .nolink, .hm-sub summary { display: flex; gap: 9px; align-items: flex-start; padding: 8px 14px; color: var(--ink); font-size: .88rem; line-height: 1.5; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.hm-menu li:last-child > a, .hm-menu li:last-child > .nolink { border-bottom: 0; }
.hm-menu a::before, .hm-sub summary::before, .hm-menu .nolink::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .6em; border-radius: 50%; background: var(--blue); }
.hm-menu .nolink::before { background: var(--line); }
.hm-menu a:hover { background: var(--sky); color: var(--blue); text-decoration: none; }
.hm-menu .more a { color: var(--blue); font-weight: 600; font-size: .82rem; }
.hm-menu .more a::before { display: none; }
.hm-sub summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--navy); }
.hm-sub summary::-webkit-details-marker { display: none; }
.hm-sub summary::before { background: var(--gold); }
.hm-sub summary:hover { background: var(--sky); }
.hm-sub ul { list-style: none; margin: 0; padding: 0 0 4px 22px; }
.hm-sub ul a { font-size: .84rem; padding: 6px 12px; }

/* ── ผู้บริหาร (เมนูขวา) ───────────────────────────────────── */
.hm-exec { padding: 16px 14px; text-align: center; }
.hm-exec img, .hm-exec .ph { display: block; width: 100%; max-width: 200px; aspect-ratio: 3 / 4; margin: 0 auto 10px; object-fit: cover; object-position: top center; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(18, 48, 107, .22); }
.hm-exec .ph { display: grid; place-items: center; background: var(--sky); color: var(--blue-2, var(--blue)); opacity: .8; }
.hm-exec p { margin: 0; }
.hm-exec .nm { font: 600 1rem/1.45 var(--font-head); color: var(--navy); }
.hm-exec .ps { color: var(--blue); font-weight: 600; font-size: .9rem; }
.hm-exec .tel { margin-top: 4px; font-size: .88rem; color: var(--muted); }
.hm-exec .tel a { color: inherit; }

/* ── ปุ่มสี (ปุ่มลิงก์หน่วยงาน/แบนเนอร์) ─────────────────────── */
.hm-btns { display: grid; gap: 10px; }
.hm-btn { display: grid; place-items: center; min-height: 64px; padding: 12px 14px; border-radius: 12px; color: #fff; text-align: center; font: 600 .95rem/1.45 var(--font-head); box-shadow: 0 3px 10px rgba(0, 0, 0, .14); transition: transform .2s, filter .2s; overflow-wrap: anywhere; }
.hm-btn:hover { transform: translateY(-2px); filter: brightness(1.08); text-decoration: none; color: #fff; }
.hm-btn.c1 { background: #c93d0a; } .hm-btn.c2 { background: #0077a3; } .hm-btn.c3 { background: #058a5a; } .hm-btn.c4 { background: #8a3fb0; }
.hm-imglink { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.hm-imglink img { display: block; width: 100%; height: auto; }
.hm-camp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hm-camp .hm-btn { min-height: 92px; font-size: 1.1rem; }

/* ── รายการเอกสาร/ข่าว (ส่วนกลาง) ──────────────────────────── */
.hm-intro { overflow-x: auto; }
.hm-intro img { max-width: 100%; height: auto; }
.hm-list { list-style: none; margin: 0; padding: 0; }
.hm-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.hm-list li:last-child { border-bottom: 0; }
.hm-list .ic-f { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); color: var(--c, #5b6b8c); }
.hm-list .tx { min-width: 0; flex: 1; line-height: 1.5; }
.hm-list .tx > a, .hm-list .tx > .nolink { color: var(--navy); font-weight: 500; font-size: .88rem; overflow-wrap: anywhere; }   /* เท่าข้อความการ์ดกิจกรรม (.88rem) */
.hm-list .tx > a:hover { color: var(--blue); }
.hm-list time { display: block; color: var(--muted); font-size: .78rem; }
.hm-doc .more { margin-top: 12px; text-align: center; }

/* ── หน่วยงานภายนอก ────────────────────────────────────────── */
.hm-cols { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 32px; }
.hm-cols li { break-inside: avoid; padding: 7px 0 7px 18px; position: relative; border-bottom: 1px dashed var(--line); }
.hm-cols li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.hm-cols a { color: var(--navy); overflow-wrap: anywhere; }
.hm-cols a:hover { color: var(--blue); }

/* ── วิดีโอ 2×2 (ส่วนกลางแคบกว่าหน้าเต็ม) ─────────────────── */
.hm-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-center .more { margin-top: 14px; }

/* ── จอเล็ก ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hm-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-center { order: 1; } .hm-left { order: 2; } .hm-right { order: 3; }
  .hm-left, .hm-right { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 800px) { .hm-camp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .hm-wrap { padding-inline: 14px; }
  .hm-camp, .hm-videos { grid-template-columns: 1fr; }
  .hm-left, .hm-right { grid-template-columns: 1fr; }
  .hm-center .card { padding: 16px 14px; }
}

/* ── เลือกภาษา (Google Translate) ───────────────────────────── */
.hm-tr { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; margin: -8px 0 -6px; }
.hm-tr-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--navy); font: 500 .88rem var(--font); cursor: pointer; box-shadow: var(--shadow); }
.hm-tr-btn:hover, .hm-tr-btn[aria-expanded="true"] { background: var(--sky); border-color: var(--blue); }
.hm-tr-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
#google_translate_element { min-height: 34px; }
#google_translate_element .goog-te-gadget { font-family: var(--font); font-size: .8rem; color: var(--muted); }
body { top: 0 !important; }                 /* Google Translate เลื่อน body ลงเมื่อมีแถบบน */
.skiptranslate > iframe.skiptranslate { display: none !important; }   /* ซ่อนแถบ Google ด้านบน */

/* สไลด์หัวหน้าแรก (banner-slice) — _page-hero.php + assets/js/slice.js */
.dt-slider { position: relative; overflow: hidden; background: var(--navy); line-height: 0; }
.dt-slider .sl-track { display: flex; align-items: flex-start; transition: transform .7s cubic-bezier(.4, 0, .2, 1), height .4s ease; }
.dt-slider .sl-slide { flex: 0 0 100%; display: block; }
.dt-slider .sl-slide img { display: block; width: 100%; height: auto; }
.dt-slider .sl-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(18,48,107,.55); color: #fff; font: 700 1.6rem/1 sans-serif; cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.dt-slider .sl-nav:hover { background: var(--blue, #1d4fb8); }
.dt-slider .sl-prev { left: 14px; } .dt-slider .sl-next { right: 14px; }
.dt-slider .sl-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; line-height: 0; }
.dt-slider .sl-dots button { width: 11px; height: 11px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; }
.dt-slider .sl-dots button[aria-current="true"] { background: var(--gold, #f0c040); border-color: var(--gold, #f0c040); }
@media (max-width: 680px) { .dt-slider .sl-nav { width: 34px; height: 34px; font-size: 1.3rem; } .dt-slider .sl-prev { left: 8px; } .dt-slider .sl-next { right: 8px; } }
@media (prefers-reduced-motion: reduce) { .dt-slider .sl-track { transition: none; } }

/* จุดบอกหน้าสไลด์: มองเห็นได้แม้ภาพพื้นขาว (เดิมขอบขาวกลืนกับภาพ) */
.hero .dots button, .dt-slider .sl-dots button { background: rgba(18, 48, 107, .45); box-shadow: 0 0 0 1px rgba(18, 48, 107, .55); }
.hero .dots button[aria-current="true"], .dt-slider .sl-dots button[aria-current="true"] { background: var(--gold, #f0c040); }
@media (prefers-reduced-motion: reduce) { .hero .track { transition: none !important; } }

/* ภาพ banner-slice ใบเดียว: แสดงเต็มสัดส่วนตามที่อัปโหลด (1920 × 600) ไม่ถูกตัดขอบล่าง */
.dt-hero .dt-banner.dt-full img { max-height: none; height: auto; object-fit: contain; }

/* ป้ายมุมบนซ้ายของการ์ดกิจกรรม: แสดงเฉพาะรายการใหม่ (≤ HM_NEW_DAYS วัน) เป็นสีแดง */
.act-grid .tag.is-new { background: var(--red, #d62839); }

/* กิจกรรม/โครงการหน้าแรก: 3 คอลัมน์ × 4 แถว (12 รายการ) · ชื่อเรื่องแสดงได้สูงสุด 3 บรรทัด เกินตัดด้วย … */
.hm-center .act-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hm-center .act-grid .tt { font-size: .88rem; line-height: 1.5; -webkit-line-clamp: 3; line-clamp: 3; }   /* ขนาดเท่าวันที่ (.88rem) */
@media (max-width: 1060px) { .hm-center .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .hm-center .act-grid { gap: 12px; } .hm-center .act-grid .tt { font-size: .85rem; } }
