/* ==========================================================================
   ศูนย์ข้อมูลสารสนเทศ อบจ.เพชรบูรณ์ — stylesheet
   ใช้ร่วมกับ bootstrap.min.css (grid / modal) และ bootstrap-icons
   ========================================================================== */

:root {
  /* neutrals — อุ่นเล็กน้อย อมเขียวจาง */
  --bg: #ffffff;
  --surface: #ffffff;
  --raised: #f4f4f4;
  --text: #171a20;
  --text-2: #393c41;
  --muted: #5c5e62;
  --line: rgba(23, 26, 32, 0.1);
  --line-strong: rgba(23, 26, 32, 0.2);

  /* สีเน้น */
  --brand: #3e6ae1;
  --brand-hover: #3457b1;
  --brand-ink: #3457b1;
  --brand-tint: #eef1fb;

  /* แผงเข้ม / footer */
  --deep: #171a20;
  --deep-2: #22262e;
  --on-deep: #ffffff;
  --on-deep-2: #c5c7cb;

  --ok: #1f8a4c;
  --danger: #c2372f;

  --font: "Prompt", "Sarabun", system-ui, sans-serif;
  --mono: var(--font);

  --r-sm: 4px;
  --r: 4px;
  --r-card: 8px;
  --r-panel: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 8px 24px rgba(16, 32, 22, 0.08);

  --header-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font);
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; transition: color 150ms var(--ease); }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 575px) { .wrap { padding: 0 16px; } }

/* ---------- buttons ---------- */
.btn-pao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.btn-pao:active { transform: scale(0.98); }
.btn-pao i { font-size: 16px; }

.btn-pao.primary { background: var(--brand); color: #fff; }
.btn-pao.primary:hover { background: var(--brand-hover); color: #fff; }

.btn-pao.light { background: var(--on-deep); color: var(--deep); }
.btn-pao.light:hover { background: #fff; color: var(--deep); }

.btn-pao.ghost-dark { background: transparent; color: var(--on-deep); border-color: rgba(238, 243, 239, 0.24); }
.btn-pao.ghost-dark:hover { background: rgba(238, 243, 239, 0.08); color: #fff; }

.btn-pao.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-pao.secondary:hover { background: var(--raised); color: var(--text); }

.btn-pao.sm { height: 36px; padding: 0 14px; font-size: 14px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
body.scrolled .site-header { border-bottom-color: var(--line); background: rgba(255, 255, 255, 0.97); }

.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 600; }
.brand-text span { font-size: 12px; color: var(--muted); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--raised); }
.site-nav a.active { color: var(--brand-ink); background: var(--brand-tint); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 991px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: calc(var(--header-h) - 4px);
    left: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: 8px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease);
  }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: 10px 12px; font-size: 15px; }
  body.nav-open .site-nav { opacity: 1; transform: none; pointer-events: auto; }
}

