/* ==========================================================================
   HRK Website — Dynamic Theming & Dark Mode Engine
   ========================================================================== */

:root {
  --th-primary-deep: #111f4b;
  --th-primary: #25236a;
  --th-primary-50: #eef0fa;
  --th-secondary: #e8b622;
  --th-secondary-dark: #8a6200;
  --th-secondary-light: #f6d86b;
  --th-secondary-50: #fdf6df;
  --th-surface: #ffffff;
  --th-surface-soft: #f1f3fb;
  --th-surface-warm: #faf7ef;
  --th-text-main: #172447;
  --th-text-muted: #546078;
  --th-border: #dce1ec;
}

/* ───────── Dynamic Color Applications (Tailwind utility overrides) ───────── */
.bg-navy-deep { background-color: var(--th-primary-deep) !important; }
.bg-navy { background-color: var(--th-primary) !important; }
.bg-navy-50 { background-color: var(--th-primary-50) !important; }
.text-navy-deep { color: var(--th-primary-deep) !important; }
.text-navy { color: var(--th-primary) !important; }
.border-navy { border-color: var(--th-primary) !important; }

.bg-gold { background-color: var(--th-secondary) !important; }
.bg-gold-50 { background-color: var(--th-secondary-50) !important; }
.text-gold { color: var(--th-secondary) !important; }
.text-gold-dark { color: var(--th-secondary-dark) !important; }
.border-gold { border-color: var(--th-secondary) !important; }
.border-t-gold { border-top-color: var(--th-secondary) !important; }

.hover\:text-gold:hover { color: var(--th-secondary) !important; }
.hover\:border-gold:hover { border-color: var(--th-secondary) !important; }
.hover\:bg-gold-50:hover { background-color: var(--th-secondary-50) !important; }

.btn-gold {
  background-color: var(--th-secondary) !important;
  color: var(--th-primary-deep) !important;
}
.btn-gold:hover {
  background-color: var(--th-secondary-light) !important;
}
.btn-navy {
  background-color: var(--th-primary) !important;
  color: #ffffff !important;
}
.btn-navy:hover {
  background-color: var(--th-primary-deep) !important;
}
.btn-outline-gold {
  border-color: var(--th-secondary) !important;
  color: var(--th-primary-deep) !important;
}
.btn-outline-gold:hover {
  background-color: var(--th-secondary-50) !important;
}

.eyebrow:before,
.eyebrow-light:before {
  background-color: var(--th-secondary) !important;
}
.after\:bg-gold:after {
  background-color: var(--th-secondary) !important;
}

.hrk-slider-dot.active {
  background-color: var(--th-secondary) !important;
  box-shadow: 0 0 12px var(--th-secondary) !important;
}

.back-to-top {
  background: linear-gradient(135deg, var(--th-primary-deep) 0%, var(--th-primary) 100%) !important;
  border-color: rgba(232, 182, 34, 0.4) !important;
  color: var(--th-secondary) !important;
}
.back-to-top:hover {
  border-color: var(--th-secondary) !important;
  box-shadow: 0 8px 24px rgba(17, 31, 75, 0.38), 0 0 16px var(--th-secondary) !important;
}
.back-to-top-bar {
  stroke: var(--th-secondary) !important;
}

/* ───────── Visitor Presets: [data-theme="..."] ───────── */
[data-theme="classic"] {
  --th-primary-deep: #111f4b;
  --th-primary: #25236a;
  --th-primary-50: #eef0fa;
  --th-secondary: #e8b622;
  --th-secondary-dark: #8a6200;
  --th-secondary-light: #f6d86b;
  --th-secondary-50: #fdf6df;
}

[data-theme="emerald"] {
  --th-primary-deep: #093325;
  --th-primary: #115e43;
  --th-primary-50: #ecfdf5;
  --th-secondary: #e8b622;
  --th-secondary-dark: #8a6200;
  --th-secondary-light: #f6d86b;
  --th-secondary-50: #fef9c3;
}

