/* ==========================================================================
   Header & Main Navigation — ถอดแบบจาก datoh-website 100%
   โทนสีเขียว–ทอง (Trang Mayo Identity: #005b2b & #e5ce32)
   1. Utility Bar (แถบเครื่องมือ ปรับขนาดตัวอักษร, ภาษา, เจ้าหน้าที่)
   2. Main Branding Header (ตราสัญลักษณ์ + ชื่อ อบต. + บริการออนไลน์)
   3. Sticky Navigation Bar (เมนูหลักพร้อม Mega Menu และ Mobile Drawer)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Utility Bar
   -------------------------------------------------------------------------- */
.site-utility-bar {
  background: #edf5ee;
  border-bottom: 1px solid rgba(0, 91, 43, 0.1);
  color: #233b2e;
  font-size: 0.78rem;
  line-height: 1.4;
  position: relative;
  z-index: 1030;
}

.site-utility-bar__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.25rem 1rem;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.site-utility-bar__left,
.site-utility-bar__right,
.site-utility-bar__font,
.site-utility-bar__social {
  display: inline-flex;
  align-items: center;
}

.site-utility-bar__left {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-utility-bar__right {
  position: relative;
  flex-shrink: 0;
  gap: 0.5rem;
}

.site-utility-bar__font {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.site-utility-bar__label {
  margin-right: 0.25rem;
  color: #527961;
  white-space: nowrap;
}

.site-utility-bar__font-btn,
.site-utility-bar__font-reset {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 91, 43, 0.22);
  border-radius: 4px;
  background: #ffffff;
  color: #233b2e;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.site-utility-bar__font-btn:hover,
.site-utility-bar__font-reset:hover {
  background: #005b2b;
  border-color: #005b2b;
  color: #ffffff;
}

.site-utility-bar__font-size {
  margin-left: 0.25rem;
  color: #005b2b;
  font-size: 0.88rem;
  font-weight: 700;
}

.site-utility-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(0, 91, 43, 0.18);
  color: #233b2e;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.site-utility-bar__link:hover {
  color: #005b2b;
  text-decoration: underline;
}

.site-utility-bar__icon {
  color: #005b2b;
  font-size: 0.8rem;
}

/* Language Selector */
.site-utility-bar__lang {
  display: inline-flex;
  border: 0;
  background: transparent;
  padding: 0;
  color: #233b2e;
  font: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.site-utility-bar__lang-facade {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(0, 91, 43, 0.2);
  border-radius: 4px;
  padding: 0.2rem 0.5rem 0.2rem 0.4rem;
  color: #233b2e;
  font-size: 0.75rem;
  line-height: 1.25;
}

.site-utility-bar__google-logo {
  display: block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  flex: 0 0 auto;
}

.site-utility-bar__lang-separator {
  width: 1px;
  height: 1em;
  margin: 0 0.35rem;
  background: rgba(0, 0, 0, 0.18);
}

.site-utility-bar__lang-caret {
  width: 0;
  height: 0;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  border-top: 4px solid #527961;
}

.site-utility-bar__lang:hover .site-utility-bar__lang-facade {
  background: #f8faf8;
  border-color: #005b2b;
}

.site-utility-bar__lang-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 4.5rem;
  z-index: 1050;
  min-width: 9.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 91, 43, 0.2);
  border-radius: 6px;
  background: #ffffff;
  padding: 0.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.site-utility-bar__lang-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 0.4rem 0.6rem;
  color: #233b2e;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.site-utility-bar__lang-option:hover,
.site-utility-bar__lang-option[aria-current="true"] {
  background: #edf5ee;
  color: #005b2b;
}

.site-utility-bar__lang-option i {
  visibility: hidden;
  color: #005b2b;
  font-size: 0.7rem;
}

.site-utility-bar__lang-option[aria-current="true"] i {
  visibility: visible;
}

/* Hidden container for Google Translate script */
.google-translate-host {
  position: absolute !important;
  top: 0 !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.goog-te-banner-frame.skiptranslate {
  display: none !important;
}

/* Social Icon Buttons */
.site-utility-bar__social {
  gap: 0.3rem;
  flex-shrink: 0;
}

.site-utility-bar__social a {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 91, 43, 0.2);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #527961;
  text-decoration: none;
  font-size: 0.7rem;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-utility-bar__social a:hover {
  border-color: #005b2b;
  background: #005b2b;
  color: #ffffff;
}

@media (max-width: 767px) {
  .site-utility-bar__container {
    flex-direction: column;
    align-items: flex-start;
    padding-block: 0.35rem;
  }
  .site-utility-bar__right {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.25rem;
    border-top: 1px dashed rgba(0, 91, 43, 0.15);
  }
}

/* --------------------------------------------------------------------------
   2. Main Branding Header
   -------------------------------------------------------------------------- */
.site-header-main {
  background-color: #ffffff;
  border-bottom: 2px solid #e5ce32;
  position: relative;
  z-index: 1010;
}

.site-header-main__wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .site-header-main__wrap {
    padding: 1rem 1rem;
  }
}

.site-header-main__brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.site-header-main__logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

@media (min-width: 576px) {
  .site-header-main__logo {
    width: 72px;
    height: 72px;
  }
}

.site-header-main__brand:hover .site-header-main__logo {
  transform: scale(1.04);
}

.site-header-main__text {
  min-width: 0;
}

.site-header-main__title {
  margin: 0;
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  font-weight: 700;
  color: #005b2b;
  line-height: 1.25;
}

.site-header-main__tagline {
  margin: 0.2rem 0 0 0;
  font-size: 0.82rem;
  color: #557262;
  line-height: 1.35;
}

@media (min-width: 576px) {
  .site-header-main__tagline {
    font-size: 0.92rem;
  }
}

.site-header-main__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.site-header-main__service-btn {
  display: none;
  align-items: center;
  gap: 0.45rem;
  border-radius: 9999px;
  background-color: #005b2b;
  border: 1px solid #004521;
  padding: 0.55rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 91, 43, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .site-header-main__service-btn {
    display: inline-flex;
  }
}

.site-header-main__service-btn:hover {
  background-color: #004521;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 91, 43, 0.35);
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   3. Sticky Navigation Bar
   -------------------------------------------------------------------------- */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 1020;
  background-color: #005b2b;
  border-bottom: 2px solid #e5ce32;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 91, 43, 0.22);
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}

.home-nav.is-stuck {
  box-shadow: 0 8px 24px rgba(0, 91, 43, 0.42), 0 1px 0 rgba(255, 255, 255, 0.18);
}

.home-nav__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 50px;
}

