/* Public website palette, inspired by the Trang emblem. Loaded after page styles. */
:root {
  --site-font: 'Sarabun', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bs-body-font-family: var(--site-font);
  --bs-font-sans-serif: var(--site-font);
  --brand-green: #005b2b;
  --brand-green-dark: #004521;
  --brand-gold: #e5ce32;
  --brand-soft: #edf5ee;
  --brand-border: #cddfd0;
  --tone-primary: var(--brand-green);
  --tone-primary-hover: var(--brand-gold);
  --bg-highlight-1: #edf5ee;
  --bg-highlight-2: #005b2b;
  --bs-primary: #005b2b;
  --bs-primary-rgb: 0, 91, 43;
  --bs-link-color: #005b2b;
  --bs-link-hover-color: #004521;
}
body { background-color: #f6f9f4; }
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.card-title, body#home .card-title {
  font-family: 'Iconic', 'Sarabun', sans-serif;
}
a { color: var(--brand-green); }
a:hover { color: var(--brand-green-dark); }
.navbar-top, footer {
  background: #005b2b;
  color: #fff;
}
.navbar {
  background: #fff;
  border-bottom-color: var(--brand-gold);
  box-shadow: 0 4px 16px rgb(0 69 33 / 8%);
}
.navbar-light .navbar-nav .nav-link { color: #244631; }
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus { color: var(--brand-green); background: var(--brand-soft); }
.dropdown-menu { --bs-dropdown-link-active-bg: #005b2b; --bs-dropdown-link-hover-bg: #edf5ee; border-color: var(--brand-border); }
.dropdown-item:hover, .dropdown-item:focus { color: var(--brand-green-dark); background-color: var(--brand-soft); }
.dropdown-item.active, .dropdown-item:active { color: #fff; background-color: var(--brand-green); }
.btn-primary, .btn-success {
  --bs-btn-bg: #005b2b;
  --bs-btn-border-color: #005b2b;
  --bs-btn-hover-bg: #004521;
  --bs-btn-hover-border-color: #004521;
  --bs-btn-active-bg: #004521;
  --bs-btn-active-border-color: #004521;
  --bs-btn-disabled-bg: #005b2b;
  --bs-btn-disabled-border-color: #005b2b;
  --bs-btn-focus-shadow-rgb: 0, 91, 43;
}
.btn-outline-primary, .btn-outline-success {
  --bs-btn-color: #005b2b;
  --bs-btn-border-color: #005b2b;
  --bs-btn-hover-bg: #005b2b;
  --bs-btn-hover-border-color: #005b2b;
  --bs-btn-active-bg: #004521;
  --bs-btn-active-border-color: #004521;
  --bs-btn-focus-shadow-rgb: 0, 91, 43;
}
.btn-readmore { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
.btn-readmore:hover { background: var(--brand-green-dark); color: #fff; }
.extra-main-menu { background: #005b2b; border-color: var(--brand-gold); }
.extra-main-menu .quote { background: var(--brand-gold); color: var(--brand-green-dark); }
.extra-main-menu:hover { background: var(--brand-green-dark); color: #fff4a5; border-color: var(--brand-gold); }
body#home .card-title, body#home .col-side-right .card-side-right {
  background: #005b2b;
  border-top-color: var(--brand-gold);
  color: #fff;
}
body#home .col-side-right .card-body { background-color: #edf5ee; }
.news-list li:nth-child(odd) { background: #edf5ee; border-bottom-color: var(--brand-border); }
.news-list li:nth-child(even) { background: #f8faf6; border-bottom-color: var(--brand-border); }
.news-list li a:hover { color: var(--brand-green); }
.news-nav-tabs .nav-link.active { color: var(--brand-green) !important; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-color: var(--brand-green); }
.card-footer { background-color: #f3f7f0; border-top-color: var(--brand-border); }
.diff.diff-box5 { background: #005b2b; border-bottom-color: #d6c33d; color: #fff; }
.diff.diff-box5 a { color: #fff4a5; }
.diff.diff-box5 a:hover { color: #fff; }
.contact-card { background: #e7f1df; }
.pagination { --bs-pagination-color: #005b2b; --bs-pagination-hover-color: #004521; --bs-pagination-active-bg: #005b2b; --bs-pagination-active-border-color: #005b2b; }
.form-control:focus, .form-select:focus { border-color: #4c8960; box-shadow: 0 0 0 .2rem rgb(0 91 43 / 15%); }
.form-check-input:checked { background-color: var(--brand-green); border-color: var(--brand-green); }
:focus-visible { outline: 3px solid #a08016; outline-offset: 3px; }

/* About the community: four equal, full-card navigation targets. */
.community-shortcuts .row > div { display: flex; }
.community-shortcut {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 26px 22px;
  border: 1px solid #d9e5d9;
  border-radius: 18px;
  background: var(--shortcut-soft, #e5f4e9);
  box-shadow: 0 5px 18px rgb(0 69 33 / 4%);
  text-decoration: none;
  color: var(--brand-green-dark);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.community-shortcut::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 0;
  width: 34px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--shortcut-accent, #00753a);
}
.community-shortcut__icon {
  display: grid;
  place-items: center;
  flex: 0 0 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--shortcut-accent, #00753a);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 5px 12px rgb(0 69 33 / 12%);
}
.community-shortcut__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.community-shortcut__eyebrow { color: #657764; font-size: .75rem; }
.community-shortcut__title { color: #004521; font-size: 1.15rem; font-weight: 700; line-height: 1.45; }
.community-shortcut__description { color: #59665c; font-size: .82rem; line-height: 1.6; }
.community-shortcut__arrow {
  margin-left: auto;
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #d5e2d2;
  border-radius: 50%;
  color: #005b2b;
  font-size: 12px;
  transition: background .2s, color .2s;
}
.community-shortcut:hover, .community-shortcut:focus-visible {
  color: #004521;
  transform: translateY(-3px);
  border-color: #8bac8e;
  box-shadow: 0 10px 24px rgb(0 69 33 / 10%);
}
.community-shortcut:hover .community-shortcut__arrow,
.community-shortcut:focus-visible .community-shortcut__arrow { background: #005b2b; color: #fff; border-color: #005b2b; }
@media (min-width: 576px) and (max-width: 1199.98px) {
  .community-shortcut { gap: 12px; padding: 22px 16px; flex-wrap: wrap; }
  .community-shortcut__icon { flex-basis: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
  .community-shortcut__body { flex: 1 1 150px; }
  .community-shortcut__arrow { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; }
  .community-shortcut__eyebrow { padding-right: 25px; }
}
@media (max-width: 575.98px) {
  .community-shortcut { padding: 20px 16px; gap: 14px; }
  .community-shortcut__icon { flex-basis: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
  .community-shortcut__title { font-size: 1.05rem; }
  .community-shortcut__description { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .community-shortcut, .community-shortcut__arrow { transition: none; }
  .community-shortcut:hover, .community-shortcut:focus-visible { transform: none; }
}

/* Colour accents help distinguish information and services on the homepage. */
body#home {
  background: #f7faf5;
}
.community-shortcuts .row > div:nth-child(2) { --shortcut-accent: #b27612; --shortcut-dark: #805008; --shortcut-soft: #fff1c9; }
.community-shortcuts .row > div:nth-child(3) { --shortcut-accent: #237cb0; --shortcut-dark: #18577e; --shortcut-soft: #e1f1ff; }
.community-shortcuts .row > div:nth-child(4) { --shortcut-accent: #c4642a; --shortcut-dark: #91411c; --shortcut-soft: #ffeadb; }
.community-shortcut__title { color: var(--shortcut-dark, #004521); }
.community-shortcut__arrow { color: var(--shortcut-dark, #005b2b); background: #fff; }
.community-shortcut:hover, .community-shortcut:focus-visible { border-color: var(--shortcut-accent, #00753a); }
.community-shortcut:hover .community-shortcut__arrow,
.community-shortcut:focus-visible .community-shortcut__arrow { background: var(--shortcut-dark, #005b2b); border-color: var(--shortcut-dark, #005b2b); }
.home-panel { --panel-color: #006937; --panel-soft: #edf8ef; --panel-accent: #e5ce32; }
.home-panel--gold { --panel-color: #865513; --panel-soft: #fff8e6; --panel-accent: #f5d46c; }
.home-panel--blue { --panel-color: #185c87; --panel-soft: #eef7fe; --panel-accent: #93d5ef; }
.home-panel--orange { --panel-color: #91451f; --panel-soft: #fff3e9; --panel-accent: #ffc885; }
.home-panel--teal { --panel-color: #07675e; --panel-soft: #ebf8f5; --panel-accent: #8bdfbf; }
body#home .home-panel > .card-body > .card-title,
body#home .home-panel > .card-body > .d-flex > .card-title {
  background: var(--panel-color);
  border-top-color: var(--panel-accent);
  border-radius: 12px 12px 12px 2px;
  box-shadow: 0 4px 12px rgb(20 57 35 / 8%);
  margin-bottom: 16px;
}
.home-panel > .card-footer { background: var(--panel-soft); }
.home-panel .news-list li:nth-child(odd) { background: var(--panel-soft); }
.home-panel .news-list li:nth-child(even) { background: #fff; }
.home-panel .news-list li { border-bottom: 1px solid #e4eae4; }
.home-panel .news-list li a:hover { color: var(--panel-color); }
.home-panel .news-list .typcn { color: var(--panel-color); }
body#home .news-nav-tabs { gap: 6px; margin: 8px 0 16px; }
body#home .news-nav-tabs .nav-link {
  padding: 8px 12px;
  border: 1px solid #dce8de !important;
  border-radius: 8px !important;
  line-height: 1.5;
  background: #f4f8f1;
  color: #385742;
}
body#home .news-nav-tabs .nav-link.active { background: #006937; border-color: #006937 !important; color: #fff !important; }
body#home .news-nav-tabs .nav-link:hover:not(.active) { background: #fff4cf; border-color: #d5b840 !important; }
body#home .col-side-right .card-body { background: #edf5ee; }
body#home .col-side-right .card-side-right { background: #005b2b; border-bottom: 3px solid #e5ce32; }
.navbar { border-image: none; border-bottom-color: var(--brand-gold); }
.diff.diff-box5 { background: #00502a; border-top: 4px solid #dfc53d; }

/* ── Hero Banner & Small Banner (อัตราส่วน 16:5 ตามตัวอย่าง datoh-website) ── */
.wp-slide {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.wp-slide .flexslider.image-slider {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.wp-slide .flexslider.image-slider .flex-viewport {
  width: 100%;
  aspect-ratio: 16 / 5;
  max-height: 600px;
  overflow: hidden;
  transition: none !important;
}

.wp-slide .flexslider.image-slider .slides {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wp-slide .flexslider.image-slider .slides > li {
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.wp-slide .flexslider.image-slider .slides > li > a {
  display: block;
  width: 100%;
  height: 100%;
}

.wp-slide .flexslider.image-slider .slides img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
  object-position: center;
  display: block;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* Small Banner Box */
.wp-slide.wp-slide--small,
.wp-slide.wp-slide--small .flexslider.image-slider,
.wp-slide.wp-slide--small .flexslider.image-slider .flex-viewport {
  aspect-ratio: 16 / 5;
  max-height: 302px;
  border-radius: 12px;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

/* Dots navigation styling */
.wp-slide .flex-control-nav {
  bottom: 12px;
  z-index: 10;
}

.wp-slide .flex-control-paging li a {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.wp-slide .flex-control-paging li a.flex-active {
  width: 26px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Comprehensive Responsive System & Device Adaptation
   รองรับหน้าจอทุกขนาด: Mobile (320px+), Tablet (768px+), Desktop (1024px+), Wide (1440px+)
   ตามแนวทาง Modern Web Guidance (touch targets 44px, safe-area-insets, fluid typography)
   ========================================================================== */

/* 1. Global Viewport Fit & Zero Horizontal Overflow */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

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

body {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  min-height: 100dvh;
}

main {
  width: 100%;
  min-width: 0;
}

/* Safe-area insets padding for notched devices (iPhone, modern Android) */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* 2. Responsive Typography & Text Wrapping */
h1, h2, h3 {
  text-wrap: balance;
  overflow-wrap: anywhere;
}

p, li, dd {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

a, span, strong, em {
  overflow-wrap: anywhere;
}

/* 3. Media, Images & Embedded Content Responsiveness */
img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Responsive iframe embeds (เช่น แผนที่, YouTube, เอกสาร) */
iframe[src*="youtube"],
iframe[src*="google.com/maps"],
.responsive-embed iframe {
  max-width: 100% !important;
  border: 0;
}

/* 4. Table Responsiveness (Auto Horizontal Scroll on Small Screens) */
.content-detail__article table,
.entry-content table,
.prose table,
article table {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-collapse: collapse;
  margin-block: 1rem;
}

.content-detail__article table th,
.content-detail__article table td,
.entry-content table th,
.entry-content table td {
  padding: 0.5rem 0.75rem;
  min-width: 80px;
}

/* 5. Responsive Form Controls & Touch Targets (WCAG 2.5.5 / 2.5.8) */
@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }

  button,
  .btn,
  select,
  .form-select,
  input:not([type="checkbox"], [type="radio"]),
  .form-control {
    min-height: var(--target-size);
  }

  .nav-link,
  .dropdown-item,
  .list-group-item {
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

/* ป้องกัน iOS Safari ซูมเข้าอัตโนมัติเมื่อกดแตะฟิลด์กรอกข้อมูล */
@media (max-width: 767.98px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* 6. Floating Contact Widget (Sidebar layout matching datoh-website) */
#floating-contact-menu,
.floating-action-menu {
  position: fixed !important;
  right: max(24px, calc(env(safe-area-inset-right, 0px) + 12px)) !important;
  bottom: 24px !important;
  z-index: 1040 !important;
  max-width: calc(100vw - 24px) !important;
  color: #0f172a !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#floating-contact-panel[hidden] {
  display: none !important;
}

/* Flex row layout: channels on the left, card on the right */
.floating-contact-flex {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 14px !important;
}

/* Channels List (ออกข้างทางซ้าย) */
#floating-contact-channels {
  margin-bottom: 72px !important;
  padding: 0 !important;
}

#floating-contact-menu[data-channels="false"] #floating-contact-channels {
  display: none !important;
}

#floating-contact-menu[data-channels="true"] #floating-contact-channels {
  display: block !important;
  animation: floating-channels-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes floating-channels-in {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.floating-contact-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.floating-contact-list li {
  margin: 0 !important;
  padding: 0 !important;
}

/* Channel item: Label on left, Circle Icon on right (flush against card) */
.floating-contact-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  text-decoration: none !important;
  transition: transform 0.2s ease !important;
  cursor: pointer !important;
}

.floating-contact-item:hover {
  transform: translateX(-4px) !important;
}

.floating-channel-badge {
  display: inline-block !important;
  background: rgba(15, 23, 42, 0.92) !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  padding: 6px 16px !important;
  border-radius: 9999px !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22) !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
  transition: background-color 0.2s ease !important;
}

.floating-contact-item:hover .floating-channel-badge {
  background: #0f172a !important;
}

.floating-channel-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.15rem !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.floating-contact-item:hover .floating-channel-icon {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
}

/* Card on the right */
.floating-contact-intro {
  width: 300px !important;
  border-radius: 22px !important;
  background: #e8f1e6 !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2) !important;
  position: relative !important;
  overflow: hidden !important;
  text-align: initial !important;
}

.floating-contact-close-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #475569 !important;
  font-size: 0.88rem !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer !important;
  z-index: 20 !important;
  transition: transform 0.18s ease, background-color 0.18s ease !important;
}

.floating-contact-close-btn:hover {
  background: #f1f5f9 !important;
  transform: scale(1.08) !important;
}

.floating-contact-image-wrap {
  padding: 1.25rem 1.25rem 0.25rem 1.25rem !important;
}

.floating-contact-image {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

#floating-contact-menu[data-open="true"] .floating-contact-image {
  animation: floating-contact-bob 3s ease-in-out infinite !important;
}

@keyframes floating-contact-bob {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.02);
  }
}

.floating-contact-card-box {
  padding: 0 14px 14px 14px !important;
}

.floating-contact-white-card {
  background: #ffffff !important;
  border-radius: 18px !important;
  padding: 1.15rem 1rem !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
  text-align: center !important;
}

.floating-contact-title {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  margin-bottom: 0.65rem !important;
}

.floating-contact-sub-box {
  background: #f8fafc !important;
  border-radius: 12px !important;
  padding: 0.65rem 0.75rem !important;
  margin-bottom: 0.85rem !important;
  line-height: 1.35 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.floating-contact-org-name {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: #334155 !important;
}

.floating-contact-org-sub {
  font-size: 0.78rem !important;
  color: #64748b !important;
  margin-top: 2px !important;
}

.floating-contact-chat-btn {
  width: 100% !important;
  background: #005b2b !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 0.65rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 6px 16px rgba(0, 91, 43, 0.25) !important;
  transition: background-color 0.18s ease, transform 0.18s ease !important;
}

.floating-contact-chat-btn:hover {
  background: #004d24 !important;
  transform: translateY(-1px) !important;
}

/* Toggle button when closed */
.floating-contact-toggle-btn {
  border-radius: 9999px !important;
  background: #005b2b !important;
  color: #ffffff !important;
  border: none !important;
  padding: 12px 24px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  box-shadow: 0 14px 32px rgba(0, 91, 43, 0.35) !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
  margin-left: auto !important;
}

.floating-contact-toggle-btn:hover {
  background: #004d24 !important;
  transform: translateY(-2px) !important;
}

.floating-contact-toggle-btn[hidden] {
  display: none !important;
}

@media (min-width: 769px) {
  .floating-contact-back-btn {
    display: none !important;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  #floating-contact-menu,
  .floating-action-menu {
    right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px)) !important;
    bottom: max(16px, var(--safe-bottom, 16px)) !important;
  }

  #floating-contact-panel {
    max-height: 80vh !important;
    overflow-y: auto !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3) !important;
    width: 290px !important;
  }

  .floating-contact-flex {
    flex-direction: column !important;
    gap: 0 !important;
  }

  #floating-contact-channels {
    margin-bottom: 0 !important;
    padding: 2.2rem 1rem 1rem 1rem !important;
  }

  #floating-contact-menu[data-channels="false"] #floating-contact-channels {
    display: none !important;
  }

  #floating-contact-menu[data-channels="true"] #floating-contact-channels {
    display: block !important;
  }

  #floating-contact-menu[data-channels="true"] #floating-contact-intro {
    display: none !important;
  }

  .floating-contact-list {
    gap: 8px !important;
  }

  .floating-contact-item {
    justify-content: flex-start !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    flex-direction: row-reverse !important;
  }

  .floating-channel-badge {
    background: transparent !important;
    color: #1e293b !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
  }

  .floating-channel-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1rem !important;
  }

  .floating-contact-back-btn {
    margin-top: 12px !important;
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f1f5f9 !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    display: block !important;
  }

  .floating-contact-intro {
    width: 100% !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #floating-contact-menu .floating-contact-image {
    animation: none !important;
  }
}

/* 7. Banner & Slider Adaptation on Small Screens */
@media (max-width: 575.98px) {
  .wp-slide .flexslider.image-slider .flex-viewport {
    aspect-ratio: 16 / 7;
    min-height: 140px;
  }

  .wp-slide.wp-slide--small,
  .wp-slide.wp-slide--small .flexslider.image-slider,
  .wp-slide.wp-slide--small .flexslider.image-slider .flex-viewport {
    aspect-ratio: 16 / 7;
    min-height: 110px;
  }

  .wp-slide .flex-control-nav {
    bottom: 6px;
  }

  .wp-slide .flex-control-paging li a {
    width: 7px;
    height: 7px;
  }

  .wp-slide .flex-control-paging li a.flex-active {
    width: 18px;
  }
}

/* 8. Homepage News Tabs & Mobile Layout */
@media (max-width: 767.98px) {
  body#home .news-nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  body#home .news-nav-tabs::-webkit-scrollbar {
    height: 4px;
  }

  body#home .news-nav-tabs::-webkit-scrollbar-thumb {
    background: #cddfd0;
    border-radius: 4px;
  }

  body#home .news-nav-tabs .nav-link {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 6px 12px;
  }

  /* ตารางกระดานสนทนาบนหน้าแรก */
  body#home .table thead {
    display: none;
  }

  body#home .table tbody tr {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid #e4eae4;
    gap: 3px;
  }

  body#home .table tbody tr td {
    display: block;
    border: none;
    padding: 0;
    width: 100% !important;
  }

  body#home .table tbody tr td:last-child {
    font-size: 0.78rem;
    color: #64748b;
  }
}

/* 9. Detail Page Hero & Content Surface */
@media (max-width: 767.98px) {
  .content-detail__hero {
    padding: 1rem 1rem 1rem 1.4rem;
    border-radius: 1rem;
  }

  .content-detail__hero::before {
    left: 0.65rem;
    top: 0.85rem;
    bottom: 0.85rem;
  }

  .content-detail__title {
    font-size: 1.25rem;
  }

  .content-detail__toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .content-detail__share-group {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .content-detail__main-surface {
    padding: 1.15rem;
    border-radius: 1rem;
  }
}

/* 10. Community Shortcuts Grid Consistency */
@media (max-width: 575.98px) {
  .community-shortcuts .row {
    --bs-gutter-y: 0.65rem;
  }

  .community-shortcut {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .community-shortcut__title {
    font-size: 1rem;
  }
}

