/* nfccmi.or.th — public site. Green + sky palette from the CI2 site (logo green, sky header). */
:root {
    --green-900: #123f1c;
    --green-800: #185c27;
    --green-700: #1f6f2c;
    --green-600: #2d7d2a;
    --green-500: #3d9a38;
    --green-100: #dcefd9;
    --green-50: #f0f8ef;
    --sky-700: #155f94;
    --sky-600: #1e88c7;
    --sky-400: #5cc0ec;
    --sky-200: #bfe7f8;
    --sky-50: #eef9fe;
    --ink: #1c2a22;
    --muted: #5a6b62;
    --line: #dce7e0;
    --bg: #f5f9f7;
    --white: #fff;
    --radius: 14px;
    --radius-sm: 10px;
    /* Flat cards: no drop shadows, boxes are separated by a thin border instead. */
    --shadow: none;
    --shadow-hover: none;
    --card-border: 1px solid var(--line);
    --font: "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
    --font-head: "Prompt", "Sarabun", system-ui, sans-serif;
    --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--sky-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-700); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.35; margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--sky-400); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--green-700); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon--xs { width: .95em; height: .95em; }

/* ---------------------------------------------------------------- header */
.topbar { background: var(--green-800); color: #e5f3e3; font-size: 14px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.topbar__contact { display: flex; gap: 18px; }
.topbar a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; }