/* Floating Brand (Appears when sticky) */
.home-nav__brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-10px) scale(0.95);
  transition:
    max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.22s ease;
  text-decoration: none;
}

.home-nav.is-stuck .home-nav__brand {
  max-width: 280px;
  padding-right: 0.5rem;
  opacity: 1;
  visibility: visible;
  overflow: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.home-nav__brand-emblem {
  position: relative;
  display: inline-flex;
  width: 3.2rem;
  height: 3.2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 9999px;
  border: 2.5px solid #e5ce32;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.home-nav__brand-emblem img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
}

.home-nav__brand-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.home-nav__brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.home-nav__brand-sub {
  font-size: 0.72rem;
  color: #e5ce32;
  white-space: nowrap;
}

/* Mobile Toggle Button */
.home-nav__mobile-toggle {
  display: flex;
  min-height: 50px;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .home-nav__mobile-toggle {
    display: none;
  }
}

/* Navigation Drawer Backdrop */
.home-nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 0, 0, 0.45);
}

/* Navigation Menu List */
.home-nav__menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  width: min(390px, 92vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  color: #233b2e;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.2);
  display: none;
}

.home-nav__menu.is-open {
  display: block;
}

@media (min-width: 1024px) {
  .home-nav__menu {
    position: static !important;
    width: auto !important;
    overflow: visible !important;
    background: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
    margin-left: auto !important;
    display: block !important;
  }
}

.home-nav__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

@media (min-width: 1024px) {
  .home-nav__mobile-header {
    display: none;
  }
}

.home-nav__mobile-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.home-nav__mobile-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.home-nav__list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 1024px) {
  .home-nav__list {
    flex-direction: row;
    align-items: center;
  }
}

.home-nav__item {
  position: relative;
}

.home-nav__link,
.home-nav__trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 1024px) {
  .home-nav__link,
  .home-nav__trigger {
    min-height: 50px;
    padding: 0.52rem 0.9rem;
    font-size: 0.95rem;
    color: #ffffff;
  }

  .home-nav__link:hover,
  .home-nav__trigger:hover {
    background-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }

  .home-nav__item.is-active .home-nav__link,
  .home-nav__link[aria-current="page"] {
    position: relative;
    color: #e5ce32 !important;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.12);
  }

  .home-nav__item.is-active .home-nav__link::before,
  .home-nav__link[aria-current="page"]::before {
    position: absolute;
    right: 0.75rem;
    bottom: 0.35rem;
    left: 0.75rem;
    height: 2.5px;
    border-radius: 999px;
    background-color: #e5ce32;
    content: '';
  }
}

