@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================================
   GOV.BKK — Custom styles (non-Tailwind)
   BMA Corporate Identity color system + animations + a11y
   ============================================================ */

/* ── CI Design Tokens (Palette A — Green Primary) ──────────────
   Reference: BMA Unofficial Graphic Identity, sampled from
   requirement/ci/1920x1080 px/PNG/*_1.png, *_2.png, *_5.png
   Tokens are GLOBAL so any theme can reuse them; per-theme
   background decisions live in [data-theme="..."] scopes below.
   ============================================================ */
:root {
  --ci-green-dark: #007744;
  --ci-green-deep: #005c33;
  --ci-green-mint: #6faa8a;
  --ci-amber: #e8a447;
  --ci-amber-soft: #f2c785;
  --ci-cream: #fff3d9;
  --ci-cream-soft: #fffaeb;
  --ci-peach: #fff0db;
  --ci-peach-deep: #ffe4bc;
  --ci-gray-bg: #f3f4f6;
  --ci-text-on-dark: #ffffff;
  --ci-text-muted-on-dark: rgba(255, 255, 255, 0.78);
}

/* ── Per-theme hooks ──────────────────────────────────────────
   Each theme sets body-level CSS vars that partials under the
   corresponding _Sections/{code}/ folder may reference via
   var(--hero-bg) / var(--channels-bg) / etc.
   ============================================================ */
body[data-theme="standard"] {
  --hero-bg-image:       url('/public-site/images/hero-bg.jpg');
  --page-title-bg:       #007744;
  --page-title-text:     #ffffff;
  --accent-primary:      #007744;
  --accent-primary-hover:#005c33;
  --accent-bg-soft:      #dcfce7;
  --accent-bg-softer:    #f0fdf4;
}

body[data-theme="green-ci"] {
  --hero-bg-image: url("/public-site/images/cityscape.jpg");
  --hero-bg-color: #111827;
  --hero-overlay-top: linear-gradient(
    to bottom,
    rgba(0, 60, 30, 0.55),
    transparent
  );
  --hero-overlay-btm: linear-gradient(
    to top,
    rgba(0, 60, 30, 0.35),
    transparent
  );
  --channels-bg: var(--ci-cream-soft);
  --apps-bg: linear-gradient(to bottom, var(--ci-peach), var(--ci-peach-deep));
  --orgs-bg: var(--ci-gray-bg);
  --footer-top-bg: linear-gradient(
    to bottom,
    var(--ci-green-dark),
    var(--ci-green-deep)
  );
  --footer-text: var(--ci-text-on-dark);
  --footer-text-muted: var(--ci-text-muted-on-dark);
  --page-title-bg: #073b25;
  --page-title-text: #ffffff;
  --accent-primary: #007744;
  --accent-primary-hover: #005c33;
  --accent-bg-soft: #dcfce7;
  --accent-bg-softer: #f0fdf4;
}

/* V3 CI Blue — cityscape hero, CI Blue accents throughout */
body[data-theme="v3"] {
  --hero-bg-image:       url('/public-site/images/cityscape2.jpg');
  --hero-bg-color:       #0071ce;
  --page-title-bg:       #005ba3;
  --page-title-text:     #ffffff;
  --accent-primary:      #0071ce;
  --accent-primary-hover:#005ba3;
  --accent-bg-soft:      #e6f2fc;   /* CI blue light */
  --accent-bg-softer:    #f0f7ff;
  /* CI Blue palette tokens */
  --v3-blue: #0071ce;
  --v3-blue-dark: #005ba3;
  --v3-blue-light: #e6f2fc;
  --v3-magenta: #d94d8a;
}

/* V3 — override JS-toggled active tab colors: swap to CI Blue */
body[data-theme="v3"] [data-org-tab].bg-gray-900,
body[data-theme="v3"] [data-app-tab][aria-selected="true"].bg-white {
  background-color: #0071ce !important;
  border-color: #0071ce !important;
  color: #ffffff !important;
}

/* V3 — AppDirectory filter chip active state */
body[data-theme="v3"] .app-dir-tab-active {
  background: #0071ce !important;
  color: #ffffff !important;
  border-color: #0071ce !important;
}

/* V3 — OrgTabs list items: JS renders flat hover rows; wrap each as a white card
   with subtle shadow + soft colored icon chip (replaces gradient-to-br). */
body[data-theme="v3"] #orgpanel-list > li {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
body[data-theme="v3"] #orgpanel-list > li > a {
  padding: 0.65rem 1rem !important;
}
body[data-theme="v3"] #orgpanel-list > li > a:hover {
  background-color: #fdf2f8 !important;
}
/* V3: soften the JS-rendered gradient icon chip to a light-tinted chip.
   Keep per-department hue variation by NOT overriding the color — only
   replace the gradient background with a muted color-matched tint. */