/* ---------- สลับภาษา ---------- */
.lang-switch {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border-radius: var(--r); color: var(--text); font-size: 14px; line-height: 1;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.lang-switch:hover { background: var(--raised); color: var(--text); }
.lang-switch > i { font-size: 17px; }
.lang-switch .codes { display: inline-flex; gap: 6px; }
.lang-switch b { font-weight: 400; opacity: 0.55; }
.lang-switch b.on { font-weight: 500; opacity: 1; }
@media (min-width: 992px) and (max-width: 1199px) {
  .site-header .wrap { gap: 12px; }
  .site-nav a { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 575px) {
  .site-header .wrap { gap: 6px; padding: 0 12px; }
  .brand { gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .brand-text span { font-size: 11px; }
  .lang-switch { width: 36px; padding: 0; justify-content: center; }
  .lang-switch .codes { display: none; }
  .nav-toggle { width: 36px; height: 36px; font-size: 18px; }
}

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section.tight { padding: 72px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 767px) { .section { padding: 64px 0; } .section.tight { padding: 48px 0; } }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.sec-head h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.sec-head p { margin-top: 8px; color: var(--text-2); max-width: 40rem; }
.sec-head .sec-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
@media (max-width: 767px) {
  .sec-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
  .sec-head h2 { font-size: 24px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--deep);
  color: var(--on-deep);
  padding: 88px 0 120px;
}
.hero .ridges { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 220px; pointer-events: none; }
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }

.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--on-deep-2); margin-bottom: 20px; }
.hero-kicker img { width: 24px; height: 24px; }
.hero h1 { color: #fff; font-size: 52px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.hero h1 span { display: block; color: var(--on-deep-2); font-weight: 400; font-size: 0.62em; letter-spacing: 0; margin-top: 8px; }
.hero-lead { margin-top: 24px; font-size: 18px; line-height: 1.75; color: var(--on-deep-2); max-width: 34rem; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 991px) {
  .hero { padding: 56px 0 96px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 38px; }
  .hero-lead { font-size: 16px; }
}
@media (max-width: 575px) { .hero h1 { font-size: 32px; } }

/* product panel in hero */
.panel {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r-panel);
  box-shadow: 0 24px 48px rgba(4, 16, 9, 0.35), 0 2px 6px rgba(4, 16, 9, 0.2);
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head strong { font-size: 15px; font-weight: 600; }
.panel-head .meta { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

.panel-list { list-style: none; margin: 0; padding: 8px; }
.panel-list a {
  display: grid;
  grid-template-columns: 24px 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--text);
  transition: background-color 150ms var(--ease);
}
.panel-list a:hover { background: var(--bg); color: var(--text); }
.panel-list .idx { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.panel-list .ico {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand-ink); font-size: 17px;
}
.panel-list .name { font-size: 14px; font-weight: 500; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-list .go { color: var(--muted); font-size: 14px; transition: color 150ms var(--ease), transform 150ms var(--ease); }
.panel-list a:hover .go { color: var(--brand-ink); transform: translateX(2px); }

.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--bg); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.panel-foot a { font-weight: 500; }

/* signature: live status dot */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 138, 76, 0.16); flex: none; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start; }
.about-body h3 { font-size: 20px; margin-bottom: 16px; }
.about-body p { color: var(--text-2); text-indent: 2.5em; }
.about-body p + p { margin-top: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
}
.about-card { padding: 28px; }
.about-card p { color: var(--text-2); }
.checklist { list-style: none; margin: 20px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.checklist li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; color: var(--text); font-weight: 500; line-height: 1.55; }
.checklist i { color: var(--brand-ink); font-size: 18px; line-height: 1.4; }
@media (max-width: 991px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- systems ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1199px) { .sys-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px)  { .sys-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px)  { .sys-grid { grid-template-columns: 1fr; } }

.sys-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: border-color 150ms var(--ease), box-shadow 200ms var(--ease);
}
.sys-card:hover { color: var(--text); border-color: rgba(23, 26, 32, 0.3); box-shadow: var(--shadow); }
.sys-top { display: flex; align-items: center; justify-content: space-between; }
.sys-card .ico {
  width: 44px; height: 44px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand-ink); font-size: 20px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.sys-card:hover .ico { background: var(--brand); color: #fff; }
.sys-card .idx { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sys-card h3 { font-size: 16px; font-weight: 600; line-height: 1.45; }
.sys-card p {
  font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sys-foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.sys-foot .state { display: inline-flex; align-items: center; gap: 8px; }
.sys-foot i { font-size: 14px; transition: color 150ms var(--ease), transform 150ms var(--ease); }
.sys-card:hover .sys-foot i { color: var(--brand-ink); transform: translate(2px, -2px); }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-card); }

/* ---------- master plan ---------- */
.plan {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: center;
  padding: 48px 56px 0;
  background: var(--deep);
  color: var(--on-deep);
  border-radius: var(--r-panel);
}
.plan .tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-deep-2); margin-bottom: 12px; }
.plan h2 { color: #fff; font-size: 28px; line-height: 1.4; }
.plan p { margin-top: 16px; color: var(--on-deep-2); max-width: 36rem; }
.plan .btn-pao { margin-top: 28px; margin-bottom: 48px; }
.plan-doc { align-self: end; display: flex; justify-content: center; }
.plan-doc img {
  width: 100%;
  max-width: 280px;
  display: block;
  border-radius: 6px 6px 0 0;
  background: #fff;
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.04), 0 20px 40px rgba(0, 0, 0, 0.35);
  transform: rotate(-2deg) translateY(16px);
  transform-origin: bottom center;
  transition: transform 300ms var(--ease);
}
.plan:hover .plan-doc img { transform: rotate(-1deg) translateY(8px); }
@media (max-width: 991px) {
  .plan { grid-template-columns: 1fr; padding: 32px 24px 0; gap: 8px; }
  .plan h2 { font-size: 22px; }
  .plan .btn-pao { margin-bottom: 8px; }
  .plan-doc img { max-width: 220px; }
}

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--raised); border-radius: var(--r); }
.tabs button,
.tabs a {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.tabs button:hover,
.tabs a:hover { color: var(--text); }
.tabs .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- news cards ---------- */
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1199px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px)  { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px)  { .news-grid { grid-template-columns: 1fr; } }

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: box-shadow 200ms var(--ease), border-color 150ms var(--ease);
}
.news-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.news-card[hidden] { display: none; }

