/* =====================================================================
   home-formal.css — หน้าแรกแบบทางการ เรียบหรู (2026-12-02)
   ใช้คลาส hm-* ทั้งหมด เพื่อไม่ชนกับ legacy / site / accents.css
   โทนสี: น้ำเงินเข้ม + ทองหม่น + ขาว/งาช้าง
   ===================================================================== */
.hm {
  --hm-navy: #0b2545;
  --hm-navy-2: #13315c;
  --hm-ink: #1c2533;
  --hm-ink-2: #4a5566;
  --hm-muted: #7a8494;
  --hm-gold: #b8913a;
  --hm-gold-2: #d4b062;
  --hm-line: #e4e1d8;
  --hm-ivory: #f8f6f1;
  color: var(--hm-ink);
  font-family: Prompt, sans-serif;
}
.hm a { text-decoration: none; }
.hm h1, .hm h2, .hm h3 { font-family: Kanit, Prompt, sans-serif !important; letter-spacing: 0; }

/* ---------- hero ---------- */
.hm-hero {
  position: relative;
  min-height: clamp(460px, 72vh, 680px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--hm-navy);
  color: #fff;
}
.hm-hero-bg, .hm-hero-bg .carousel-inner, .hm-hero-bg .carousel-item { position: absolute; inset: 0; height: 100%; }
.hm-hero-bg .carousel-item img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hm-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 22, 44, .92) 0%, rgba(7, 22, 44, .78) 38%, rgba(7, 22, 44, .25) 75%, rgba(7, 22, 44, .15) 100%),
    linear-gradient(0deg, rgba(7, 22, 44, .55) 0%, rgba(7, 22, 44, 0) 35%);
  pointer-events: none;
}
.hm-hero-caption {
  position: absolute;
  right: 2rem;
  bottom: 5.5rem;
  z-index: 2;
  font-size: .85rem;
  color: rgba(255, 255, 255, .78);
  letter-spacing: .02em;
}
.hm-hero-dots { z-index: 3; margin-bottom: 4.5rem; justify-content: flex-end; margin-right: 2rem; }
.hm-hero-dots [data-bs-target] {
  width: 28px; height: 2px; margin: 0 4px; border: 0; padding: 0;
  background: rgba(255, 255, 255, .45); opacity: 1;
}
.hm-hero-dots .active { background: var(--hm-gold-2); }

.hm-hero-content { position: relative; z-index: 2; padding-top: 4rem; padding-bottom: 7rem; }
.hm-kicker {
  display: flex; align-items: center; gap: .75rem;
  color: var(--hm-gold-2);
  font-size: .9rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.hm-rule { display: inline-block; width: 40px; height: 2px; background: var(--hm-gold-2); }
.hm .hm-hero-title {
  max-width: 13em;
  margin: 0 0 1.1rem;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.25;
  font-weight: 500 !important;
  color: #fff !important;
}
.hm-nb { display: inline-block; }
.hm-hero-lead { max-width: 36em; text-wrap: pretty; font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.75; color: rgba(255, 255, 255, .85); margin: 0 0 2rem; }
.hm-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hm-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 1rem;
  transition: background-color .2s, color .2s, border-color .2s;
}
.hm-btn-gold { background: var(--hm-gold); color: #fff !important; border: 1px solid var(--hm-gold); }
.hm-btn-gold:hover { background: #a07c2f; border-color: #a07c2f; }
.hm-btn-ghost { color: #fff !important; border: 1px solid rgba(255, 255, 255, .55); }
.hm-btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }

/* ---------- stats (ซ้อนขอบล่าง hero) ---------- */
.hm-stats {
  position: relative; z-index: 4;
  display: grid; grid-template-columns: repeat(var(--n, 4), 1fr);
  margin: -3.5rem 0 0;
  background: #fff;
  border-top: 3px solid var(--hm-gold);
  box-shadow: 0 18px 40px rgba(11, 37, 69, .12);
}
.hm-stat { padding: 1.5rem 1.75rem; display: flex; flex-direction: column-reverse; gap: .2rem; }
.hm-stat + .hm-stat { border-left: 1px solid var(--hm-line); }
.hm-stat dd { margin: 0; font-family: Kanit, sans-serif; font-size: 2.3rem; font-weight: 500; line-height: 1.1; color: var(--hm-navy); }
.hm-stat dt { font-weight: 400; color: var(--hm-ink-2); font-size: .95rem; }

/* ---------- ประกาศ ---------- */
.hm-announce { padding-top: 2.5rem; }
.hm-announce-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hm-line); }
.hm-announce-list li {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .9rem 0; border-bottom: 1px solid var(--hm-line);
}
.hm-announce-tag {
  flex: 0 0 auto;
  font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  color: var(--hm-gold); border: 1px solid var(--hm-gold); padding: .1rem .55rem; border-radius: 2px;
}
.hm-announce-list a { flex: 1 1 auto; color: var(--hm-ink); font-weight: 500; }
.hm-announce-list a:hover { color: var(--hm-navy-2); text-decoration: underline; text-underline-offset: 3px; }
.hm-announce-meta { flex: 0 0 auto; color: var(--hm-muted); font-size: .88rem; }