body[data-theme="v3"] #orgpanel-list > li > a > div:first-child {
  background-image: none !important;
  background-color: #fce7f3;
  color: #db2777;
  opacity: 0.95;
}
/* Collapsed: show exactly 3 rows (3 items mobile 1-col, 6 items sm+ 2-col) */
body[data-theme="v3"] #orgpanel-list[data-collapsed="1"] > li:nth-child(n + 4) {
  display: none;
}
@media (min-width: 640px) {
  body[data-theme="v3"]
    #orgpanel-list[data-collapsed="1"]
    > li:nth-child(n + 4) {
    display: block;
  }
  body[data-theme="v3"]
    #orgpanel-list[data-collapsed="1"]
    > li:nth-child(n + 7) {
    display: none;
  }
}

/* ── V3 AppTabs: reshape JS-rendered grid cards into a single flat white list ── */

/* Outer wrapper: force single column + wrap in white rounded box */
body[data-theme="v3"] #apppanel-mobile > div,
body[data-theme="v3"] #apppanel-web > div {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  padding-bottom: 0 !important;
  overflow: visible !important;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
/* Each app row: remove its own card chrome; dividers come from top-border except first */
body[data-theme="v3"] #apppanel-mobile > div > div,
body[data-theme="v3"] #apppanel-web > div > a {
  width: 100% !important;
  flex: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  background: transparent !important;
  scroll-snap-align: none !important;
}
body[data-theme="v3"] #apppanel-mobile > div > div + div,
body[data-theme="v3"] #apppanel-web > div > a + a {
  border-top: 1px solid #f3f4f6 !important;
}
/* Inner padding container — use flex row layout */
body[data-theme="v3"] #apppanel-mobile > div > div > div,
body[data-theme="v3"] #apppanel-web > div > a > div {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 1rem 1.25rem !important;
}
/* Keep the original header (logo + name/org) as the leftmost flex item */
body[data-theme="v3"] #apppanel-mobile > div > div > div > div.flex.items-start,
body[data-theme="v3"] #apppanel-web > div > a > div > div.flex.items-start {
  margin-bottom: 0 !important;
  flex: 1 1 auto !important;
  min-width: 0;
}
body[data-theme="v3"]
  #apppanel-mobile
  > div
  > div
  > div
  > div.flex.items-start
  img,
body[data-theme="v3"] #apppanel-web > div > a > div > div.flex.items-start img {
  width: 3rem !important;
  height: 3rem !important;
}
/* Hide description/web-badge inside row — not shown in v3 single-row design */
body[data-theme="v3"] #apppanel-mobile > div > div > div > p,
body[data-theme="v3"] #apppanel-web > div > a > div > p,
body[data-theme="v3"]
  #apppanel-web
  > div
  > a
  > div
  > div.flex.items-center.gap-2.mb-3,
body[data-theme="v3"]
  #apppanel-web
  > div
  > a
  > div
  > div.flex.items-center.text-green-600 {
  display: none !important;
}
/* Store button row on right */
body[data-theme="v3"]
  #apppanel-mobile
  > div
  > div
  > div
  > div.flex.items-center.gap-2 {
  margin-top: 0 !important;
  flex-shrink: 0 !important;
}
/* Store button chrome: switch from solid dark to pill outline */
body[data-theme="v3"]
  #apppanel-mobile
  > div
  > div
  > div
  > div.flex.items-center.gap-2
  a,
body[data-theme="v3"]
  #apppanel-mobile
  > div
  > div
  > div
  > div.flex.items-center.gap-2
  span {
  background-color: #ffffff !important;
  color: #4b5563 !important;
  border: 1px solid #e5e7eb !important;
  padding: 0.4rem 0.8rem !important;
  border-radius: 0.5rem !important;
  font-weight: 600 !important;
}
body[data-theme="v3"]
  #apppanel-mobile
  > div
  > div
  > div
  > div.flex.items-center.gap-2
  a:hover {
  background-color: #fdf2f8 !important;
  color: #db2777 !important;
  border-color: #fbcfe8 !important;
}

/* Apps collapsed: hide rows past the 3rd (mobile rows are <div>, web rows are <a>) */
body[data-theme="v3"]
  #apppanel-mobile[data-apps-collapsed="1"]
  > div
  > div:nth-child(n + 4),