.news-thumb { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--raised); overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 400ms var(--ease); }
.news-card:hover .news-thumb img { transform: scale(1.02); }
.news-thumb .badge-cat {
  position: absolute; top: 12px; left: 12px;
  padding: 2px 10px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.94); color: var(--text);
  font-size: 12px; font-weight: 500; line-height: 22px;
  box-shadow: var(--shadow-sm);
}

.news-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; flex: 1; }
.news-body h3 {
  font-size: 15px; font-weight: 600; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.55em * 2);
}
.news-body h3 a { color: var(--text); }
.news-body h3 a:hover { color: var(--brand-ink); }
.news-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.news-meta span { display: inline-flex; align-items: center; gap: 6px; }
.news-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: transparent; border: 1px solid var(--line);
  font-size: 15px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn.pdf:hover { color: var(--danger); }

/* ---------- FAQ ---------- */
.faq { max-width: 840px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  transition: color 150ms var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--brand-ink); }
.faq summary i { color: var(--muted); transition: transform 200ms var(--ease); }
.faq details[open] summary i { transform: rotate(45deg); color: var(--brand-ink); }
.faq .answer { padding: 0 40px 20px 0; color: var(--text-2); }

.faq-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; }
@media (max-width: 991px) { .faq-layout { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 24px; align-items: stretch; }
@media (max-width: 991px) { .contact-grid { grid-template-columns: 1fr; } }

.info-card { padding: 8px; display: flex; flex-direction: column; }
.info-row { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; padding: 14px 16px; }
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-row .ico { width: 40px; height: 40px; border-radius: var(--r); background: var(--brand-tint); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.info-row small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.info-row strong, .info-row a { font-size: 15px; font-weight: 500; color: var(--text); }
.info-row a:hover { color: var(--brand-ink); }
.map { margin-top: 8px; border-radius: 8px; overflow: hidden; flex: 1; min-height: 240px; background: var(--raised); }
.map iframe { display: block; width: 100%; height: 100%; min-height: 240px; border: 0; }

.form-card { padding: 28px; }
.form-card h3 { font-size: 18px; }
.form-card > p { color: var(--muted); font-size: 14px; margin-top: 4px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 10px 14px;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.field input { height: 44px; }
.field textarea { min-height: 148px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.16); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 575px) { .form-grid { grid-template-columns: 1fr; } .form-card { padding: 20px; } }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.form-status { font-size: 14px; display: none; align-items: center; gap: 8px; margin-right: auto; }
.form-status.show { display: inline-flex; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }
.form-status.wait { color: var(--muted); }

.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- page head (sub pages) ---------- */
.page-head { padding: 40px 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--brand-ink); }
.crumbs i { font-size: 11px; }
.crumbs .current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.page-head h1 { font-size: 32px; letter-spacing: -0.01em; }
.page-head p { color: var(--text-2); margin-top: 6px; }
@media (max-width: 767px) { .page-head h1 { font-size: 26px; } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.search { position: relative; width: 320px; max-width: 100%; }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 40px;
  font-family: var(--font); font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.16); }