@media (max-width: 1023.98px) {
  .home-nav__link:hover,
  .home-nav__trigger:hover {
    background-color: #edf5ee;
    color: #005b2b;
  }
}

.home-nav__chevron {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1;
  color: #ffffff;
  opacity: 0.9;
  margin-left: 0.4rem;
  flex-shrink: 0;
  transition: transform 0.22s ease, color 0.15s ease, opacity 0.15s ease;
}

.home-nav__trigger:hover .home-nav__chevron {
  opacity: 1;
  color: #e5ce32;
}

[aria-expanded="true"] > .home-nav__chevron,
[aria-expanded="true"] .home-nav__chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: #e5ce32;
}

@media (max-width: 1023.98px) {
  .home-nav__chevron {
    color: #527961;
    font-size: 0.8rem;
  }

  .home-nav__trigger:hover .home-nav__chevron,
  [aria-expanded="true"] > .home-nav__chevron,
  [aria-expanded="true"] .home-nav__chevron {
    color: #005b2b;
  }
}

/* --------------------------------------------------------------------------
   Mega Menu / Dropdown Panel
   -------------------------------------------------------------------------- */
.home-mega-panel {
  border-top: 1px solid #cddfd0;
  background: #ffffff;
  color: #233b2e;
}

.home-mega-panel[hidden] {
  display: none !important;
}

@media (min-width: 1024px) {
  .home-mega-panel {
    position: fixed;
    z-index: 1060;
    width: max-content;
    max-width: calc(100vw - 32px);
    border: 1px solid #cddfd0;
    border-top: 3px solid #005b2b;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    overflow: auto;
    overscroll-behavior: contain;
  }

  /* สะพานเชื่อม hover ป้องกันเมาส์หลุดระหว่างเมนูและพาเนล */
  .home-mega-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    pointer-events: auto;
  }
}

.home-mega-panel__inner {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .home-mega-panel__inner {
    flex-direction: row;
    align-items: flex-start;
    padding: 0.65rem 0.25rem;
  }
}

.home-mega-panel__column {
  min-width: 0;
  border-bottom: 1px solid #eef3ee;
}

.home-mega-panel__column:last-child {
  border-bottom: 0;
}

@media (min-width: 1024px) {
  .home-mega-panel__column {
    min-width: 280px;
    max-width: 480px;
    width: max-content;
    flex: 1 1 auto;
    border-bottom: 0;
    border-left: 1px solid #e2ede3;
    padding: 0 0.75rem;
  }

  .home-mega-panel__column:first-child {
    border-left: 0;
  }
}

.home-mega-panel__group-title {
  display: none;
  white-space: nowrap;
  padding: 0.5rem 0.75rem 0.35rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #005b2b;
  border-bottom: 1px solid #eef3ee;
  margin-bottom: 0.25rem;
}

@media (min-width: 1024px) {
  .home-mega-panel__group-title {
    display: block;
  }
}

.home-mega-panel__group-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  white-space: nowrap;
  background: #f4f8f4;
  padding: 0.55rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #005b2b;
  border: 0;
  cursor: pointer;
  text-align: left;
}

@media (min-width: 1024px) {
  .home-mega-panel__group-trigger {
    display: none;
  }
}

.home-mega-panel__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

@media (max-width: 1023.98px) {
  .home-mega-panel__list {
    display: none;
  }
  .home-mega-panel__list.is-open {
    display: block;
  }
}

@media (min-width: 1024px) {
  .home-mega-panel__list {
    display: block !important;
  }
}

.home-mega-panel__item a {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  white-space: normal;
  word-break: break-word;
  padding: 0.45rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #233b2e;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 1024px) {
  .home-mega-panel__item a {
    padding: 0.35rem 0.65rem;
    font-size: 0.92rem;
  }
}

.home-mega-panel__item a:hover {
  background-color: #edf5ee;
  color: #005b2b;
}

.home-mega-panel__bullet {
  display: inline-block;
  width: 3.5px;
  height: 3.5px;
  min-width: 3.5px;
  min-height: 3.5px;
  max-width: 3.5px;
  max-height: 3.5px;
  border-radius: 50%;
  background-color: #527961;
  flex-shrink: 0;
  margin-top: 0.85em;
  font-size: 0;
  line-height: 0;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.home-mega-panel__bullet::before {
  content: "";
  display: none;
}

.home-mega-panel__item a:hover .home-mega-panel__bullet {
  background-color: #005b2b;
  transform: scale(1.25);
}