body[data-theme="v3"]
  #apppanel-web[data-apps-collapsed="1"]
  > div
  > a:nth-child(n + 4) {
  display: none !important;
}
body[data-theme="v3"]
  [data-org-tab].bg-gray-900
  [data-count-badge].bg-white\/20 {
  background-color: rgba(255, 255, 255, 0.24) !important;
}
/* Apps tab pill: active = white bg + magenta text; inactive = transparent + gray */
body[data-theme="v3"] [data-app-tab][aria-selected="true"] {
  background-color: #ffffff !important;
  color: #db2777 !important;
}
body[data-theme="v3"] [data-app-tab][aria-selected="false"] {
  background-color: transparent !important;
  color: #6b7280 !important;
}

/* ── Accent helper classes (drive off --accent-primary) ──────
   Use these instead of Tailwind text-green-* / bg-green-* in
   partials that should re-skin per theme.
   ============================================================ */
.bkk-accent-text {
  color: var(--accent-primary, #007744);
}
.bkk-accent-text:hover {
  color: var(--accent-primary-hover, #005c33);
}
.bkk-accent-bg {
  background-color: var(--accent-primary, #007744);
}
.bkk-accent-bg:hover {
  background-color: var(--accent-primary-hover, #005c33);
}
.bkk-accent-icon-chip {
  background-color: var(--accent-bg-soft, #dcfce7);
  color: var(--accent-primary, #007744);
}
.bkk-accent-panel-bg {
  background-color: var(--accent-bg-softer, #f0fdf4);
}
.bkk-accent-hover-bg:hover {
  background-color: var(--accent-bg-softer, #f0fdf4);
  color: var(--accent-primary, #007744);
}
.bkk-accent-hover-bg:hover i {
  color: var(--accent-primary, #007744);
}

/* ── Per-theme component helpers ───────────────────────────── */

/* Hero submit button */
.hero-search-submit {
  background: #16a34a;
}
.hero-search-submit:hover,
.hero-search-submit:focus-visible {
  background: #15803d;
}

/* Sao Chingcha — BMA official display font (CI: headings only) */
@font-face {
  font-family: "Sao Chingcha";
  src: url("/public-site/fonts/SaoChingcha-Regular.otf") format("opentype"),
    url("/public-site/fonts/SaoChingcha-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sao Chingcha";
  src: url("/public-site/fonts/SaoChingcha-Bold.otf") format("opentype"),
    url("/public-site/fonts/SaoChingcha-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sao Chingcha";
  src: url("/public-site/fonts/SaoChingcha-Light.otf") format("opentype"),
    url("/public-site/fonts/SaoChingcha-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* Display font class */
.font-display {
  font-family: "Sao Chingcha", "Anuphan", sans-serif;
  font-weight: 700;
}

/* ── Utility Classes ───────────────────────────────────────── */

.bma-green-gradient {
  background: #007744;
}

.header-text-shadow {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
}

/* ── Card Transitions ──────────────────────────────────────── */

.service-card {
  transition: all 0.2s ease;
}
.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.app-card {
  transition: all 0.3s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  border-color: #007744;
}

/* ── Hero Shimmer Animation ────────────────────────────────── */

@keyframes heroShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
.hero-shimmer {
  background: linear-gradient(
    90deg,
    #007744 0%,
    #00c08b 40%,
    #4fc4a4 60%,
    #007744 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroShimmer 4s linear infinite;
}

/* ── GOV.BKK Wordmark Shimmer ──────────────────────────────── */

@keyframes govbkk-shimmer {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}
.govbkk-shimmer-light {
  background: linear-gradient(90deg, #fff 30%, #a8f0d8 50%, #fff 70%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: govbkk-shimmer 4s linear infinite;
}
.govbkk-shimmer-dark {
  background: linear-gradient(90deg, #007744 25%, #00c08b 50%, #007744 75%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: govbkk-shimmer 4s linear infinite;
}

/* ── Custom Scrollbar for Agency Lists ─────────────────────── */

.agency-scroll::-webkit-scrollbar {
  width: 6px;
}
.agency-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.agency-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.agency-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── WCAG 2.4.7 Focus Visible ──────────────────────────────── */

.govbkk-public :focus-visible {
  outline: 2.5px solid #007744;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Accessibility Toolbar ─────────────────────────────────── */

.a11y-toolbar-toggle {
  position: fixed;
  top: 64px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: #007744;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.a11y-toolbar-toggle:hover {
  background: #005c33;
  transform: scale(1.05);
}
.a11y-toolbar-toggle svg {
  width: 22px;
  height: 22px;
  fill: white;
}
.a11y-toolbar {
  position: fixed;
  top: 112px;
  right: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.25);
  padding: 15px;
  z-index: 99998;
  width: 280px;
  max-height: 80vh;
  overflow-y: auto;
}
.a11y-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ffb432;
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.a11y-toolbar-header h4 {
  margin: 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}
.a11y-toolbar-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.a11y-toolbar-close:hover {
  color: #ffb432;
}
.a11y-section {
  margin-bottom: 15px;
}
.a11y-section-title {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}
.a11y-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.a11y-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 120px;
  padding: 10px 8px;
  border: 2px solid #e0e0e0;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  transition: all 0.2s ease;
  font-family: "Anuphan", sans-serif;
}
.a11y-btn:hover {
  border-color: #007744;
  background: #e6f9f3;
}
.a11y-btn.active {
  border-color: #007744;
  background: #007744;
  color: #fff;
}
.a11y-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.a11y-btn.active svg {
  fill: #fff;
}
.a11y-reset {
  width: 100%;
  padding: 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  margin-top: 10px;
  transition: all 0.2s ease;
  font-family: "Anuphan", sans-serif;
}
.a11y-reset:hover {
  background: #007744;
  color: #fff;
}

/* ── Accessibility Applied Styles ──────────────────────────── */

body.a11y-grayscale #a11y-page-wrap {
  filter: grayscale(100%);
}
body.a11y-high-contrast #a11y-page-wrap {
  filter: contrast(200%);
}
body.a11y-negative #a11y-page-wrap {
  filter: invert(100%) hue-rotate(180deg);
}
body.a11y-negative #a11y-page-wrap img,
body.a11y-negative #a11y-page-wrap video {
  filter: invert(100%) hue-rotate(180deg);
}
body.a11y-underline-links #a11y-page-wrap a {
  text-decoration: underline !important;
}
body.a11y-readable-font
  #a11y-page-wrap
  *:not(i):not([class*="fa-"]):not([class*="icon"]) {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.5px;
}

/* ── Carousel Snap ─────────────────────────────────────────── */

.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-container::-webkit-scrollbar {
  display: none;
}
.carousel-slide {
  min-width: 100%;
  scroll-snap-align: start;
}

/* Services grid carousel: force equal-height rows */
.carousel-slide.services-grid-slide {
  grid-template-rows: 1fr 1fr;
  height: 320px;
}
.carousel-slide.services-grid-slide .service-card {
  overflow: hidden;
}

/* ─── Feedback section: modal backdrop blur ─────────────────────── */
.feedback-modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ─── Personalized bar: hide scrollbar in Webkit ───────────────── */
#personalized-bar .overflow-x-auto::-webkit-scrollbar {
  display: none;
}

/* ─── popFloat animation (used by _FeedbackSection green-ci) ────── */
@keyframes popFloat {
  0% {
    opacity: 0;
    transform: translateY(0px) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  85% {
    opacity: 0.4;
    transform: translateY(-60px) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(0.7);
  }
}

/* ─── A11y primitives — skip-link + sr-only (TOR 5.4.3.21 (4)) ──── */
.govbkk-skip-link-public {
  position: absolute;
  left: -10000px;
  top: 0;
  background: #0d6efd;
  color: #fff;
  padding: 8px 16px;
  z-index: 100000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 6px 0;
}
.govbkk-skip-link-public:focus {
  left: 0;
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.govbkk-sr-only-public {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* WCAG 1.4.3 contrast overrides for Bootstrap badges
   - .badge-info  : 2.62:1 -> 4.84:1 via #0e7280
   - .badge-success: 3.13:1 -> 5.13:1 via #1e7e34
*/
.badge-info {
  background-color: #0e7280 !important;
  color: #fff !important;
}
.badge-success {
  background-color: #1e7e34 !important;
  color: #fff !important;
}

/* ─── Language Toggle — global across themes ─────────────────────── */
/* Cookie banner + future cross-theme widgets render paired TH/EN spans
   and rely on this swap. Previously scoped to body[data-theme="standard"]
   only — falcon round-1 BLOCKING #1 unscope. */
.lang-en {
  display: none;
}
body[data-lang="en"] .lang-th {
  display: none;
}
body[data-lang="en"] .lang-en {
  display: inline;
}
body[data-theme="standard"][data-lang="en"] .more-tile[data-soon="1"]::after {
  content: "Coming Soon";
}

/* ─── Cookie Consent Banner ─────────────────────────────────────── */
/* Fixed bottom; z-index above the Dev-Notice ribbon (9999) so the banner
   has CTA priority on first visit. Internal scroll if many categories. */
.govbkk-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 44px; /* clear the dev-notice ribbon */
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  padding: 16px 20px;
  max-height: 70vh;
  overflow-y: auto;
}
.govbkk-cookie-banner[hidden] {
  display: none !important;
}
.govbkk-cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.govbkk-cookie-banner__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 8px 0;
}
.govbkk-cookie-banner__body {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
  margin: 0 0 12px 0;
}
.govbkk-cookie-banner__updated {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 500;
  vertical-align: middle;
}
.govbkk-cookie-banner__updated[hidden] {
  display: none !important;
}
.govbkk-cookie-banner__changelog {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: #475569;
}
.govbkk-cookie-banner__changelog[hidden] {
  display: none !important;
}
.govbkk-cookie-banner__changelog summary {
  cursor: pointer;
  font-weight: 600;
  color: #0d6efd;
  padding: 4px 0;
}
.govbkk-cookie-banner__changelog p {
  margin: 6px 0 0 0;
  padding: 8px 12px;
  background: #f8fafc;
  border-left: 3px solid #0d6efd;
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
}
.govbkk-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.govbkk-cookie-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.govbkk-cookie-btn:focus-visible {
  outline: 2px solid var(--bs-primary, #0d6efd);
  outline-offset: 2px;
}
.govbkk-cookie-btn--primary {
  background: #0d6efd;
  color: #ffffff;
}
.govbkk-cookie-btn--primary:hover {
  background: #0b5ed7;
}
/* Secondary border #6b7280 = 4.06:1 ≥3:1 (WCAG 1.4.11). */
.govbkk-cookie-btn--secondary {
  background: #ffffff;
  color: #1e293b;
  border-color: #6b7280;
}
.govbkk-cookie-btn--secondary:hover {
  background: #f3f4f6;
}
/* Settings button in expanded state — visual feedback that panel is open. */
.govbkk-cookie-btn--active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}
.govbkk-cookie-btn--active:hover {
  background: #0f172a;
  color: #ffffff;
}
.govbkk-cookie-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}
.govbkk-cookie-panel[hidden] {
  display: none !important;
}
.govbkk-cookie-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.govbkk-cookie-panel__row:last-child {
  border-bottom: 0;
}
.govbkk-cookie-panel__check {
  margin-top: 4px;
}
.govbkk-cookie-panel__check:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.govbkk-cookie-panel__meta {
  flex: 1;
  min-width: 0;
}
.govbkk-cookie-panel__name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.92rem;
}
.govbkk-cookie-panel__name small {
  font-weight: 500;
  color: #64748b;
  margin-left: 6px;
}
.govbkk-cookie-panel__detail-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  margin-top: 4px;
  color: #2563eb;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  text-align: left;
}
.govbkk-cookie-panel__detail-btn:hover {
  text-decoration: underline;
}
.govbkk-cookie-panel__detail-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Per-category detail modal — light dependency-free dialog. */
.govbkk-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.govbkk-cookie-modal[hidden] {
  display: none;
}
.govbkk-cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
}
.govbkk-cookie-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.4);
  overflow: hidden;
}
.govbkk-cookie-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.govbkk-cookie-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}
.govbkk-cookie-modal__close {
  background: none;
  border: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
}
.govbkk-cookie-modal__close:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.govbkk-cookie-modal__close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.govbkk-cookie-modal__body {
  padding: 16px 20px;
  overflow-y: auto;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.65;
}
.govbkk-cookie-modal__body p {
  margin: 0;
  white-space: pre-line;
}
.govbkk-cookie-modal__footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  background: #f8fafc;
}

@media (min-width: 768px) {
  .govbkk-cookie-banner__layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
  }
  .govbkk-cookie-banner__copy {
    flex: 1;
  }
  .govbkk-cookie-banner__actions {
    flex-shrink: 0;
    align-items: center;
  }
}

/* Mobile-specific tightening (≤640px). Banner padding compact; CTA buttons
   stretch full-row for thumb-friendly hit target; detail modal becomes
   near-full-screen so 600-char PDPA descriptions don't strangle in a tiny
   dialog. Phase 11e UX. */
@media (max-width: 640px) {
  .govbkk-cookie-banner {
    padding: 12px 14px;
    bottom: 0;
    max-height: 80vh;
  }
  .govbkk-cookie-banner__title {
    font-size: 1rem;
  }
  .govbkk-cookie-banner__updated {
    display: inline-block;
    margin-left: 0;
    margin-top: 4px;
  }
  .govbkk-cookie-banner__body {
    font-size: 0.88rem;
  }
  .govbkk-cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .govbkk-cookie-banner__actions .govbkk-cookie-btn {
    width: 100%;
    text-align: center;
  }
  .govbkk-cookie-panel__row {
    padding: 10px 0;
    gap: 10px;
  }
  .govbkk-cookie-modal {
    padding: 8px;
    align-items: flex-end;
  }
  .govbkk-cookie-modal__dialog {
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
  }
  .govbkk-cookie-modal__header {
    padding: 14px 16px;
  }
  .govbkk-cookie-modal__title {
    font-size: 1rem;
  }
  .govbkk-cookie-modal__body {
    padding: 14px 16px;
    font-size: 0.88rem;
  }
  .govbkk-cookie-modal__footer {
    padding: 10px 16px;
  }
}
/* Popup overlay shows across all themes — language swap must be theme-agnostic */
body[data-lang="en"] #site-popup-overlay .lang-th {
  display: none;
}
body[data-lang="en"] #site-popup-overlay .lang-en {
  display: inline;
}