@media (max-width: 575px) { .search { width: 100%; } }

.pager { display: flex; justify-content: center; gap: 4px; margin-top: 48px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; height: 40px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  font-family: var(--mono); font-size: 14px;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.pager a:hover { background: var(--raised); color: var(--text); }
.pager .is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .is-active:hover { background: var(--brand-hover); color: #fff; }

/* ---------- article ---------- */
.article-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 48px; align-items: start; }
@media (max-width: 991px) { .article-grid { grid-template-columns: 1fr; gap: 28px; } }
.article-media a { display: block; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.article-media img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: var(--surface); }
.article-media .hint { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.article h1 { font-size: 28px; line-height: 1.45; letter-spacing: -0.005em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta .cat { color: var(--brand-ink); background: var(--brand-tint); padding: 0 10px; border-radius: var(--r-sm); line-height: 24px; font-weight: 500; }
.article-content { margin-top: 24px; font-size: 16px; line-height: 1.85; color: var(--text); overflow-wrap: anywhere; }
.article-content p { margin: 0 0 1em; }
.article-content img { height: auto; border-radius: var(--r); }
.article-content a { text-decoration: underline; text-underline-offset: 3px; }
.article-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 767px) { .article h1 { font-size: 22px; } }

/* ---------- นโยบายความเป็นส่วนตัว ---------- */
.policy { max-width: 760px; margin: 0 auto; color: var(--text-2); font-size: 16px; line-height: 1.8; }
.policy-intro { color: var(--text); font-size: 18px; line-height: 1.7; }
.policy h2 { margin: 40px 0 12px; font-size: 20px; font-weight: 500; }
.policy p + p, .policy ul + p { margin-top: 12px; }
.policy ul { margin: 8px 0 0; padding-left: 24px; }
.policy li + li { margin-top: 4px; }
.policy-table { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); }
.policy-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.policy-table th, .policy-table td { padding: 12px 16px; text-align: left; vertical-align: top; }
.policy-table th { font-weight: 500; color: var(--text); background: var(--raised); }
.policy-table tr + tr td { border-top: 1px solid var(--line); }
.policy-table .code { color: var(--text); white-space: nowrap; }
.policy-contact { list-style: none; padding-left: 0 !important; }
.policy-contact i { margin-right: 8px; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--deep); color: var(--on-deep-2); padding: 64px 0 0; font-size: 14px; }
.site-footer h4 { color: var(--on-deep); font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.site-footer a { color: var(--on-deep); }
.site-footer a:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 48px; padding-bottom: 48px; }
@media (max-width: 991px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 575px) { .foot-grid { grid-template-columns: 1fr; gap: 32px; } }

.foot-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.foot-brand img { width: 40px; height: 40px; }
.foot-brand strong { display: block; color: var(--on-deep); font-size: 15px; font-weight: 600; line-height: 1.4; }
.foot-brand span { font-size: 12px; }
.foot-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; line-height: 1.6; }
.foot-list i { color: var(--on-deep-2); }

.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a {
  width: 40px; height: 40px; border-radius: var(--r);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(238, 243, 239, 0.16); font-size: 17px;
  transition: background-color 150ms var(--ease);
}
.socials a:hover { background: rgba(238, 243, 239, 0.08); }

