/* riskhome.css — หน้าแรก แผนบริหารความเสี่ยง (views/site/index.php) ; ใช้ได้ทั้ง GUI template 1 (Bootstrap 4) และ 2 (BKK) — โทนเดียวกับ riskreg.css */
.rh {
  --rh-ink: #17251C; --rh-soft: #4B5B4F; --rh-faint: #7C877D; --rh-rule: #DCE3DA; --rh-band: #F2F5F0; --rh-card: #fff;
  --rh-green: #00744B; --rh-green-deep: #0E3B27;
  color: var(--rh-ink); margin: 8px 0 48px;
}
.rh *, .rh *::before, .rh *::after { box-sizing: border-box; }
.rh a { color: inherit; text-decoration: none; }
.rh [hidden] { display: none !important; }

/* ส่วนหัว */
.rh-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; align-items: center; padding: 32px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2F8F5B 0%, #00744B 40%, #0E3B27 100%); box-shadow: 0 14px 36px rgba(14, 59, 39, .2); }
.rh-eyebrow { font-size: 13px; letter-spacing: .04em; opacity: .85; }
.rh-hero h1 { margin: 6px 0 10px; font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; line-height: 1.2; color: #fff; }
.rh-hero p { margin: 0 0 20px; max-width: 640px; font-size: 15.5px; line-height: 1.7; opacity: .92; }
.rh-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.rh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .4);
  color: #fff !important; font-weight: 600; font-size: 15px; transition: background .15s; }
.rh-btn:hover { background: rgba(255, 255, 255, .12); }
.rh-btn-primary { background: #fff; color: var(--rh-green-deep) !important; border-color: #fff; }
.rh-btn-primary:hover { background: #E6F1ED; }
.rh-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.rh-stats > div { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
.rh-stats dt { font-size: 13px; font-weight: 500; opacity: .85; }
.rh-stats dd { margin: 4px 0 0; font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.rh-stats dd small { font-size: .6em; opacity: .7; }
.rh-stats .is-warn { background: rgba(232, 89, 12, .3); border-color: rgba(255, 190, 150, .45); }

/* หัวข้อส่วน */
.rh-sec { margin-top: 36px; }
.rh-h { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 21px; font-weight: 700; color: var(--rh-green-deep); }
.rh-h span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 30px; padding: 0 8px; border-radius: 8px;
  background: var(--rh-green-deep); color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ระบบงาน */
.rh-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rh-mod { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border: 1px solid var(--rh-rule); border-radius: 16px;
  background: var(--rh-card); transition: box-shadow .15s, transform .15s, border-color .15s; }
.rh-mod:hover { box-shadow: 0 12px 26px rgba(0, 0, 0, .08); transform: translateY(-2px); border-color: var(--tone); }
.rh-mod-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 14%, #fff); color: var(--tone); font-size: 22px; font-weight: 700; }
.rh-mod b { font-size: 16.5px; line-height: 1.35; }
.rh-mod small { font-size: 13px; line-height: 1.55; color: var(--rh-soft); }
.rh-mod em { align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--tone) 12%, #fff); color: var(--tone);
  font-style: normal; font-size: 12.5px; font-weight: 700; }
.rh-go { position: absolute; top: 18px; right: 18px; color: var(--rh-faint); font-size: 18px; transition: transform .15s, color .15s; }
.rh-mod:hover .rh-go { transform: translateX(3px); color: var(--tone); }
.is-red { --tone: #B42318; } .is-orange { --tone: #E8590C; } .is-green { --tone: #00744B; } .is-blue { --tone: #2C6EA8; } .is-purple { --tone: #7A4FA0; }

/* เอกสาร */
.rh-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.rh-doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--rh-rule); border-radius: 12px; background: var(--rh-card);
  font-size: 14.5px; line-height: 1.4; transition: background .15s, border-color .15s; }
.rh-doc:hover { background: var(--rh-band); border-color: var(--rh-green); }
.rh-doc > span:nth-child(2) { flex: 1; min-width: 0; }
.rh-doc-kind { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 32px; border-radius: 8px; font-size: 11.5px; font-weight: 700; color: #fff; }
.rh-doc-kind.is-pdf { background: #B42318; }
.rh-doc-kind.is-drive { background: #2C6EA8; }
.rh-ext { color: var(--rh-faint); }

/* ภาพแผนผัง */
.rh-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rh-fig { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--rh-rule); border-radius: 16px; background: var(--rh-card); overflow: hidden; }
.rh-fig.is-wide { grid-column: 1 / -1; }
.rh-fig a { display: block; background: var(--rh-band); cursor: zoom-in; }
.rh-fig img { display: block; width: 100%; height: 260px; object-fit: contain; transition: transform .25s; }
.rh-fig.is-wide img { height: auto; max-height: 640px; }
.rh-fig a:hover img { transform: scale(1.015); }
.rh-fig figcaption { padding: 10px 14px; font-size: 14px; font-weight: 600; border-top: 1px solid var(--rh-rule); }
.rh-fig figcaption span { font-weight: 400; font-size: 12.5px; color: var(--rh-faint); }

/* คณะกรรมการระดับหน่วยงาน */
.rh-com { padding: 18px; border: 1px solid var(--rh-rule); border-radius: 16px; background: var(--rh-card); }
.rh-search { display: block; margin: 0 0 14px; }
.rh-search input { width: 100%; max-width: 440px; min-height: 42px; padding: 6px 14px; border: 1px solid var(--rh-rule); border-radius: 10px; font: inherit; font-size: 14.5px; }
.rh-search input:focus { outline: 2px solid var(--rh-green); outline-offset: 0; border-color: transparent; }
.rh-com-group + .rh-com-group { margin-top: 16px; }
.rh-com-group h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.rh-com-group h3 small { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--rh-band); color: var(--rh-soft); font-size: 12px; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rh-chips a { display: inline-block; padding: 6px 12px; border: 1px solid var(--rh-rule); border-radius: 999px; background: #fff; font-size: 13.5px; transition: background .15s, border-color .15s, color .15s; }
.rh-chips a:hover { background: var(--rh-green-deep); border-color: var(--rh-green-deep); color: #fff; }
.rh-none { margin: 8px 0 0; color: var(--rh-faint); }

/* แผนพัฒนา */
.rh-plans { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.rh-plan { display: flex; flex-direction: column; border: 1px solid var(--rh-rule); border-radius: 14px; background: var(--rh-card); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.rh-plan:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.rh-plan img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--rh-band); }
.rh-plan span { padding: 10px 12px; font-size: 13px; font-weight: 600; line-height: 1.4; }

@media (max-width: 991px) {
  .rh-hero { grid-template-columns: 1fr; padding: 24px; }
  .rh-figs { grid-template-columns: 1fr 1fr; }
  .rh-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .rh-hero { padding: 20px 16px; border-radius: 14px; }
  .rh-stats dd { font-size: 24px; }
  .rh-figs { grid-template-columns: 1fr; }
  .rh-fig img { height: 220px; }
  .rh-plans { grid-template-columns: 1fr 1fr; }
  .rh-docs { grid-template-columns: 1fr; }
  .rh-com { padding: 14px; }
}