@media (min-width: 640px) {
  #org-grid-v3-districts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ─── News Section: layout + slide-up animation ─────────────────── */
.news-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .news-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.news-slide-enter {
  animation: slideUpIn 0.4s ease-out both;
}

/* ─── News Detail: responsive main+sidebar layout ───────────────── */
.news-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .news-detail-layout {
    flex-direction: row;
  }
  .news-detail-sidebar {
    width: 288px;
    flex-shrink: 0;
  }
}

/* ─── News Detail: article body (WYSIWYG prose — Summernote output) ─ */
.news-content {
  color: #374151;
  line-height: 1.75;
}
.news-content p {
  margin-bottom: 1rem;
}
.news-content br {
  display: block;
}

/* Headings */
.news-content h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111827;
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}
.news-content h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.35;
}
.news-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.4;
}
.news-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 1rem 0 0.4rem;
}
.news-content h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  margin: 0.75rem 0 0.35rem;
}
.news-content h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0.75rem 0 0.35rem;
}

/* Lists */
.news-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.news-content ol {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.news-content li {
  margin-bottom: 0.25rem;
}
.news-content ul ul,
.news-content ol ul {
  list-style: circle;
}
.news-content ul ul ul,
.news-content ol ol ul {
  list-style: square;
}

/* Inline text */
.news-content strong,
.news-content b {
  font-weight: 600;
  color: #111827;
}
.news-content em,
.news-content i {
  font-style: italic;
}
.news-content u {
  text-decoration: underline;
}
.news-content s,
.news-content del {
  text-decoration: line-through;
  color: #9ca3af;
}
.news-content sup {
  vertical-align: super;
  font-size: 0.75em;
}
.news-content sub {
  vertical-align: sub;
  font-size: 0.75em;
}
.news-content mark {
  background: #fef08a;
  padding: 0 2px;
  border-radius: 2px;
}

/* Links */
.news-content a {
  color: #007744;
  text-decoration: underline;
}
.news-content a:hover {
  color: #005c33;
}

/* Blockquote */
.news-content blockquote {
  border-left: 4px solid #d1fae5;
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  color: #374151;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

/* Horizontal rule */
.news-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0;
}

/* Images */
.news-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1rem auto;
  display: block;
}
.news-content figure {
  margin: 1rem 0;
  text-align: center;
}
.news-content figcaption {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-top: 0.375rem;
}