.site-header { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, #d7f1fc 0%, #f4fbfe 100%); box-shadow: 0 1px 0 var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand img { display: block; width: auto; height: 46px; max-width: 72vw; object-fit: contain; }
.nav-toggle { display: none; align-items: center; gap: 6px; border: 1px solid var(--green-600); background: #fff; color: var(--green-700); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon--close { display: none; }

.site-nav { background: linear-gradient(90deg, var(--green-700), var(--green-600) 55%, var(--sky-700)); }
.site-nav__list { display: flex; justify-content: space-between; list-style: none; margin: 0 auto; padding-top: 0; padding-bottom: 0; max-width: 1440px; }
.site-nav__list a { display: block; padding: 12px 11px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 500; font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent; }
.site-nav__list a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.site-nav__list a.is-active { border-bottom-color: var(--sky-200); background: rgba(255, 255, 255, .14); }

@media (max-width: 1379.98px) {
    .nav-toggle { display: inline-flex; }
    .site-nav { display: none; }
    .site-header.is-open .site-nav { display: block; }
    .site-header.is-open .nav-toggle .icon--open { display: none; }
    .site-header.is-open .nav-toggle .icon--close { display: block; }
    .site-nav__list { flex-direction: column; padding: 6px 12px 12px; }
    .site-nav__list a { padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, .14); border-left: 3px solid transparent; font-size: 16px; }
    .site-nav__list a.is-active { border-bottom-color: rgba(255, 255, 255, .14); border-left-color: var(--sky-200); }
    .site-header.is-open { max-height: 100vh; overflow-y: auto; }
}
@media (max-width: 575.98px) {
    body { font-size: 16px; }
    .topbar__org { display: none; }
    .topbar__inner { justify-content: center; }
    .topbar__contact span { font-size: 13px; }
    .brand img { height: 36px; }
    .nav-toggle__label { display: none; }
}
@media (max-width: 380px) { .topbar a[href^="mailto"] { display: none; } }

/* ---------------------------------------------------------------- page hero */
.page-hero { background: linear-gradient(115deg, var(--green-700) 0%, var(--green-600) 45%, var(--sky-600) 100%); color: #fff; padding: 26px 0 30px; }
.page-hero__title { margin: 6px 0 0; font-size: clamp(24px, 3.2vw, 34px); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; opacity: .92; }
.breadcrumb a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- layout */
.site-main { padding-bottom: 48px; }
.is-inner .site-main { padding-top: 28px; }
.layout-inner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.layout-inner__content > * + * { margin-top: 20px; }
@media (max-width: 991.98px) { .layout-inner { grid-template-columns: minmax(0, 1fr); } }

.sidebar { display: grid; gap: 18px; }
@media (max-width: 991.98px) { .sidebar { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.side-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.side-card__title { margin: 0; padding: 12px 16px; font-size: 16px; color: #fff; background: linear-gradient(90deg, var(--green-700), var(--sky-700)); }
.side-menu { list-style: none; margin: 0; padding: 6px 0; }
.side-menu a { display: flex; gap: 6px; align-items: flex-start; padding: 8px 16px; color: var(--ink); text-decoration: none; font-size: 15.5px; line-height: 1.45; }
.side-menu a .icon { color: var(--green-500); margin-top: 3px; width: 14px; height: 14px; }
.side-menu a:hover, .side-menu a.is-active { background: var(--green-50); color: var(--green-800); }
.side-menu a.is-active { font-weight: 600; box-shadow: inset 3px 0 0 var(--green-600); }

/* ---------------------------------------------------------------- sections */
.section { padding: 44px 0; }
.section--tint { background: linear-gradient(180deg, var(--sky-50), var(--green-50)); }
.section--services { padding: 28px 0 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: clamp(20px, 2.4vw, 25px); color: var(--green-800); }
.section-head .section-title { margin: 0; }
.section-title .icon { color: var(--sky-600); }
.section-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--green-700); white-space: nowrap; }
.section-more:hover { color: var(--sky-700); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px; }
.home-grid--price { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 991.98px) { .home-grid, .home-grid--price { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- hero slider */
.hero { padding: 24px 0 0; }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--green-900); }
.slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.slider__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; display: flex; scroll-snap-align: start; }
.slide__link { flex: 1; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); min-height: 380px; color: #fff; text-decoration: none; }
.slide__media { position: relative; overflow: hidden; background: #0e2f16; }
.slide__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.55); transform: scale(1.15); }
.slide__img { position: relative; display: block; width: 100%; height: 100%; max-height: 460px; object-fit: contain; }
.slide__caption { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 32px 36px; background: linear-gradient(135deg, var(--green-700), var(--sky-700)); }
.slide__caption h2 { margin: 0; font-size: clamp(19px, 2.2vw, 26px); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.slide__caption .meta { color: #d9f1e0; }
.slide__more { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 6px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-weight: 600; }
.slide__link:hover .slide__more { background: #fff; color: var(--green-800); }
.slider__btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--green-800); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.slider__btn--prev { left: 12px; }
.slider__btn--next { right: 12px; }
.slider__btn .icon { width: 22px; height: 22px; }
.slider__dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.slider__dots button { pointer-events: auto; width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .2s; }
.slider__dots button[aria-current="true"] { width: 26px; background: #fff; }
/* Many slides (37 like the CI2 carousel): the dot row wraps instead of running off the slide. */
.slider__dots { flex-wrap: wrap; padding: 0 56px; row-gap: 6px; }
@media (max-width: 575.98px) { .slider__dots { gap: 6px; padding: 0 16px; } .slider__dots button { width: 8px; height: 8px; } .slider__dots button[aria-current="true"] { width: 20px; } }
@media (max-width: 767.98px) {
    .slide__link { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; }
    .slide__img { max-height: 300px; min-height: 200px; }
    .slide__caption { padding: 18px 20px 40px; }
    .slider__btn { width: 38px; height: 38px; top: 150px; }
}

/* ---------------------------------------------------------------- services */
.service-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.service { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; text-align: center; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.4; transition: transform .15s, box-shadow .15s; }
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--green-800); }
.service__icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--green-600), var(--sky-600)); }
.service__icon .icon { width: 28px; height: 28px; }
@media (max-width: 1199.98px) { .service-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .service { padding: 14px 8px; font-size: 14.5px; } }

