@charset "utf-8";
/* ==========================================================
   RISK V4  |  site.css  (ไฟล์เดียวใช้ทั้งเว็บ)
   สไตล์เดียวกับเว็บ OSM  |  โครงหน้า HTML5 + CSS Grid/Flexbox
   แทนที่ v2.css, manual.css, csr.css, csr2.css
   ========================================================== */

/* ---------- 1) ตัวแปรสีและพื้นฐาน ---------- */
:root {
  --page-bg: #EFE8DF;
  --surface: #F7F3EE;
  --card: #FFFFFF;
  --line: #E7DED3;
  --line-soft: #EFE7DD;
  --navy: #0B3A5B;
  --navy-soft: #E6EEF4;
  --accent: #C2410C;
  --accent-soft: #FDEBDD;
  --text: #464646;
  --link: #006699;
  --radius: 16px;
  --radius-lg: 20px;
  --gutter: 15px;
}

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

body {
  margin: 0;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--page-bg);
}
img { max-width: 100%; }
iframe { max-width: 100%; border: 0; }

a:link, a:visited { color: var(--link); text-decoration: none; }
a:hover { color: var(--link); text-decoration: underline; }
a:active { color: var(--link); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* สีข้อความที่ใช้ในเนื้อหา */
.style1 { color: #FFFFFF; font-weight: bold; }
.style2 { color: #003399; }
.style3 { color: #FF6600; }
.style4 { color: #FE2964; }
.style5 { color: #990000; }
.style6 { color: #009933; }

.imgstyle {
  padding: 5px;
  margin-right: 10px;
  text-align: center;
  border: 1px solid #CCCCCC;
  border-radius: 12px;
}

/* ---------- 2) โครงหน้า (Grid) ---------- */
.container {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: var(--gutter);
  max-width: 1250px;
  margin: var(--gutter) auto;
  padding: 0 var(--gutter) var(--gutter);
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.container--single { grid-template-columns: minmax(0, 1fr); }
.container > .footer { grid-column: 1 / -1; }

/* ---------- 3) ส่วนหัว ---------- */
.site-head {
  grid-column: 1 / -1;
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  background: var(--navy);
}
/* สไลด์ภาพ (วนเปลี่ยนอัตโนมัติด้วย JavaScript สั้นๆ ท้ายหน้า) */
.site-slides {
  position: relative;
  aspect-ratio: 4 / 1;
  overflow: hidden;
}
.site-slides img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .6s ease;
}
.site-slides img.is-active { opacity: 1; }
.site-slides img:only-child { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .site-slides img { transition: none; } }

/* โลโก้ + ชื่อหน่วยงาน ซ้อนที่มุมซ้ายบนของสไลด์ */
.site-brand {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 46px;
  color: #fff;
  background: linear-gradient(180deg, rgba(8, 28, 46, .72) 0%, rgba(8, 28, 46, .45) 60%, rgba(8, 28, 46, 0) 100%);
}
.site-brand:link, .site-brand:visited, .site-brand:hover { color: #fff; text-decoration: none; }
.site-logo { flex: none; width: 128px; height: 128px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
.site-name { display: flex; flex-direction: column; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.site-name-th { font-size: 30px; font-weight: bold; line-height: 1.3; }
.site-name-en { font-size: 18px; letter-spacing: .02em; line-height: 1.4; }
.site-name-sub { font-size: 18px; font-weight: bold; letter-spacing: .02em; line-height: 1.4; }

/* ส่วนหัวแบบรูปเดียว (เว็บ CSR) */
.site-head--plain { padding: 18px 28px; background: var(--card); border-bottom: 4px solid var(--accent); }
.site-head--plain img { display: block; width: 360px; height: auto; }

/* ---------- 4) เมนูด้านข้าง ---------- */
.sidebar {
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 18px;
  font-size: 22px;
  font-weight: bold;
  line-height: 1.3;
  color: #fff;
  background: var(--accent);
}
.sidebar-title::before {
  content: "";
  flex: none;
  width: 26px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sidebar-menu { margin: 0; padding: 2px 8px; list-style: none; }
.sidebar-menu li + li { border-top: 1px solid var(--navy-soft); }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 0;
  line-height: 1.35;
  color: var(--navy);
}
.sidebar-menu a:link, .sidebar-menu a:visited { color: var(--navy); }
.sidebar-menu a:hover { color: var(--accent); text-decoration: none; }
.sidebar-menu a::before {
  content: "";
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft) center / 20px 20px no-repeat;
}
.sidebar-menu a::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sidebar-menu li:nth-child(1) a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E"); }
.sidebar-menu li:nth-child(2) a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4.5A2.5 2.5 0 0 1 6.5 2H20v17H6.5A2.5 2.5 0 0 0 4 21.5z'/%3E%3Cpath d='M4 21.5V4.5'/%3E%3C/svg%3E"); }
.sidebar-menu li:nth-child(3) a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='17' height='17' rx='2'/%3E%3Cpath d='M3 10h17M8 2v4M16 2v4'/%3E%3C/svg%3E"); }
.sidebar--csr .sidebar-menu li:nth-child(2) a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E"); }
.sidebar--csr .sidebar-menu li:nth-child(3) a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E"); }
.sidebar--csr .sidebar-menu li:nth-child(4) a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='5' r='3'/%3E%3Cpath d='M12 22V8M5 12H2a10 10 0 0 0 20 0h-3'/%3E%3C/svg%3E"); }

/* ---------- คอลัมน์ข้าง: เมนู + สายตรงร้องเรียน ---------- */
.side-col { display: flex; flex-direction: column; gap: var(--gutter); }
.osm-hotline {
  display: block;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.osm-hotline:link, .osm-hotline:visited, .osm-hotline:hover { text-decoration: none; }
.osm-hotline-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: bold; line-height: 1.3;
}
.osm-hotline-body { display: block; padding: 8px 12px 6px; }
.osm-hotline-num { display: block; color: var(--navy); font-size: 22px; font-weight: bold; line-height: 1.25; white-space: nowrap; }
.osm-hotline-ext { display: block; color: var(--accent); font-size: 19px; font-weight: bold; line-height: 1.25; }
.osm-hotline-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; background: var(--navy-soft); color: var(--navy);
  font-size: 16px; font-weight: bold; line-height: 1.3;
}
.osm-hotline:hover .osm-hotline-foot { color: var(--accent); }

/* ---------- 5) เนื้อหา (การ์ด) ---------- */
.maincontent {
  min-width: 0;
  padding: 20px 24px 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.maincontent_top2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: bold;
  line-height: 1.4;
  color: var(--navy);
}
.maincontent h2, .maincontent h3 { color: var(--navy); line-height: 1.4; }
.maincontent h3 { font-size: 15px; margin: .9em 0 .4em; }
.maincontent ul { padding-left: 22px; list-style: disc; }
.maincontent li { margin: .3em 0; }
.maincontent li::marker { color: var(--accent); }

/* ---------- 6) ท้ายหน้า (เหมือนเว็บ OSM) ---------- */
.footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.footer-logo { flex: none; display: block; }
.footer-logo img, .footer-logo svg { display: block; border-radius: 14px; }
.footer-logo { transition: transform .15s ease; }
.footer-logo:hover { transform: scale(1.06); }
.footer-text { min-width: 0; }
.footer-text p { margin: 6px 0; color: var(--navy); font-size: 13px; line-height: 1.6; }
.footer > p { margin: 0; color: var(--navy); }
.footer > p img { vertical-align: middle; margin-right: 6px; }

/* ---------- 7) Spry Tabs / Accordion ---------- */
.maincontent ul.TabbedPanelsTabGroup { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.TabbedPanelsTab {
  float: none;
  margin: 0;
  padding: 7px 16px;
  list-style: none;
  font-weight: bold;
  color: var(--navy);
  background: var(--card);
  border: 1px solid var(--navy);
  border-radius: 999px;
  cursor: pointer;
}
.TabbedPanelsTab:hover { background: var(--navy-soft); }
.TabbedPanelsTabSelected, .TabbedPanelsTabSelected:hover { color: #fff; background: var(--navy); }
.TabbedPanelsTab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.TabbedPanelsContentGroup { clear: both; border: 0; background: transparent; }
.TabbedPanelsContent { padding: 0; }

.AccordionPanelTab {
  margin: 0 0 6px;
  padding: 10px 14px;
  font-weight: bold;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.AccordionPanelTab:hover { background: var(--accent-soft); }
.AccordionPanelOpen .AccordionPanelTab { background: var(--navy); border-color: var(--navy); color: #fff; }
.AccordionPanelContent { padding: 4px 6px; scrollbar-width: thin; }
.AccordionPanelContent .AccordionPanelContent { height: auto !important; overflow: visible; }

/* ---------- 8) ปุ่มเรียกใช้งาน ---------- */
.osm-cta-row { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 14px 0 18px; }
.osm-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 380px;
  max-width: 100%;
  padding: 14px 20px 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #C2410C 0%, #E8590C 100%);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(194, 65, 12, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.osm-cta:link, .osm-cta:visited, .osm-cta:hover { color: #fff; text-decoration: none; }
.osm-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(194, 65, 12, .34); }
.osm-cta:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.osm-cta--blue { background: linear-gradient(135deg, #0B3A5B 0%, #1565A8 100%); box-shadow: 0 6px 16px rgba(11, 58, 91, .30); }
.osm-cta--blue:hover { box-shadow: 0 10px 22px rgba(11, 58, 91, .36); }
.osm-cta-ico { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.osm-cta-text { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.osm-cta-title { font-size: 20px; font-weight: bold; }
.osm-cta-sub { font-size: 13px; opacity: .9; }
.osm-cta-arrow { margin-left: auto; font-size: 32px; line-height: 1; }
.osm-cta--ghost { padding: 10px 18px 10px 14px; color: var(--navy); background: var(--card); border: 2px solid var(--accent); box-shadow: none; }
.osm-cta--ghost:link, .osm-cta--ghost:visited { color: var(--navy); }
.osm-cta--ghost:hover { color: var(--accent); box-shadow: 0 6px 14px rgba(194, 65, 12, .18); }
.osm-cta--ghost .osm-cta-ico { width: 38px; height: 38px; background: var(--accent-soft); color: var(--accent); }
.osm-cta--ghost .osm-cta-title { font-size: 17px; }
.osm-cta--ghost .osm-cta-sub { color: var(--text); }
.osm-cta--ghost .osm-cta-arrow { color: var(--accent); font-size: 28px; }
.osm-cta-row--tight { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .osm-cta { transition: none; } .osm-cta:hover { transform: none; } }

/* ---------- 9) หน้าแรก: การ์ดแยกหลายใบ ---------- */
.maincontent:has(> .card-main) { padding: 0; overflow: visible; border: 0; background: none; border-radius: 0; }
.maincontent:has(> .card-main) > .maincontent_top2 {
  margin: 0;
  padding: 20px 24px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-main {
  margin-bottom: var(--gutter);
  padding: 4px 24px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.card-main li { font-size: 15px; font-weight: bold; color: var(--navy); }
.card-main li:has(> .style2) , .card-main li.style2 { color: #003399; }
.card-section {
  padding: 20px 24px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-title { margin: 0 0 14px; font-size: 22px; font-weight: bold; line-height: 1.4; color: var(--navy); }

/* ---------- 10) หน้าเอกสาร (คู่มือ / กิจกรรม / แบบฟอร์ม) ---------- */
body.doc-page { padding: var(--gutter); }
.doc {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--gutter);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.doc-header { margin: 0 calc(var(--gutter) * -1) var(--gutter); background: var(--card); border-bottom: 4px solid var(--accent); }
.doc-brand { display: flex; align-items: center; gap: 14px; padding: 14px 28px; color: var(--navy); }
.doc-brand:link, .doc-brand:visited, .doc-brand:hover { color: var(--navy); text-decoration: none; }
.doc-brand .site-logo { width: 72px; height: 72px; filter: none; }
.doc-brand .site-name { text-shadow: none; }
.doc-brand .site-name-th { font-size: 24px; }
.doc-brand .site-name-en { font-size: 15px; color: var(--accent); }
.doc-main {
  padding: 20px 24px 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 11pt;
}
.doc-title { margin: 0 0 14px; font-size: 24px; font-weight: bold; line-height: 1.4; color: var(--navy); }
.doc-body img { max-width: 100%; height: auto; }
.doc-body ul { padding-left: 22px; list-style: disc; }
.doc-body li::marker { color: var(--accent); }
.doc .style2 { color: #007355; }
.doc .style3 { color: #9E5447; }
.doc .style4 { color: #CE0067; }
.doc .style5, .doc .style6 {
  display: inline-block;
  padding: 4px 10px;
  color: var(--navy);
  background: var(--surface);
  border-left: 8px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.doc .style6 { display: block; font-size: x-large; text-align: center; }

/* ---------- 11) มือถือ ---------- */
@media (max-width: 900px) {
  .container { grid-template-columns: minmax(0, 1fr); padding: 0 10px 10px; }
  .site-head { margin: 0 -10px; }
  .footer { flex-wrap: wrap; }
  .site-slides { aspect-ratio: 2 / 1; }
  .site-brand { gap: 10px; padding: 10px 14px 28px; }
  .site-logo { width: 72px; height: 72px; }
  .site-name-th { font-size: 17px; }
  .site-name-en { font-size: 12px; }
  .site-name-sub { font-size: 13px; }
  .site-head--plain { padding: 12px 16px; }
  .site-head--plain img { width: 220px; }
  .maincontent, .doc-main { padding: 16px; }
  .card-main, .card-section { padding-left: 16px; padding-right: 16px; }
  .maincontent:has(> .card-main) > .maincontent_top2 { padding: 16px 16px 0; }
  .doc-brand { padding: 10px 14px; }
  .doc-brand .site-logo { width: 48px; height: 48px; }
  .doc-brand .site-name-th { font-size: 17px; }
  .doc-brand .site-name-en { font-size: 12px; }
}