/* ---------- ส่วนทั่วไป ---------- */
.hm-section { padding: 4.5rem 0; }
.hm-tint { background: var(--hm-ivory); border-top: 1px solid var(--hm-line); border-bottom: 1px solid var(--hm-line); }
.hm-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 2.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--hm-line);
}
.hm-eyebrow {
  color: var(--hm-gold); font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: .35rem;
}
.hm .hm-head h2 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 500 !important; color: var(--hm-navy) !important; }
.hm-more { flex: 0 0 auto; color: var(--hm-navy-2); font-weight: 500; white-space: nowrap; }
.hm-more i { transition: transform .2s; display: inline-block; }
.hm-more:hover { color: var(--hm-gold); }
.hm-more:hover i { transform: translateX(3px); }
.hm-meta { color: var(--hm-muted); font-size: .88rem; }
.hm-empty { color: var(--hm-muted); }

/* ---------- ข่าว ---------- */
.hm-feature-img, .hm-news-thumb { display: block; overflow: hidden; background: var(--hm-ivory); }
.hm-feature-img { aspect-ratio: 16 / 9; margin-bottom: 1.1rem; }
.hm-feature-img img, .hm-news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.hm-feature-img img.is-logo, .hm-news-thumb img.is-logo { object-fit: contain; padding: 18%; opacity: .5; }
.hm-feature:hover .hm-feature-img img:not(.is-logo), .hm-news-item:hover .hm-news-thumb img:not(.is-logo) { transform: scale(1.03); }
.hm-type { color: var(--hm-gold); font-weight: 600; margin-right: .4rem; }
.hm .hm-feature h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); line-height: 1.4; font-weight: 500 !important; margin: .4rem 0 .6rem; }
.hm-feature h3 a, .hm-news-item h3 a { color: var(--hm-ink); }
.hm-feature h3 a:hover, .hm-news-item h3 a:hover { color: var(--hm-navy-2); text-decoration: underline; text-underline-offset: 3px; }
.hm-feature p { color: var(--hm-ink-2); line-height: 1.75; margin: 0; }

.hm-news-list { display: flex; flex-direction: column; }
.hm-news-item { display: grid; grid-template-columns: 132px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--hm-line); align-items: start; }
.hm-news-item:first-child { padding-top: 0; }
.hm-news-thumb { aspect-ratio: 4 / 3; }
.hm .hm-news-item h3 {
  font-size: 1.02rem; line-height: 1.5; font-weight: 500 !important; margin: .25rem 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- กิจกรรม ---------- */
.hm-events { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--hm-line); border: 1px solid var(--hm-line); }
.hm-event { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.4rem 1.5rem; background: #fff; color: var(--hm-ink); transition: background-color .2s; }
.hm-event:hover { background: #fdfcf9; }
.hm-event-date {
  flex: 0 0 72px; text-align: center; padding: .55rem 0;
  background: var(--hm-navy); color: #fff;
}
.hm-event-date .d { display: block; font-family: Kanit, sans-serif; font-size: 1.9rem; line-height: 1.1; color: var(--hm-gold-2); }
.hm-event-date .m { display: block; font-size: .82rem; }
.hm .hm-event h3 { font-size: 1.05rem; line-height: 1.5; font-weight: 500 !important; margin: 0 0 .35rem; color: var(--hm-ink); }
.hm-event:hover h3 { color: var(--hm-navy-2); }
.hm-event .hm-meta i { color: var(--hm-gold); margin-right: .2rem; }

/* ---------- แผนที่ (ทับค่าใน home.css) ---------- */
#pcshs-province-map.hm-map {
  width: auto; margin: 0; padding: 5rem 0;
  background: var(--hm-navy);
  color: #fff;
}
.hm-eyebrow-light { color: var(--hm-gold-2); }
.hm .hm-map-title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 500 !important; color: #fff !important; margin: 0 0 1rem; }
.hm-map-text { color: rgba(255, 255, 255, .8); line-height: 1.8; margin-bottom: 1.5rem; }
.hm-map-points { list-style: none; padding: 0; margin: 0 0 2rem; }
.hm-map-points li { padding: .65rem 0; border-top: 1px solid rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .9); }
.hm-map-points li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.hm-map-points i { color: var(--hm-gold-2); margin-right: .5rem; }
#pcshs-province-map.hm-map .map-card { border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
#pcshs-province-map.hm-map .map-stage { min-height: 640px; border-radius: 0; background: #e9edf2; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 991.98px) {
  .hm-stats { grid-template-columns: repeat(2, 1fr); }
  .hm-stat:nth-child(3) { border-left: 0; }
  .hm-stat:nth-child(n+3) { border-top: 1px solid var(--hm-line); }
  .hm-events { grid-template-columns: 1fr; }
  .hm-hero-caption, .hm-hero-dots { display: none; }
}
@media (max-width: 575.98px) {
  .hm-hero { min-height: 520px; }
  .hm-hero-bg::after { background: linear-gradient(0deg, rgba(7, 22, 44, .95) 0%, rgba(7, 22, 44, .75) 55%, rgba(7, 22, 44, .45) 100%); }
  .hm-hero-content { padding-top: 3rem; padding-bottom: 5.5rem; }
  .hm-btn { width: 100%; justify-content: center; }
  .hm-stats { margin-top: -2.5rem; }
  .hm-stat { padding: 1.1rem 1rem; }
  .hm-stat dd { font-size: 1.8rem; }
  .hm-section { padding: 3rem 0; }
  .hm-head { flex-direction: column; align-items: flex-start; }
  .hm-announce-list li { flex-wrap: wrap; gap: .35rem .75rem; }
  .hm-announce-list a { flex-basis: 100%; order: 2; }
  .hm-announce-meta { order: 1; }
  .hm-news-item { grid-template-columns: 96px 1fr; }
  .hm-event { padding: 1.1rem; }
  #pcshs-province-map.hm-map { padding: 3.5rem 0; }
  #pcshs-province-map.hm-map .map-stage { min-height: 520px; }
}