/* Inline & block code */
.news-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  background: #f3f4f6;
  color: #be185d;
  padding: 1px 5px;
  border-radius: 4px;
}
.news-content pre {
  background: #1e293b;
  color: #e2e8f0;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  white-space: pre;
}
.news-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Tables */
.news-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}
.news-content th,
.news-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.news-content thead th {
  background: #f9fafb;
  font-weight: 700;
  color: #111827;
}
.news-content tbody tr:nth-child(even) {
  background: #fafafa;
}

/* Embedded iframe (YouTube / video) */
.news-content iframe {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
  display: block;
}
.news-content .note-video-clip {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  display: block;
}

/* ─── Featured Slider — clickable slide link ─────────────────────── */
a.news-slide-link {
  text-decoration: none;
}
a.news-slide-link img {
  transition: transform 0.3s ease;
}
a.news-slide-link:hover img {
  transform: scale(1.04);
}

/* ─── Site Popup Carousel (WCAG 2.1 AA) ─────────────────────────── */
#site-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#site-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
#site-popup-container {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  max-width: 520px;
  width: calc(100% - 2rem);
  max-height: 90lvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#site-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #fff;
  border: 2px solid var(--accent-primary, #007744);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--accent-primary, #007744);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#site-popup-close:hover {
  background: #f3f4f6;
  color: var(--accent-primary-hover, #005c33);
  border-color: var(--accent-primary-hover, #005c33);
}
#site-popup-close:focus-visible {
  outline: 3px solid var(--accent-primary, #007744);
  outline-offset: 2px;
}
#site-popup-carousel {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.site-popup-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0;
  flex: 1;
  min-height: 0;
}
.site-popup-slide.active {
  display: flex;
  animation: popup-slide-in 0.28s ease;
}
@keyframes popup-slide-in {
  from {
    opacity: 0;
    transform: translateX(var(--slide-dir, 40px));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.site-popup-slide.active.slide-prev {
  animation: popup-slide-in-prev 0.28s ease;
}
@keyframes popup-slide-in-prev {
  from {
    opacity: 0;
    transform: translateX(calc(var(--slide-dir, 40px) * -1));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.site-popup-image {
  max-width: 100%;
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.site-popup-textbox {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #222;
  padding: 3.25rem 1.5rem 1.5rem; /* top reserves space for font-size toolbar + close btn */
  display: flex;
  flex-direction: column;
}
.site-popup-textbox-inner {
  width: 100%;
  margin: auto 0;
  zoom: var(--popup-font-scale, 1);
}

/* Font-size toolbar (TEXT_BOX popup) — pinned top-left with same margin as close button */
#site-popup-fontsize {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: flex;
  gap: 4px;
}
.site-popup-fontbtn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--accent-primary, #007744);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-primary, #007744);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.site-popup-fontbtn:hover {
  background: #f3f4f6;
}
.site-popup-fontbtn.active {
  background: var(--accent-primary, #007744);
  color: #fff;
}
.site-popup-fontbtn:focus-visible {
  outline: 2px solid var(--accent-primary, #007744);
  outline-offset: 2px;
}

/* Mobile — shrink toolbar so it doesn't crowd the close button on narrow screens */
@media (max-width: 480px) {
  #site-popup-fontsize {
    top: 12px;
    left: 12px;
    gap: 3px;
  }
  .site-popup-fontbtn {
    width: 26px;
    height: 26px;
    border-width: 1px;
    border-radius: 5px;
  }
  .site-popup-fontbtn span {
    font-size: 9px !important;
  }
  .site-popup-fontbtn:nth-child(2) span {
    font-size: 12px !important;
  }
  .site-popup-fontbtn:nth-child(3) span {
    font-size: 15px !important;
  }
  .site-popup-textbox {
    padding: 2.75rem 1rem 1rem;
  }
  #site-popup-close {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-width: 1.5px;
    font-size: 1.15rem;
  }
  #site-popup-nav {
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
  }
  #site-popup-prev,
  #site-popup-next {
    width: 26px;
    height: 26px;
    border-width: 1.5px;
    font-size: 0.9rem;
  }
  #site-popup-dots {
    gap: 5px;
  }
  .site-popup-dot {
    width: 8px;
    height: 8px;
  }
}
.site-popup-suppress {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: #333;
  width: 100%;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.site-popup-suppress-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent-primary, #007744);
  animation: suppress-fill 0.5s ease forwards;
}
@keyframes suppress-fill {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
.site-popup-suppress label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  justify-content: flex-start;
}
.site-popup-suppress input[type="checkbox"] {
  accent-color: var(--accent-primary, #007744);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
#site-popup-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid #e5e7eb;
}
#site-popup-prev,
#site-popup-next {
  background: none;
  border: 2px solid var(--accent-primary, #007744);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary, #007744);
}
#site-popup-prev:hover,
#site-popup-next:hover {
  background: var(--accent-bg-soft, #f0fdf4);
}
#site-popup-prev:focus-visible,
#site-popup-next:focus-visible {
  outline: 3px solid var(--accent-primary, #007744);
  outline-offset: 2px;
}
#site-popup-dots {
  display: flex;
  gap: 6px;
}
.site-popup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.site-popup-dot.active {
  background: var(--accent-primary, #007744);
}
.site-popup-dot:focus-visible {
  outline: 3px solid var(--accent-primary, #007744);
  outline-offset: 2px;
}

/* ─── Banner Carousel (TOR 5.4.3.19) ────────────────────────────── */

/* Section wrapper — white ตรงกับ TrendingServices / ServicesGrid */
.banner-carousel-section {
  background: #ffffff;
}

/* Inner wrapper — horizontal layout handled by Tailwind (container mx-auto px-4…xl:px-28) */
/* Vertical padding ตรงกับ TrendingServices: pt-8 pb-4 */
.banner-carousel-wrapper {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

/* banner-carousel-card / banner-section-header / banner-section-title ถูกลบออกแล้ว
   — carousel แสดงเต็ม container โดยตรง ไม่มีพื้นหลังและไม่มีหัวข้อ */

/* Carousel box — rounded, shadowed, clips slides */
.banner-carousel {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  background: #111;
  aspect-ratio: 16 / 6;
}

/* Slide container — stacking context for fade transitions */
.banner-carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Each slide sits on top of the previous; only .active is shown */
.banner-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.65s ease-in-out;
  pointer-events: none;
}
.banner-carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.banner-carousel-slide a {
  display: block;
  width: 100%;
  height: 100%;
}
.banner-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-carousel-slide iframe,
.banner-carousel-slide video {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* Gradient overlay — readability for title text */
.banner-slide-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.18) 60%, transparent 100%);
  padding: 2.25rem 1.75rem 1.25rem;
  pointer-events: none;
}
.banner-slide-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  /* clamp to 2 lines on small cards */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Navigation arrows */
.banner-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease, background 0.22s ease, transform 0.22s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
  color: #333;
}
.banner-carousel-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
}
.banner-carousel-btn:focus-visible {
  outline: 3px solid var(--accent-primary, #2e7d32);
  outline-offset: 2px;
  opacity: 1;
}
/* Show arrows on carousel hover */
.banner-carousel:hover .banner-carousel-btn { opacity: 1; }
/* Always show on mobile (no hover) */
@media (hover: none) {
  .banner-carousel-btn { opacity: 0.82; }
}
.banner-carousel-btn-prev { left: 14px; }
.banner-carousel-btn-next { right: 14px; }
.banner-carousel-btn svg { width: 20px; height: 20px; pointer-events: none; }

/* Dot indicators */
.banner-carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.banner-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: width 0.3s ease, background 0.3s ease;
}
.banner-carousel-dot.active {
  width: 24px;
  background: #fff;
}
.banner-carousel-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .banner-carousel { aspect-ratio: 16 / 9; border-radius: 10px; }
  .banner-carousel-wrapper { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .banner-slide-title { font-size: 1rem; }
  .banner-carousel-btn { width: 36px; height: 36px; }
  .banner-carousel-btn svg { width: 16px; height: 16px; }
  .banner-carousel-dot { width: 6px; height: 6px; }
  .banner-carousel-dot.active { width: 18px; }
  .banner-slide-overlay { padding: 1.5rem 1rem 0.85rem; }
}