.line-box { display: flex; gap: 16px; align-items: center; }
.line-box img { width: 96px; height: 96px; border-radius: 8px; background: #fff; padding: 4px; flex: none; }
.line-box .id { font-family: var(--mono); color: var(--on-deep); font-size: 14px; }

.foot-bottom { border-top: 1px solid rgba(238, 243, 239, 0.1); padding: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.foot-bottom .views { display: inline-flex; align-items: center; gap: 8px; }
.foot-bottom .views .num { color: var(--on-deep); }

/* ---------- scroll top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 44px; height: 44px; border-radius: var(--r);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-size: 22px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), background-color 150ms var(--ease);
}
.to-top:hover { background: var(--brand-hover); color: #fff; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
body.modal-open .to-top { opacity: 0; pointer-events: none; }

/* ---------- popup (เดิม) ---------- */
#autoPopup { --bs-modal-margin: 8px; cursor: pointer; }
#autoPopup .modal-dialog { max-width: min(1140px, calc(100% - 16px)); margin-left: auto; margin-right: auto; }
/* พื้นที่รอบรูปและปุ่มกดแล้วปิดได้ มีเฉพาะรูปและปุ่มที่รับการคลิก */
#autoPopup .modal-content,
#autoPopup .modal-body,
#autoPopup .text-center { pointer-events: none; }
#autoPopup img,
#autoPopup .btn-pao { pointer-events: auto; }
/* กันที่ให้ขนาดรูปคงที่ และเหลือพื้นที่ปุ่มเสมอ: ระยะขอบ 16 + ช่องไฟ 16 + ปุ่ม 40 = 72px */
#autoPopup img {
  display: block; margin: 0 auto; height: auto; aspect-ratio: 1200 / 630;
  width: min(100%, calc((100vh - 72px) * 1200 / 630));
  width: min(100%, calc((100svh - 72px) * 1200 / 630));
  background: var(--raised); color: var(--text); font-size: 14px; cursor: default;
}

/* ---------- หน้าต่างขยายรูป (GLightbox) ---------- */
/* ล็อกการเลื่อนที่ html อย่างเดียว ถ้าล็อกที่ body ด้วย แถบเมนู sticky จะหลุดจากจอ */
body.glightbox-open { overflow: visible; }
.glightbox-container .goverlay { background: #08090b; }

.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border-radius: var(--r); color: #fff; font-size: 20px;
  transition: background-color 150ms var(--ease);
}
.glightbox-clean .gclose:hover,
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover { background: rgba(255, 255, 255, 0.14); }
.glightbox-clean .gclose { top: 16px; right: 16px; }
.glightbox-clean .gbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gslide-media { box-shadow: none !important; }
.gslide-image img { border-radius: var(--r); }
/* เว้นที่หัวท้ายให้รูปและชื่อข่าว แต่ยังให้ซูมเต็มขนาดได้ */
.gslide:not(.zoomed) .gslide-image img { max-height: calc(100vh - 112px) !important; max-height: calc(100svh - 112px) !important; }
.glightbox-mobile .gslide:not(.zoomed) .gslide-image img { max-height: calc(100vh - 176px) !important; max-height: calc(100svh - 176px) !important; }

.glightbox-clean .gslide-description,
.glightbox-mobile .glightbox-container .gslide-description {
  background: transparent; max-width: min(760px, 92vw) !important; margin: 0 auto; padding: 0;
}
.glightbox-mobile .glightbox-container .gslide-description { max-width: 100% !important; }
.glightbox-clean .gdesc-inner,
.glightbox-mobile .glightbox-container .gslide-description .gdesc-inner { padding: 12px 16px 16px; text-align: center; }
.glightbox-clean .gslide-title,
.glightbox-mobile .glightbox-container .gslide-title {
  margin: 0; color: #fff; font-family: var(--font); font-size: 14px; font-weight: 500; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* จอเตี้ยหรือมือถือแนวนอน: ให้พื้นที่ทั้งหมดกับรูป */
@media (max-height: 500px) {
  .glightbox-clean .gslide-description { display: none; }
  .gslide:not(.zoomed) .gslide-image img,
  .glightbox-mobile .gslide:not(.zoomed) .gslide-image img { max-height: calc(100vh - 16px) !important; max-height: calc(100svh - 16px) !important; }
}

/* ---------- entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(10px); transition: opacity 450ms var(--ease), transform 450ms var(--ease); }
  .rise.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; }
}

/* ข่าวที่ยังไม่มีคำแปลภาษาอังกฤษ */
.article-note { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; color: var(--muted); }