[data-theme="crimson"] {
  --th-primary-deep: #4a0e17;
  --th-primary: #881326;
  --th-primary-50: #fff1f2;
  --th-secondary: #d4af37;
  --th-secondary-dark: #927218;
  --th-secondary-light: #edd887;
  --th-secondary-50: #fefce8;
}

[data-theme="ocean"] {
  --th-primary-deep: #0c2340;
  --th-primary: #1a4473;
  --th-primary-50: #eff6ff;
  --th-secondary: #0284c7;
  --th-secondary-dark: #0369a1;
  --th-secondary-light: #38bdf8;
  --th-secondary-50: #e0f2fe;
}

[data-theme="purple"] {
  --th-primary-deep: #28114b;
  --th-primary: #4c1d95;
  --th-primary-50: #f5f3ff;
  --th-secondary: #e8b622;
  --th-secondary-dark: #8a6200;
  --th-secondary-light: #f6d86b;
  --th-secondary-50: #fdf6df;
}

/* ───────── Dark Mode ───────── */
[data-theme="dark"] {
  --th-primary-deep: #080c14;
  --th-primary: #161e2e;
  --th-primary-50: #1e293b;
  --th-secondary: #facc15;
  --th-secondary-dark: #fef08a;
  --th-secondary-light: #fef9c3;
  --th-secondary-50: #1e293b;
  --th-surface: #0f172a;
  --th-surface-soft: #182234;
  --th-surface-warm: #1e293b;
  --th-text-main: #f8fafc;
  --th-text-muted: #94a3b8;
  --th-border: #334155;
}

[data-theme="dark"] body {
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] header[data-header],
[data-theme="dark"] header.bg-white\/95 {
  background-color: rgba(11, 15, 25, 0.95) !important;
  border-bottom-color: #1e293b !important;
}