/* ---------------------------------------------------------------- cards */
.card-grid { display: grid; gap: 20px; }
.card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .card-grid--3, .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .card-grid--2, .card-grid--3 { grid-template-columns: 1fr; } .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card__media { aspect-ratio: 16 / 10; background: var(--green-50); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__media--book { aspect-ratio: 3 / 4; background: var(--sky-50); }
.card__media--book img { object-fit: contain; }
.card__placeholder { display: grid; place-items: center; height: 100%; color: var(--green-500); }
.card__placeholder .icon { width: 48px; height: 48px; opacity: .6; }
.card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { margin: 0; font-size: 17px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__text { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__link:hover .card__title { color: var(--green-700); }
.card__cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--sky-700); font-weight: 600; font-size: 15px; }
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.meta .icon { color: var(--green-500); }

/* ---------------------------------------------------------------- lists */
.doc-list { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-list li + li { border-top: 1px solid var(--line); }
.doc-list a { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.doc-list a:hover { background: var(--green-50); }
.doc-list__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--sky-50); color: var(--sky-700); }
.doc-list__title { display: block; font-weight: 600; line-height: 1.5; }
.doc-list a:hover .doc-list__title { color: var(--green-700); }
.doc-list__text { display: block; color: var(--muted); font-size: 15px; }
.doc-list__ext { margin-left: auto; color: var(--muted); }
.list-count { margin: 0; color: var(--muted); font-size: 15px; }

.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); word-break: break-all; }
.file-list a:hover { border-color: var(--green-500); background: var(--green-50); }
.file-list .icon { color: var(--green-600); }