/* Banner Sidebar Strip ถูกยกเลิกแล้ว — CSS ลบออก */

/* Banner Popup Modal ถูกยกเลิกแล้ว — CSS ลบออก */

/* ─── Social Share Modal ─────────────────────────────── */
.govbkk-share-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.govbkk-share-modal[hidden] {
  display: none;
}
.govbkk-share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
}
.govbkk-share-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.4);
  overflow: hidden;
}
.govbkk-share-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.govbkk-share-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}
.govbkk-share-modal__close {
  background: none;
  border: 0;
  padding: 4px 8px;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.govbkk-share-modal__close:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.govbkk-share-modal__close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.govbkk-share-modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.govbkk-share-socials {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 4px 0 8px;
}
.govbkk-share-social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.govbkk-share-social-btn:hover .govbkk-share-social-icon {
  opacity: 0.85;
}
.govbkk-share-social-btn:focus-visible {
  outline: none;
}
.govbkk-share-social-btn:focus-visible .govbkk-share-social-icon {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.govbkk-share-social-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  transition: opacity 0.15s;
}
.govbkk-share-social-label {
  font-size: 0.78rem;
  color: #4b5563;
  font-weight: 500;
}
.govbkk-share-section-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}
.govbkk-share-copylink {
  display: flex;
  gap: 8px;
  align-items: center;
}
.govbkk-share-url-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #374151;
  background: #f8fafc;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
}
.govbkk-share-url-input:focus {
  border-color: #94a3b8;
}
.govbkk-share-copy-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.govbkk-share-copy-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.govbkk-share-copy-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.govbkk-share-qr-container {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.govbkk-share-qr-container canvas,
.govbkk-share-qr-container img {
  border-radius: 8px;
}
.govbkk-share-qr-caption {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}
.govbkk-share-qr-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.govbkk-share-qr-save-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.govbkk-share-qr-save-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .govbkk-share-modal {
    align-items: flex-end;
    padding: 0;
  }
  .govbkk-share-modal__dialog {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
}

/* ── Search autocomplete suggestion rows ─────────────────────────────────────
   Built in govbkk.js (attachSearchSuggestions). Desktop: one row — label takes
   the slack and ellipsis-truncates, meta ("คำใกล้เคียง · บริการ") pinned right.
   Mobile (≤640px): stack vertically so the label gets full width and clamps to
   2 lines (Thai service names differ at the END — "…กรณีเกิดในบ้าน" — so 2 lines
   reveal the distinguishing suffix), with the meta below in a smaller, muted size. */
.gov-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.gov-suggest-label {
  flex: 1 1 auto;
  min-width: 0;            /* let it shrink so ellipsis/clamp engage */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gov-suggest-meta {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .gov-suggest-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
  }
  .gov-suggest-label {
    width: 100%;
    white-space: normal;            /* allow wrapping */
    display: -webkit-box;
    -webkit-line-clamp: 2;          /* up to 2 lines, then ellipsis */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
  }
  .gov-suggest-meta {
    font-size: 0.6875rem;           /* shrink the right-hand meta */
    color: #9ca3af;
  }
}