[data-theme="dark"] .bg-white {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .card {
  background-color: #131c2e !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .bg-soft {
  background-color: #0d1524 !important;
}

[data-theme="dark"] .bg-warm {
  background-color: #131c2e !important;
}

[data-theme="dark"] .border-line {
  border-color: #1e293b !important;
}

[data-theme="dark"] .text-ink {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .text-ink-muted {
  color: #94a3b8 !important;
}

[data-theme="dark"] .field {
  background-color: #131c2e !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .field:focus {
  border-color: #facc15 !important;
}

[data-theme="dark"] .btn-outline {
  background-color: #131c2e !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .btn-outline-gold {
  background-color: #131c2e !important;
  color: #facc15 !important;
}

[data-theme="dark"] [data-drawer] .bg-white {
  background-color: #0f172a !important;
}

/* ───────── Theme Switcher Dropdown Component ───────── */
.theme-switch-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-family: Prompt, Sarabun, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.theme-switch-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: var(--th-secondary);
  color: var(--th-secondary);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: #ffffff;
  border: 1px solid #dce1ec;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(17, 31, 75, 0.18);
  padding: 8px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

[data-theme="dark"] .theme-dropdown {
  background: #131c2e;
  border-color: #334155;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.theme-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.theme-dropdown-header {
  padding: 6px 8px 8px;
  font-family: Prompt, Sarabun, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #111f4b;
  border-bottom: 1px solid #eef0fa;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .theme-dropdown-header {
  color: #f1f5f9;
  border-bottom-color: #1e293b;
}

.theme-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #172447;
  font-family: Sarabun, Prompt, sans-serif;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

[data-theme="dark"] .theme-option-item {
  color: #e2e8f0;
}

.theme-option-item:hover {
  background-color: #f1f3fb;
}

[data-theme="dark"] .theme-option-item:hover {
  background-color: #1e293b;
}

.theme-option-item.active {
  background-color: #eef0fa;
  font-weight: 600;
  color: #111f4b;
}

[data-theme="dark"] .theme-option-item.active {
  background-color: #1e293b;
  color: #facc15;
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  display: flex;
  overflow: hidden;
}

.theme-swatch-half {
  width: 50%;
  height: 100%;
}

/* ───────── Prompt 400 Font Definition ───────── */
@font-face {
  font-family: 'Prompt';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/prompt-thai-400-normal.woff2') format('woff2');
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Prompt';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/prompt-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* ==========================================================================
   Spacious & Elegant Header Architecture (96px Desktop / 72px Mobile)
   ========================================================================== */
[data-header] {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--th-border, #dce1ec);
  min-height: 72px;
  height: 72px;
  display: flex;
  align-items: center;
}

@media (min-width: 1024px) {
  [data-header] {
    min-height: 96px;
    height: 96px;
  }
}

.header-container {
  width: 95% !important;
  max-width: 1760px !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
  height: 100% !important;
  min-height: inherit;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: nowrap !important;
}

@media (min-width: 1600px) {
  .header-container {
    gap: 32px !important;
  }
}

/* ── Group 1: Brand / Logo ── */
.header-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}

@media (min-width: 1600px) {
  .header-brand {
    gap: 14px !important;
  }
}

.header-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .header-logo {
    width: 52px;
    height: 52px;
  }
}

@media (min-width: 1680px) {
  .header-logo {
    width: 56px;
    height: 56px;
  }
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-school-main {
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: var(--th-primary-deep, #111f4b) !important;
  white-space: nowrap !important;
}

@media (min-width: 1360px) {
  .header-school-main {
    font-size: 16px !important;
  }
}

@media (min-width: 1680px) {
  .header-school-main {
    font-size: 17.5px !important;
  }
}

.header-school-sub {
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.3 !important;
  color: var(--th-text-muted, #546078) !important;
  white-space: nowrap !important;
}

@media (min-width: 1680px) {
  .header-school-sub {
    font-size: 12px !important;
  }
}

/* ── Group 2: Desktop Main Navigation ── */
.header-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
}

.header-nav-list {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

@media (min-width: 1550px) {
  .header-nav-list {
    gap: 12px !important;
  }
}

@media (min-width: 1750px) {
  .header-nav-list {
    gap: 18px !important;
  }
}

.header-nav-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 52px !important;
  min-height: 44px !important;
  padding: 0 10px !important;
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: var(--th-primary-dark, #111f4b) !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  position: relative !important;
  transition: color 0.15s ease;
}

@media (min-width: 1550px) {
  .header-nav-link {
    padding: 0 12px !important;
    font-size: 15.5px !important;
  }
}

@media (min-width: 1750px) {
  .header-nav-link {
    padding: 0 14px !important;
    font-size: 16px !important;
  }
}

.header-nav-link:hover {
  color: #25236a !important;
}

/* Active indicator: elegant gold underline positioned with proper breathing space */
.header-nav-link[aria-current="page"],
.header-nav-link.text-navy-deep {
  font-weight: 600 !important;
  color: var(--th-primary-dark, #111f4b) !important;
}

.header-nav-link[aria-current="page"]::after,
.header-nav-link.text-navy-deep::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 3px;
  border-radius: 9999px;
  background-color: var(--th-secondary, #e8b622);
}

/* Sub-menus in dropdown panels */
[data-mainnav] [data-dropdown-panel] a {
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: var(--th-primary-dark, #111f4b);
}

[data-mainnav] [data-dropdown-panel] a[aria-current="page"] {
  font-weight: 500 !important;
  color: var(--th-primary-dark, #111f4b) !important;
}

/* Mobile drawer menu items */
[data-drawer] nav a,
[data-drawer] nav button {
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: var(--th-primary-dark, #111f4b);
}

[data-drawer] nav a[aria-current="page"] {
  font-weight: 600 !important;
  color: var(--th-primary-dark, #111f4b) !important;
}

/* ── Group 3: Right-Side Actions (Search + Admissions button + Toggle) ── */
.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
}

@media (min-width: 1600px) {
  .header-actions {
    gap: 16px !important;
  }
}

.header-btn-search {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 8px !important;
  color: var(--th-primary-dark, #111f4b) !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.header-btn-search:hover {
  background-color: var(--surface-soft, #f1f3fb);
  color: var(--th-primary-dark, #111f4b);
}

.header-btn-search:focus-visible {
  outline: 3px solid var(--th-primary, #e8b622);
  outline-offset: 2px;
}

.header-btn-admissions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 46px !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  background-color: var(--th-secondary, #e8b622) !important;
  color: var(--th-primary-deep, #111f4b) !important;
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(17, 31, 75, 0.08);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0 !important;
}

@media (min-width: 1600px) {
  .header-btn-admissions {
    padding: 0 22px !important;
  }
}

.header-btn-admissions:hover {
  background-color: var(--th-secondary-light, #f6d86b) !important;
  color: var(--th-primary-deep, #111f4b) !important;
}

.header-btn-admissions:focus-visible {
  outline: 3px solid var(--th-primary-deep, #111f4b) !important;
  outline-offset: 2px !important;
}

.header-btn-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  color: var(--th-primary-dark, #111f4b);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0 !important;
  transition: background-color 0.15s ease;
}

.header-btn-toggle:hover {
  background-color: var(--surface-soft, #f1f3fb);
}

.header-btn-toggle:focus-visible {
  outline: 3px solid var(--th-secondary, #e8b622);
  outline-offset: 2px;
}

/* Responsive Navigation Breakpoint:
   Switch to mobile drawer below 1360px so desktop menu is spacious and never wraps */
@media (min-width: 1360px) {
  [data-mainnav] { display: flex !important; }
  .header-btn-toggle { display: none !important; }
  [data-drawer] { display: none !important; }
}

@media (max-width: 1359px) {
  [data-mainnav] { display: none !important; }
  .header-btn-toggle { display: inline-flex !important; }
  [data-drawer]:not([hidden]) { display: block !important; }
}

@media (max-width: 639px) {
  .header-container {
    width: 100% !important;
    padding-inline: 16px !important;
    gap: 8px !important;
  }
  .header-actions {
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .header-btn-admissions {
    padding: 0 12px !important;
    font-size: 15px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
  .header-btn-search,
  .header-btn-toggle {
    width: 40px !important;
    height: 44px !important;
    min-width: 40px !important;
    min-height: 44px !important;
    padding: 0 !important;
  }
  .header-brand {
    gap: 8px !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
    overflow: hidden !important;
  }
  .header-logo {
    width: 40px !important;
    height: 40px !important;
  }
  .header-school-main {
    font-size: 13px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .header-school-sub {
    display: none !important;
  }
}

@media (max-width: 375px) {
  .header-container {
    padding-inline: 12px !important;
    gap: 6px !important;
  }
  .header-brand {
    max-width: 120px !important;
  }
  .header-actions {
    gap: 6px !important;
  }
}

/* Executive Directory Hierarchy Chart */
.exec-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 40px 24px 48px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.exec-chart-title {
  color: #1a3a8f !important;
  font-family: var(--font-heading, inherit) !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  text-align: center !important;
  margin-top: 0 !important;
  margin-bottom: 36px !important;
}
.exec-level-row {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: 36px !important;
}
.exec-person-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 220px !important;
  margin: 0 auto !important;
}
.exec-level-row .exec-person-box {
  max-width: 320px !important;
}
.exec-img-wrap {
  width: 150px !important;
  height: 210px !important;
  overflow: hidden !important;
  border-radius: 3px !important;
  box-shadow: 0 4px 12px rgba(0, 20, 80, 0.15) !important;
  background: #eff6ff !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}
.exec-person-box:hover .exec-img-wrap {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 20px rgba(0, 20, 80, 0.22) !important;
}
.exec-img-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
.exec-name {
  color: #1a3a8f !important;
  font-family: var(--font-heading, inherit) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}
.exec-pos {
  color: #111827 !important;
  font-family: var(--font-heading, inherit) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  line-height: 1.35 !important;
}
.exec-grid-bottom {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  justify-content: center !important;
  align-items: start !important;
}
.exec-grid-bottom .exec-person-box {
  max-width: 100% !important;
}
.exec-grid-bottom .exec-pos {
  font-size: 12px !important;
  white-space: nowrap !important;
  letter-spacing: -0.2px !important;
}
@media (max-width: 1100px) {
  .exec-grid-bottom .exec-pos {
    font-size: 11px !important;
  }
}
@media (max-width: 768px) {
  .exec-grid-bottom {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px 12px !important;
  }
  .exec-grid-bottom .exec-pos {
    font-size: 11.5px !important;
  }
}
@media (max-width: 480px) {
  .exec-chart-card {
    padding: 24px 12px 32px !important;
  }
  .exec-chart-title {
    font-size: 22px !important;
    margin-bottom: 24px !important;
  }
  .exec-level-row {
    margin-bottom: 24px !important;
  }
  .exec-img-wrap {
    width: 130px !important;
    height: 182px !important;
  }
  .exec-name {
    font-size: 14px !important;
  }
  .exec-pos {
    font-size: 12px !important;
  }
}

/* ── Subject Department Personnel Hierarchy (ทำเนียบบุคลากรแต่ละกลุ่มสาระ) ── */
.dept-chart-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 36px 20px 42px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  margin-bottom: 28px !important;
}
.dept-chart-card .exec-level-row {
  margin-bottom: 32px !important;
}
.dept-grid-members {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: start !important;
  gap: 24px 16px !important;
  width: 100% !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
}
.dept-grid-members .exec-person-box {
  flex: 0 0 calc(25% - 16px) !important;
  max-width: 220px !important;
  min-width: 160px !important;
}
.dept-grid-members .exec-pos {
  font-size: 12.5px !important;
  letter-spacing: -0.2px !important;
}
@media (max-width: 1024px) {
  .dept-grid-members .exec-person-box {
    flex: 0 0 calc(33.333% - 14px) !important;
  }
}
@media (max-width: 768px) {
  .dept-chart-card {
    padding: 24px 12px 32px !important;
  }
  .dept-grid-members {
    gap: 20px 10px !important;
  }
  .dept-grid-members .exec-person-box {
    flex: 0 0 calc(50% - 10px) !important;
    min-width: 130px !important;
  }
  .dept-grid-members .exec-pos {
    font-size: 11.5px !important;
  }
}
@media (max-width: 480px) {
  .dept-chart-card {
    padding: 20px 10px 24px !important;
  }
  .dept-grid-members .exec-person-box {
    flex: 0 0 calc(50% - 8px) !important;
    min-width: 120px !important;
  }
  .dept-grid-members .exec-img-wrap {
    width: 130px !important;
    height: 182px !important;
  }
  .dept-grid-members .exec-name {
    font-size: 14px !important;
  }
  .dept-grid-members .exec-pos {
    font-size: 11px !important;
  }
}


/* ── Directory Dropdown Custom Tree Menu (ทำเนียบ) ── */
.dir-dropdown-panel {
  padding-top: 2px !important;
  overflow: visible !important;
}
.header-nav li.is-open .dir-dropdown-panel,
.header-nav li:hover .dir-dropdown-panel {
  display: block !important;
}
.dir-dropdown-card {
  position: relative !important;
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-top: none !important;
  border-bottom: 3px solid #1a56db !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  padding: 18px 22px 18px 20px !important;
  min-width: 210px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}
.dir-tree-list {
  position: relative !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}
.dir-tree-list::before {
  content: "" !important;
  position: absolute !important;
  left: 7.5px !important;
  top: 13px !important;
  bottom: 13px !important;
  width: 1px !important;
  background-color: #cbd5e1 !important;
  z-index: 1 !important;
}
.dir-tree-item {
  position: static !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.dir-tree-item.has-sub {
  position: relative !important;
}
[data-mainnav] .dir-dropdown-panel .dir-item-link {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  text-decoration: none !important;
  color: #1f2937 !important;
  font-family: 'Prompt', system-ui, sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  padding: 2px 0 !important;
  transition: color 0.15s ease !important;
  cursor: pointer !important;
}
[data-mainnav] .dir-dropdown-panel .dir-tree-item.has-sub > .dir-item-link {
  color: #1a56db !important;
}
[data-mainnav] .dir-dropdown-panel .dir-item-link:hover,
[data-mainnav] .dir-dropdown-panel .dir-item-link.is-active,
[data-mainnav] .dir-dropdown-panel .dir-tree-item.has-sub.is-active > .dir-item-link {
  color: #1a56db !important;
}
.dir-node {
  position: relative !important;
  z-index: 2 !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background-color: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 0 0 2px #ffffff !important;
  transition: border-color 0.15s ease !important;
}
.dir-item-link:hover .dir-node,
.dir-item-link.is-active .dir-node,
.dir-tree-item.has-sub > .dir-item-link .dir-node,
.dir-tree-item.has-sub.is-active > .dir-item-link .dir-node {
  border-color: #1a56db !important;
}
.dir-dot {
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
  background-color: #1a56db !important;
  display: block !important;
}
.dir-label {
  white-space: nowrap !important;
}
.dir-arrow {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin-left: 28px !important;
  color: #1a56db !important;
  flex-shrink: 0 !important;
}
.dir-sub-panel {
  position: absolute !important;
  left: 100% !important;
  top: -46px !important;
  padding-left: 6px !important;
  z-index: 60 !important;
  display: none;
}
.dir-sub-panel::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: -20px !important;
  width: 26px !important;
  z-index: 10 !important;
}
.dir-dropdown-panel.is-right-aligned .dir-sub-panel {
  left: auto !important;
  right: 100% !important;
  padding-left: 0 !important;
  padding-right: 6px !important;
}
.dir-dropdown-panel.is-right-aligned .dir-sub-panel::before {
  left: auto !important;
  right: -20px !important;
}
.dir-tree-item.has-sub:hover > .dir-sub-panel,
.dir-tree-item.has-sub.is-active > .dir-sub-panel,
.dir-tree-item.has-sub:focus-within > .dir-sub-panel {
  display: block !important;
}
.dir-sub-card {
  min-width: 270px !important;
  border-top: none !important;
}

/* ==========================================================================
   Global SVG Icon Utilities & Fallbacks
   ========================================================================== */
svg.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.h-3 { height: 0.75rem !important; }
.w-3 { width: 0.75rem !important; }
.h-3\.5 { height: 0.875rem !important; }
.w-3\.5 { width: 0.875rem !important; }
.h-4 { height: 1rem !important; }
.w-4 { width: 1rem !important; }
.h-5 { height: 1.25rem !important; }
.w-5 { width: 1.25rem !important; }

/* ==========================================================================
   Layout & Centering Utilities
   ========================================================================== */
.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}
.my-auto {
  margin-top: auto !important;
  margin-bottom: auto !important;
}
.ml-auto {
  margin-left: auto !important;
}
.mr-auto {
  margin-right: auto !important;
}

/* ==========================================================================
   PageBuilder Download Block Icon & Emoji Fix
   ========================================================================== */
.pb-download-icon,
.pb-download-block .text-4xl,
.pb-download-block .text-3xl {
  font-size: 0 !important;
  line-height: 0 !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  background-color: #eef0fa !important;
  border: 1px solid #dce1ec !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  position: relative !important;
  overflow: hidden !important;
}
.pb-download-icon::before,
.pb-download-block .text-4xl::before,
.pb-download-block .text-3xl::before {
  content: "" !important;
  width: 24px !important;
  height: 24px !important;
  display: block !important;
  background-color: #25236a !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E") no-repeat center / contain !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E") no-repeat center / contain !important;
}

/* ==========================================================================
   Homepage About Section Typography
   ========================================================================== */
.home-about-title,
section[aria-labelledby="about-title"] .section-title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem) !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  color: var(--th-primary-deep, #111f4b) !important;
  margin-top: 0.5rem !important;
}
section[aria-labelledby="about-title"] p.text-ink-muted {
  font-size: 15.5px;
  line-height: 1.75;
}