.chip-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.chip { display: flex; align-items: center; gap: 8px; height: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; background: var(--white); }
.chip .icon { color: var(--green-600); }
.chip:hover { border-color: var(--green-500); background: var(--green-50); color: var(--green-800); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.tabs a:hover { border-color: var(--green-500); color: var(--green-700); }
.tabs a.is-active { background: var(--green-600); border-color: var(--green-600); color: #fff; }

/* ---------------------------------------------------------------- content */
.content-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; }
.content-card--flush { padding: 0; overflow: hidden; }
.content-card__title { display: flex; align-items: center; gap: 8px; font-size: 21px; color: var(--green-800); }
.content-card__title .icon { color: var(--sky-600); }
.content-card__cover { display: block; width: 100%; border-radius: var(--radius-sm); margin-bottom: 18px; }
@media (max-width: 575.98px) { .content-card { padding: 18px 16px; } }
.lead { font-size: 18px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.prose { overflow-wrap: anywhere; display: flow-root; } /* flow-root: CKEditor floated images stay inside the card */
.prose > :first-child { margin-top: 0; }
.prose img { max-width: 100% !important; height: auto !important; border-radius: 8px; }
.prose iframe { max-width: 100%; }
.prose iframe[src*="youtube"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose p { margin: 0 0 1em; }
.prose h1, .prose h2, .prose h3 { color: var(--green-800); }
.prose--compact { font-size: 16px; }
.prose--compact img { max-height: 280px; width: auto; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; max-width: 100%; margin: 0 0 1em; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }

.gallery { margin-top: 24px; }
.gallery__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery__grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------- tables */
.price-table, .data-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 16px; }
.price-table th, .price-table td, .data-table th, .data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.price-table thead th, .data-table thead th { background: var(--green-700); color: #fff; font-family: var(--font-head); font-weight: 500; font-size: 15px; white-space: nowrap; position: sticky; top: 0; }
.price-table .num, .data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table .unit { color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.price-table .no { width: 48px; color: var(--muted); text-align: center; }
.price-table tbody tr:hover td, .data-table tbody tr:hover td, .data-table tbody tr:hover th { background: var(--sky-50); }
.price-table__group th { background: var(--green-50) !important; color: var(--green-800) !important; font-family: var(--font-head); font-weight: 600; }
.home-grid .price-table { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table tbody th { font-weight: 600; white-space: nowrap; }
.data-table a { font-weight: 600; text-decoration: none; }

@media (max-width: 767.98px) {
    /* Price and district tables become labelled cards on phones. */
    .price-table--full thead, .data-table--stack thead { display: none; }
    .price-table--full, .price-table--full tbody, .price-table--full tr, .price-table--full td,
    .data-table--stack, .data-table--stack tbody, .data-table--stack tr, .data-table--stack td, .data-table--stack th { display: block; width: 100%; }
    .price-table--full tr:not(.price-table__group), .data-table--stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .price-table--full td, .data-table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
    .price-table--full td::before, .data-table--stack td::before { content: attr(data-label); color: var(--muted); text-align: left; font-size: 14.5px; }
    .price-table--full td.name { font-weight: 700; font-size: 17px; }
    .price-table--full td.name::before, .price-table--full td.no { display: none; }
    .price-table__group th { display: block; padding: 10px 14px; }
    .data-table--stack th[scope="row"] { padding: 0 0 6px; font-size: 17px; color: var(--green-800); border: 0; }
}

.price-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 22px; }
.price-toolbar__date { margin: 0; font-size: 17px; }
.price-toolbar__date .icon { color: var(--green-600); margin-right: 6px; }
.price-toolbar__controls { display: flex; flex-wrap: wrap; gap: 10px; }
.price-toolbar select, .search-field input { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.search-field { position: relative; display: block; }
.search-field .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-left: 36px; width: 220px; max-width: 100%; }
@media (max-width: 575.98px) { .price-toolbar__controls, .price-toolbar__controls form, .search-field, .search-field input, .price-toolbar select { width: 100%; } }

.message-card { background: var(--white); border-radius: var(--radius); padding: 22px 24px; }

/* ---------------------------------------------------------------- links */
.agency-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.agency { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; text-align: center; }
.agency .icon { width: 34px; height: 34px; color: var(--sky-600); }
.agency:hover { color: var(--green-700); box-shadow: var(--shadow-hover); }
@media (max-width: 991.98px) { .agency-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.partner-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.partner-grid a { display: block; background: var(--white); border-radius: var(--radius-sm); padding: 6px; box-shadow: var(--shadow); }
.partner-grid img { display: block; width: 100%; height: auto; }
@media (max-width: 991.98px) { .partner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--green-600), var(--sky-600)); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { color: #fff; filter: brightness(1.07); box-shadow: var(--shadow-hover); }
.btn--outline { background: #fff; color: var(--green-700); border: 1px solid var(--green-600); }
.btn--outline:hover { color: var(--green-800); background: var(--green-50); }
.btn--sm { padding: 6px 12px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 767.98px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 575.98px) { .form__row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid #c9d8cf; border-radius: var(--radius-sm); background: #fff; }
.field input:focus, .field textarea:focus { border-color: var(--sky-600); outline: 3px solid var(--sky-200); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: #c2410c; }
.field__error { margin: 6px 0 0; color: #b42318; font-size: 14.5px; }
.field__hint { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.req { color: #b42318; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; }
.alert--success { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); }
.alert--error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.contact-info p { display: flex; gap: 8px; align-items: flex-start; }

/* ---------------------------------------------------------------- pagination */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-weight: 600; }
.pagination a:hover { color: var(--green-700); }
.pagination .is-current { background: var(--green-600); color: #fff; }
.pagination .pagination__gap { background: none; box-shadow: none; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: linear-gradient(160deg, var(--green-900), #10402f 60%, #0e3a52); color: #d6e6dc; font-size: 15.5px; }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 30px; }
@media (max-width: 767.98px) { .site-footer__grid { grid-template-columns: 1fr; gap: 20px; } }
.site-footer__logo { display: block; width: auto; max-width: 100%; height: 40px; margin-bottom: 14px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .92); }
.site-footer p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; }
.site-footer .icon { color: var(--sky-400); margin-top: 3px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__title { font-size: 17px; color: #fff; margin-bottom: 10px; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 0; font-size: 14px; color: #a9c3b4; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
.hero__more { margin: 10px 0 0; text-align: right; }

/* ---------------------------------------------------------------- flat cards (no box-shadow) */
.side-card, .card, .service, .doc-list, .content-card, .empty, .message-card, .agency, .partner-grid a, .pagination a, .pagination span:not(.pagination__gap), .home-grid .price-table, .slider { border: var(--card-border); }
.card:hover, .service:hover, .agency:hover, .partner-grid a:hover { border-color: var(--green-500); }
.card:hover, .service:hover { transform: none; }
.slider__btn { border: 1px solid var(--line); }

/* ---------------------------------------------------------------- images: never distorted, never cropped or spilling */
.card__media { display: grid; place-items: center; background: linear-gradient(135deg, var(--green-50), var(--sky-50)); }
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.card:hover .card__media img { transform: none; }
.gallery__grid a { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: var(--green-50); border: var(--card-border); overflow: hidden; }
.gallery__grid img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; border-radius: 0; }
.content-card__cover { width: auto; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; }
.prose img { max-width: 100% !important; height: auto !important; object-fit: contain; }
.prose--compact img { max-height: 280px !important; width: auto !important; }
.side-card__body.prose img { display: block; margin-left: auto; margin-right: auto; }
.prose table img { max-width: 100% !important; }
.partner-grid img { object-fit: contain; }

/* ---------------------------------------------------------------- content typography (sizes normalised by site_content()) */
.prose { font-size: 17px; line-height: 1.75; }
.prose font[size] { font-size: inherit; }
.prose h1 { font-size: 1.5em; }
.prose h2 { font-size: 1.3em; }
.prose h3, .prose h4 { font-size: 1.15em; }
@media (max-width: 575.98px) { .prose { font-size: 16px; } }

/* ---------------------------------------------------------------- scrollable tables: drag hint */
.table-wrap { position: relative; }
.table-wrap.is-scrollable { cursor: grab; }
.table-wrap.is-dragging { cursor: grabbing; user-select: none; }
.scroll-hint { position: sticky; left: 0; display: flex; justify-content: flex-end; height: 0; pointer-events: none; z-index: 2; }
.scroll-hint__badge { display: inline-flex; align-items: center; gap: 8px; margin: 8px 8px 0 0; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(18, 63, 28, .86); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; transition: opacity .3s; }
.scroll-hint__badge svg { width: 26px; height: 26px; animation: scroll-hint-swipe 1.6s ease-in-out infinite; }
.table-wrap.is-scrolled .scroll-hint__badge { opacity: 0; }
@keyframes scroll-hint-swipe { 0%, 100% { transform: translateX(4px); } 50% { transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint__badge svg { animation: none; } }

/* ---------------------------------------------------------------- Thai paragraph indent */
.prose p { text-indent: 2em; }
.prose p[style*="center"], .prose p[style*="right"], .prose p:has(> img:first-child), .prose p:has(> a:first-child > img),
.prose li p, .prose td p, .prose--compact p { text-indent: 0; }
.prose .indent { display: inline-block; width: 2em; }

/* ---------------------------------------------------------------- misc */
.agency img { width: 48px; height: 48px; object-fit: contain; }
.price-toolbar__controls form { display: flex; gap: 8px; }
.not-found { text-align: center; }
.not-found__code { margin: 0; font-family: var(--font-head); font-size: 64px; font-weight: 600; line-height: 1.1; color: var(--green-600); }
.not-found .actions { justify-content: center; }

/* ---------------------------------------------------------------- executives + image banners */
.section--people { padding: 32px 0 8px; }
.people-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 767.98px) { .people-grid { grid-template-columns: minmax(0, 1fr); } }
.executive-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.executive { text-align: center; background: var(--white); border: var(--card-border); border-radius: var(--radius); padding: 12px 12px 14px; }
.executive__photo { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.executive__photo img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.executive__name { margin: 10px 0 0; font-family: var(--font-head); font-weight: 600; color: var(--green-800); }
.executive__position { margin: 2px 0 0; font-size: 14.5px; color: var(--muted); line-height: 1.45; }
.banner-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.banner-links--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.banner-links--side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.banner-links a, .banner-links li > img { display: block; border-radius: var(--radius-sm); overflow: hidden; border: var(--card-border); background: var(--white); }
.banner-links img { display: block; width: 100%; height: auto; object-fit: contain; }
.banner-links a:hover { border-color: var(--green-500); }

/* ---------------------------------------------------------------- visitor stats */
.visitor-stats { border-top: 1px solid rgba(255, 255, 255, .12); padding: 22px 0 26px; }
.visitor-stats__grid { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.visitor-stats__grid div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; }
.visitor-stats__grid dt { font-size: 13.5px; color: #b9d3c3; }
.visitor-stats__grid dd { margin: 2px 0 0; font-family: var(--font-head); font-size: 20px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) { .visitor-stats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- lightbox */
.gallery__grid a, .prose img.is-zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(8, 20, 12, .92); padding: 56px 64px; }
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; }
.lightbox__btn { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--green-800); cursor: pointer; }
.lightbox__btn .icon { width: 24px; height: 24px; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #e5f3e3; font-size: 14px; }
@media (max-width: 575.98px) { .lightbox { padding: 60px 8px 44px; } .lightbox__prev, .lightbox__next { top: auto; bottom: 6px; transform: none; } }

/* ---------------------------------------------------------------- home: main column + right sidebar */
.home-main > section + section { margin-top: 36px; }
.layout-inner--home { align-items: start; }
.side-card__body { padding: 14px 16px; }
.executives-card .executive-list { padding: 12px; grid-template-columns: 1fr; gap: 12px; }
.executives-card .executive { border: 0; padding: 0; }
@media (max-width: 991.98px) { .executives-card .executive-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- motion (fade in / fade out)
   Only active when <html> has .motion (set in the <head> when reduced motion is off).
   Uses the `translate` property so it never fights the `transform` hover lift on cards. */
@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
.motion body { animation: page-fade-in .5s ease-out backwards; overflow-x: clip; } /* clip: slide-in offsets never widen the page */
.motion.is-leaving body { opacity: 0; transition: opacity .25s ease-in; }
.motion [data-reveal] { opacity: 0; translate: 0 26px; transition: opacity .7s ease, translate .7s cubic-bezier(.2, .7, .2, 1), transform .15s, box-shadow .15s; transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s; }
.motion [data-reveal].is-visible { opacity: 1; translate: none; }

/* ---------------------------------------------------------------- footer credit */
.site-footer__bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.site-footer__credit a { color: #d6e8dc; text-decoration: none; font-weight: 600; }
.site-footer__credit a:hover, .site-footer__credit a:focus-visible { color: #fff; text-decoration: underline; }

/* ---------------------------------------------------------------- home popup (admin: POP UP) */
.popup { padding: 0; border: 0; background: transparent; max-width: min(92vw, 760px); max-height: 92vh; overflow: visible; }
.popup::backdrop { background: rgba(10, 30, 16, .72); }
.popup__item img { display: block; max-width: 100%; max-height: 80vh; width: auto; height: auto; margin: 0 auto; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.popup__close, .popup__nav { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: #fff; color: var(--green-800); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; z-index: 1; }
.popup__close { top: -14px; right: -14px; }
.popup__nav { top: 50%; margin-top: -22px; }
.popup__nav--prev { left: -14px; }
.popup__nav--next { right: -14px; }
.popup__close:hover, .popup__nav:hover { background: var(--green-50); }
.popup__close:focus-visible, .popup__nav:focus-visible { outline: 3px solid var(--sky-600); outline-offset: 2px; }
.popup__count { margin: 10px 0 0; text-align: center; color: #fff; font-size: 14px; }
@media (max-width: 575.98px) { .popup__close { top: -10px; right: -6px; } .popup__nav--prev { left: -6px; } .popup__nav--next { right: -6px; } }
@media (prefers-reduced-motion: no-preference) {
    .popup[open] { animation: popup-in .42s cubic-bezier(.22, 1, .36, 1); }
    .popup[open]::backdrop { animation: page-fade-in .42s ease-out; }
    @keyframes popup-in { from { opacity: 0; transform: scale(.96); } }
}

/* ---------------------------------------------------------------- share + QR (site/partials/share) */
.share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.share__main { flex: 1 1 320px; min-width: 0; }
.share__title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 18px; color: var(--green-800); }
.share__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.share__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.share__btn:hover { background: var(--green-50); border-color: var(--green-500); color: var(--green-800); }
.share__btn--facebook .icon { color: #1877f2; }
.share__btn--line .icon { color: #06c755; }
.share__btn:focus-visible, .share__qr-save:focus-visible { outline: 3px solid var(--sky-600); outline-offset: 2px; }
.share__qr { flex: none; margin: 0; padding: 12px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.share__qr-code { width: 148px; height: 148px; margin: 0 auto; }
.share__qr-code svg { display: block; width: 100%; height: 100%; }
.share__qr figcaption { margin: 6px 0 8px; font-size: 14px; color: var(--muted); }
.share__qr-save { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 0; border-radius: 999px; background: var(--green-700); color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.share__qr-save:hover { background: var(--green-800); }
@media (max-width: 575.98px) {
    .share { flex-direction: column; align-items: stretch; }
    .share__main { flex: none; }
    .share__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .share__btn { width: 48px; height: 48px; padding: 0; justify-content: center; }
    .share__btn .icon { width: 22px; height: 22px; }
    .share__qr { align-self: center; }
}
@media print { .share__list, .share__qr-save { display: none; } }

/* ---------------------------------------------------------------- full-width inner page + contact map */
.layout-inner--full { grid-template-columns: minmax(0, 1fr); }
.contact-map { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--green-50); }
.contact-map iframe { display: block; width: 100%; height: 420px; border: 0; }
@media (max-width: 575.98px) { .contact-map iframe { height: 320px; } }

/* ---------------------------------------------------------------- tap targets (WCAG 2.2 AA: 24px minimum) */
.topbar__contact a { display: inline-flex; align-items: center; min-height: 28px; }
.site-footer__links a { display: inline-block; padding: 3px 0; }
.data-table a { display: inline-block; padding: 2px 0; }

/* ---------------------------------------------------------------- right sidebar drawer (phones/tablets)
   Like nonghoicm.go.th: below 992px the sidebar leaves the page flow and opens from a floating
   "ข้อมูลเพิ่มเติม" button. Only with JS (html.has-drawer); without it the sidebar stays in the page. */
.sidebar__head, .sidebar-fab, .sidebar-overlay { display: none; }
@media (max-width: 991.98px) {
    .has-drawer .sidebar { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100; width: min(380px, 88vw); display: block; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 28px; background: var(--green-50); box-shadow: -12px 0 32px rgba(0, 0, 0, .22); transform: translateX(105%); visibility: hidden; transition: transform .3s ease, visibility .3s; }
    .has-drawer .sidebar > * + * { margin-top: 18px; }
    .has-drawer.sidebar-open .sidebar { transform: none; visibility: visible; }
    .has-drawer.sidebar-open body { overflow: hidden; }
    .has-drawer .sidebar__head { display: flex; position: sticky; top: 0; z-index: 1; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -14px 16px; padding: 10px 10px 10px 16px; background: linear-gradient(90deg, var(--green-700), var(--sky-700)); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 17px; }
    .sidebar__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
    .sidebar__close:hover { background: rgba(255, 255, 255, .28); }
    .has-drawer .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 1090; background: rgba(10, 30, 16, .5); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
    .has-drawer.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    /* Vertical tab on the right edge, middle of the screen. */
    .has-drawer .sidebar-fab { display: flex; flex-direction: column; align-items: center; gap: 6px; position: fixed; right: 0; top: 50%; z-index: 1080; transform: translateY(-50%); width: 40px; padding: 12px 0; border: 0; border-radius: 12px 0 0 12px; background: linear-gradient(180deg, var(--green-700), var(--sky-700)); color: #fff; font: inherit; font-weight: 600; font-size: 14px; letter-spacing: .02em; box-shadow: -4px 4px 16px rgba(18, 63, 28, .3); cursor: pointer; transition: width .2s; }
    .has-drawer .sidebar-fab span { writing-mode: vertical-rl; }
    .has-drawer .sidebar-fab .icon { width: 20px; height: 20px; }
    .has-drawer .sidebar-fab:hover { width: 46px; }
    .sidebar__close:focus-visible, .sidebar-fab:focus-visible { outline: 3px solid var(--sky-400); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) { .has-drawer .sidebar, .has-drawer .sidebar-overlay { transition: none; } }

/* Form fields never push the page wider than the screen (contact form at 320px). */
.form__row > *, .field { min-width: 0; }
.field input, .field textarea, .field select { box-sizing: border-box; max-width: 100%; min-width: 0; }

/* Farmer database: district picture ("ข้อมูลทั่วไป", like CI2 database2.html) */
.district-thumb { text-align: center; }
.district-thumb img { display: block; height: 80px; width: auto; max-width: 140px; margin: 0 auto; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.district-thumb a:hover img { border-color: var(--green-500); }
@media (max-width: 767.98px) { .district-thumb img { margin: 0; } }
