/* ==========================================================================
   Gov Template for Joomla! 5.x
   All colours come from CSS custom properties written by index.php,
   so the whole look can be re-skinned from the template options screen.
   ========================================================================== */

:root {
	--my-primary: #1b5fa8;
	--my-dark: #10427a;
	--my-light: #2e80d6;
	--my-accent: #f0a020;
	--my-footer-bg: #16243c;
	--my-container: 1200px;
	--my-font-size: 16px;
	--my-font: 'Sarabun', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
	--my-pagehero-h: 220px;

	--my-ink: #1f2937;
	--my-muted: #6b7280;
	--my-line: #e5e7eb;
	--my-bg: #f4f7fb;
	--my-card: #ffffff;
	--my-radius: 14px;
	--my-radius-sm: 8px;
	--my-shadow: 0 2px 14px rgba(16, 40, 80, .08);
	--my-shadow-lg: 0 10px 34px rgba(16, 40, 80, .14);
	--my-scale: 1;
}

/* --------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.my-site {
	margin: 0;
	font-family: var(--my-font);
	font-size: calc(var(--my-font-size) * var(--my-scale));
	line-height: 1.7;
	color: var(--my-ink);
	background: var(--my-bg);
	-webkit-font-smoothing: antialiased;
}

body.my-site img { max-width: 100%; height: auto; }

a { color: var(--my-primary); text-decoration: none; }
a:hover { color: var(--my-ink-strong, var(--my-dark)); text-decoration: underline; }

h1, h2, h3, h4, h5 { font-family: var(--my-font); font-weight: 700; line-height: 1.35; color: #13203a; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.visually-hidden {
	position: absolute !important; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--my-accent); outline-offset: 2px; }

/* ---------------------------------------------------------- utilities --- */
.my-container {
	width: 100%;
	max-width: var(--my-container);
	margin-inline: auto;
	padding-inline: 16px;
}

.my-row { display: flex; flex-wrap: wrap; margin-inline: -12px; }
.my-col { padding-inline: 12px; width: 100%; }
.my-col--main { width: 100%; }
.my-col--3 { width: 25%; }
.my-col--4 { width: 33.3333%; }
.my-col--6 { width: 50%; }
.my-col--8 { width: 66.6667%; }
.my-col--9 { width: 75%; }
.my-col--12 { width: 100%; }

.my-section { padding-block: 40px; }
.my-section--feature { padding-block: 32px; }

/* ---------------------------------------------------------- skip link --- */
.my-skip {
	position: absolute; left: -9999px; top: 0; z-index: 2000;
	background: var(--my-accent); color: #1b1b1b; padding: 10px 18px; font-weight: 600;
}
.my-skip:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------------- header --- */
.my-header { background: #fff; position: relative; z-index: 50; }
body[data-sticky="1"] .my-header { position: sticky; top: 0; }
body[data-sticky="1"].my-scrolled .my-header { box-shadow: 0 4px 18px rgba(16, 40, 80, .12); }

.my-topbar {
	background: linear-gradient(90deg, var(--my-dark), var(--my-primary));
	color: var(--my-on-primary, #e8f1fb); font-size: .82rem;
}
.my-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.my-topbar a { color: var(--my-on-primary, #fff); }

.my-a11y { display: flex; gap: 6px; }
.my-a11y__btn {
	border: 1px solid color-mix(in srgb, var(--my-on-primary, #fff) 45%, transparent); background: transparent; color: var(--my-on-primary, #fff);
	width: 28px; height: 24px; border-radius: 6px; cursor: pointer; font-size: .78rem;
	display: inline-flex; align-items: center; justify-content: center; padding: 0;
	font-family: var(--my-font);
}
.my-a11y__btn:hover { background: color-mix(in srgb, var(--my-on-primary, #fff) 18%, transparent); }

/*
 * Background of the logo / organisation-name strip. The value is written by
 * index.php and can be a solid colour, an rgba() tint, or a gradient.
 */
.my-brandbar {
	background: var(--my-brandbar-bg, #fff);
	border-bottom: var(--my-brandbar-border, 0);
}

/* "โปร่งใส": let the page background show through the whole header. */
.my-brandbar.is-transparent { background: transparent; }
.my-header--transparent { background: transparent; }

.my-brandbar__inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding-block: 12px;
}

.my-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.my-brand:hover { text-decoration: none; }
.my-brand__logo { display: block; height: auto; }
.my-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.my-brand__name { font-size: 1.32rem; font-weight: 700; color: var(--my-ink-strong, var(--my-dark)); }
.my-brand__sub { font-size: .84rem; color: var(--my-muted); }

.my-brandbar__tools { display: flex; align-items: center; gap: 10px; }

.my-search__form { display: flex; align-items: center; background: #eef3f9; border-radius: 999px; padding: 3px 3px 3px 14px; }
.my-search__input {
	border: 0; background: transparent; outline: none; width: 190px;
	font-family: var(--my-font); font-size: .88rem; color: var(--my-ink); padding: 5px 0;
}
.my-search__btn {
	border: 0; width: 32px; height: 32px; border-radius: 50%;
	background: var(--my-primary); color: var(--my-on-primary, #fff); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.my-search__btn:hover { background: var(--my-dark); }

/* Light text, used when the brand bar sits on a dark colour or gradient. */
.my-brandbar.is-light .my-brand__name { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.my-brandbar.is-light .my-brand__sub { color: rgba(255, 255, 255, .85); }

.my-brandbar.is-light .my-search__form {
	background: rgba(255, 255, 255, .16);
	border: 1px solid rgba(255, 255, 255, .3);
	backdrop-filter: blur(4px);
}
.my-brandbar.is-light .my-search__input { color: #fff; }
.my-brandbar.is-light .my-search__input::placeholder { color: rgba(255, 255, 255, .7); }
.my-brandbar.is-light .my-search__btn { background: rgba(255, 255, 255, .9); color: var(--my-ink-strong, var(--my-dark)); }
.my-brandbar.is-light .my-search__btn:hover { background: #fff; }

.my-brandbar.is-light .my-iconbtn,
.my-brandbar.is-light .my-navtoggle {
	background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
}
.my-brandbar.is-light .my-iconbtn:hover,
.my-brandbar.is-light .my-navtoggle:hover { background: rgba(255, 255, 255, .3); }

.my-iconbtn {
	width: 34px; height: 34px; border-radius: 8px; background: var(--my-primary); color: var(--my-on-primary, #fff);
	display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
}
.my-iconbtn:hover { background: var(--my-dark); color: var(--my-on-primary, #fff); text-decoration: none; }

.my-navtoggle {
	display: none; border: 0; background: var(--my-primary); color: var(--my-on-primary, #fff);
	width: 38px; height: 34px; border-radius: 8px; cursor: pointer;
}

/* --------------------------------------------------------------- nav ---- */
.my-nav { background: linear-gradient(90deg, var(--my-dark), var(--my-primary) 55%, var(--my-light)); }
.my-nav__inner { display: flex; align-items: center; gap: 10px; }

.my-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.my-nav ul li { position: relative; }
.my-nav ul li > a,
.my-nav ul li > span.separator {
	display: flex; align-items: center; gap: 7px;
	padding: 12px 16px; color: var(--my-on-primary, #fff); font-size: .95rem; font-weight: 500;
	white-space: nowrap; transition: background .15s ease;
}
.my-nav ul li > a:hover,
.my-nav ul li:focus-within > a { background: color-mix(in srgb, var(--my-on-primary, #fff) 16%, transparent); text-decoration: none; color: var(--my-on-primary, #fff); }
.my-nav ul li.current > a,
.my-nav ul li.active > a { background: color-mix(in srgb, var(--my-on-primary, #fff) 24%, transparent); }

/* dropdowns */
.my-nav ul ul {
	display: none; position: absolute; top: 100%; left: 0; min-width: 230px;
	background: #fff; border-radius: 0 0 var(--my-radius-sm) var(--my-radius-sm);
	box-shadow: var(--my-shadow-lg); padding: 6px 0; flex-direction: column; z-index: 60;
}
.my-nav ul li:hover > ul,
.my-nav ul li:focus-within > ul { display: flex; }
.my-nav ul ul li > a { color: var(--my-ink); padding: 9px 16px; font-weight: 400; }
.my-nav ul ul li > a:hover { background: #eef4fb; color: var(--my-primary); }
.my-nav ul ul ul { top: 0; left: 100%; border-radius: var(--my-radius-sm); }

/* ---------------------------------------------------------- page hero --- */
.my-pagehero {
	position: relative; min-height: var(--my-pagehero-h);
	background-size: cover; background-position: center;
	display: flex; align-items: center; color: #fff;
}
.my-pagehero__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(90deg, color-mix(in srgb, var(--my-dark, #10427a) 86%, transparent), color-mix(in srgb, var(--my-primary, #1b5fa8) 62%, transparent));
}
.my-pagehero__inner { position: relative; z-index: 2; padding-block: 34px; }
.my-pagehero__title { color: #fff; font-size: 2.1rem; margin: 0 0 4px; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.my-pagehero__sub { color: rgba(255, 255, 255, .9); margin: 0; font-size: 1rem; }

/* --------------------------------------------------------- quicklinks --- */
.my-quicklinks-wrap { position: relative; z-index: 5; }
.my-quicklinks-wrap.is-overlap { margin-top: -48px; }

/* ------------------------------------------------------- breadcrumbs ---- */
.my-crumbs { background: #fff; border-bottom: 1px solid var(--my-line); }
.my-crumbs ol, .my-crumbs ul {
	list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
	margin: 0; padding: 10px 0; font-size: .86rem; color: var(--my-muted);
}
.my-crumbs li + li::before { content: "\203A"; margin-inline-end: 6px; color: #9aa4b2; }
.my-crumbs a { color: var(--my-primary); }

.my-crumbs__mod + .my-crumbs__mod { margin-top: 2px; }

/* "แสดงเส้นทางหน้า" off: keep the strip, drop only the breadcrumb trail. */
.my-crumbs.hide-trail .mod-mod_breadcrumbs { display: none; }
.my-crumbs.hide-trail:not(:has(.my-crumbs__mod:not(.mod-mod_breadcrumbs))) { display: none; }

/* -------------------------------------------------------------- main ---- */
.my-main { padding-block: 36px; min-height: 320px; }
.my-main-top { margin-bottom: 24px; }
.my-main-bottom { margin-top: 24px; }
.my-sidebar > * + * { margin-top: 20px; }

/* ======================================================= card surfaces ===
 * Every panel on the site - module chrome, news cards, service tiles, the
 * calendar, the contact block - paints itself from this one set of variables,
 * which index.php writes from the template options. Changing the card colour
 * or glow there restyles all of them at once.
 * ======================================================================== */
/*
 * The outer shell a module sits in: the chosen card colour, but a plain line
 * around it. The glow belongs to the cards INSIDE - news items, service
 * tiles, album cards - where it marks one thing out from the next. On the
 * shell it would only draw a box around everything at once.
 */
.my-card,
.my-surface {
	background: var(--my-card-bg, var(--my-card));
	border: 1px solid var(--my-line);
	border-radius: var(--my-radius);
	box-shadow: var(--my-shadow);
	backdrop-filter: var(--my-card-blur, none);
}

.my-card { padding: 20px; margin-bottom: 24px; }

@keyframes my-card-pulse {
	0%, 100% { box-shadow: var(--my-card-shadow, var(--my-shadow)); }
	50%      { box-shadow: var(--my-card-shadow-hover, var(--my-shadow-lg)); }
}

/* Light text when a dark card colour is chosen. */
body.is-card-dark .my-card,
body.is-card-dark .my-surface { color: #eaf1fa; }
body.is-card-dark .my-card__title,
body.is-card-dark .my-surface h2,
body.is-card-dark .my-surface h3,
body.is-card-dark .my-surface h4 { color: #fff; border-bottom-color: rgba(255, 255, 255, .16); }
body.is-card-dark .my-card a:not(.my-btn),
body.is-card-dark .my-surface a:not(.my-btn) { color: #9fd0ff; }
body.is-card-dark .my-card .my-news__intro,
body.is-card-dark .my-surface .my-news__intro,
body.is-card-dark .my-surface .my-news__date,
body.is-card-dark .my-surface .my-cal-agenda__time,
body.is-card-dark .my-surface .my-cal-agenda__place { color: rgba(255, 255, 255, .72); }

/*
 * The same treatment for every panel shipped by the Gov modules and
 * components. The `body.my-site` prefix keeps these ahead of the module
 * stylesheets, which the browser loads after this file.
 */
body.my-site .my-news__lead,
body.my-site .my-news__row,
body.my-site .my-news__card,
body.my-site .my-services__card,
body.my-site .my-contact.is-card,
body.my-site .my-quicklinks.is-card,
body.my-site .my-cal,
body.my-site .my-cal-agenda,
body.my-site .my-ev {
	background: var(--my-card-bg, #fff);
	border: var(--my-card-bw, 1px) solid var(--my-card-bd, var(--my-line));
	box-shadow: var(--my-card-shadow, var(--my-shadow));
	backdrop-filter: var(--my-card-blur, none);
	transition: box-shadow .25s ease, border-color .2s ease, transform .2s ease;
}

body.my-site .my-news__lead:hover,
body.my-site .my-news__row:hover,
body.my-site .my-news__card:hover,
body.my-site a.my-services__card:hover,
body.my-site .my-cal-agenda__item:hover {
	border-color: var(--my-card-glow);
	box-shadow: var(--my-card-shadow-hover, var(--my-shadow-lg));
}

body.my-site.card-glow-pulse .my-news__card,
body.my-site.card-glow-pulse .my-services__card,
body.my-site.card-glow-pulse .my-cal,
body.my-site.card-glow-pulse .my-cal-agenda,
body.my-site.card-glow-pulse .my-quicklinks.is-card {
	animation: my-card-pulse 3s ease-in-out infinite;
}

/* Inside the dark footer the cards stay transparent, whatever is set above. */
body.my-site .my-footer .my-card,
body.my-site .my-footer .my-contact.is-card {
	background: transparent; border: 0; box-shadow: none; backdrop-filter: none; animation: none;
}

@media (prefers-reduced-motion: reduce) {
	body.my-site.card-glow-pulse .my-news__card,
	body.my-site.card-glow-pulse .my-services__card,
	body.my-site.card-glow-pulse .my-cal,
	body.my-site.card-glow-pulse .my-cal-agenda,
	body.my-site.card-glow-pulse .my-quicklinks.is-card { animation: none; }
}
.my-card__title {
	display: flex; align-items: center; gap: 10px;
	font-size: 1.12rem; margin: 0 0 14px; color: var(--my-ink-strong, var(--my-dark));
	padding-bottom: 10px; border-bottom: 2px solid #edf2f8;
}
.my-card__title::before {
	content: ""; width: 5px; height: 20px; border-radius: 3px;
	background: linear-gradient(180deg, var(--my-primary), var(--my-light));
}

/* section heading used by modules on the home page */
.my-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.my-heading__text { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.35rem; color: var(--my-ink-strong, var(--my-dark)); }
.my-heading__text::before {
	content: ""; width: 6px; height: 24px; border-radius: 3px;
	background: linear-gradient(180deg, var(--my-primary), var(--my-light));
}
.my-heading__more { font-size: .88rem; font-weight: 600; color: var(--my-primary); white-space: nowrap; }
.my-heading__more i { margin-inline-start: 4px; }

/* ----------------------------------------------------------- buttons ---- */
.my-btn {
	display: inline-flex; align-items: center; gap: 8px; justify-content: center;
	background: var(--my-primary); color: var(--my-on-primary, #fff); border: 0; cursor: pointer;
	padding: 10px 22px; border-radius: var(--my-radius-sm);
	font-family: var(--my-font); font-size: .95rem; font-weight: 600;
	transition: background .15s ease, transform .15s ease;
}
.my-btn:hover { background: var(--my-dark); color: var(--my-on-primary, #fff); text-decoration: none; transform: translateY(-1px); }
.my-btn--block { width: 100%; }
.my-btn--ghost { background: transparent; color: var(--my-primary); border: 1px solid var(--my-primary); }
.my-btn--ghost:hover { background: var(--my-primary); color: var(--my-on-primary, #fff); }

/* ------------------------------------------------------------- forms ---- */
.my-field { margin-bottom: 14px; }
.my-field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 5px; color: #33405a; }
.my-input, .my-textarea, .my-select,
body.my-site input[type="text"],
body.my-site input[type="email"],
body.my-site input[type="tel"],
body.my-site input[type="password"],
body.my-site textarea,
body.my-site select {
	width: 100%; border: 1px solid var(--my-line); border-radius: var(--my-radius-sm);
	padding: 9px 12px; font-family: var(--my-font); font-size: .95rem;
	background: #fff; color: var(--my-ink);
}
.my-input:focus, .my-textarea:focus, body.my-site input:focus, body.my-site textarea:focus {
	border-color: var(--my-light); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--my-light, #2e80d6) 15%, transparent);
}

/* --------------------------------------------- vertical pill side menu -- */
.my-sidenav { list-style: none; margin: 0; padding: 0; }
.my-sidenav li { margin-bottom: 6px; }
.my-sidenav li > a {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 14px; border-radius: var(--my-radius-sm);
	background: #f4f7fb; color: #33405a; font-size: .94rem; font-weight: 500;
	transition: all .15s ease;
}
.my-sidenav li > a::before {
	content: "\25CF"; font-size: .5rem; color: var(--my-light);
}
.my-sidenav li > a:hover { background: color-mix(in srgb, var(--my-primary, #1b5fa8) 12%, #fff); color: var(--my-primary); text-decoration: none; }
.my-sidenav li.current > a,
.my-sidenav li.active > a {
	background: linear-gradient(90deg, var(--my-primary), var(--my-light));
	color: var(--my-on-primary, #fff); box-shadow: 0 4px 12px color-mix(in srgb, var(--my-primary, #1b5fa8) 28%, transparent);
}
.my-sidenav li.current > a::before,
.my-sidenav li.active > a::before { color: var(--my-on-primary, #fff); }
.my-sidenav ul { list-style: none; padding-inline-start: 16px; margin: 6px 0 0; }

/* ---------------------------------------------------- content styling --- */
.my-main .page-header h1, .my-main .page-header h2 { font-size: 1.6rem; color: var(--my-ink-strong, var(--my-dark)); }
.my-main .com-content-article,
.my-main .com-content-category-blog,
.my-main .com-content-category__items,
.my-main .blog,
.my-main .item-page {
	background: #fff; border: 1px solid var(--my-line); border-radius: var(--my-radius);
	box-shadow: var(--my-shadow); padding: 26px;
}
.my-main .item-page img, .my-main .blog img { border-radius: var(--my-radius-sm); }

.my-article-info {
	display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
	font-size: .85rem; color: var(--my-muted);
	padding: 8px 0 14px; border-bottom: 1px dashed var(--my-line); margin-bottom: 16px;
	list-style: none;
}
.my-article-info i { color: var(--my-primary); margin-inline-end: 5px; }

/* --------------------------------------------------- หน้าโล่ง (Blank) --- */
/*
 * The bare page: content only, no bar, menu or footer. Used by the "Blank"
 * template style and by Joomla's own tmpl=component, which render the same
 * markup (blank.php).
 */
.my-blank { background: var(--my-bg, #f6f8fb); }

.my-blank__inner {
	width: 100%; max-width: 1000px;
	margin-inline: auto; padding-inline: 16px;
}
.my-blank.is-narrow .my-blank__inner { max-width: 760px; }
.my-blank.is-wide .my-blank__inner   { max-width: var(--my-container); }

.my-blank__body { padding-block: 24px 40px; }

/* The optional line saying which site the window came from. */
.my-blank__brand {
	background: var(--my-surface, #fff);
	border-bottom: 1px solid var(--my-line, #e5e7eb);
}
.my-blank__brand .my-blank__inner {
	display: flex; align-items: center; gap: 10px;
	padding-block: 10px; font-weight: 600; color: var(--my-ink-strong, var(--my-dark, #12395f));
}
.my-blank__brand img { width: 34px; height: auto; }

/*
 * Joomla's own article "Details" block is a <dl>, so every entry stacks on its
 * own line by default. Lay it out as one horizontal row instead.
 *
 * Scoped to the body class, not .my-main: the bare "tmpl=component" layout has
 * no .my-main wrapper, and the block stacked again in that window.
 */
.my-site dl.article-info {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
	margin: 0 0 18px; padding: 10px 0 14px;
	border-bottom: 1px dashed var(--my-line);
	font-size: .85rem; color: var(--my-muted);
}

.my-site dl.article-info dt.article-info-term {
	margin: 0; font-weight: 600; color: #33405a;
	background: #eef4fb; border-radius: 999px; padding: 3px 12px;
}

.my-site dl.article-info dd {
	margin: 0; display: inline-flex; align-items: center; gap: 6px;
	white-space: nowrap;
}

.my-site dl.article-info dd [class^="icon-"],
.my-site dl.article-info dd [class*=" icon-"] { color: var(--my-primary); }

.my-site dl.article-info dd + dd::before {
	content: ""; width: 4px; height: 4px; border-radius: 50%;
	background: #c3cbd6; margin-inline-end: 12px;
}

@media (max-width: 575px) {
	.my-site dl.article-info { gap: 6px 12px; }
	.my-site dl.article-info dd + dd::before { display: none; }
}

.my-main .pagination, .my-main .pagination-wrapper { margin-top: 24px; }
.my-main .pagination ul, .my-main ul.pagination {
	list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0; margin: 0;
}
.my-main .pagination a, .my-main .pagination span, .my-main ul.pagination a, .my-main ul.pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--my-radius-sm);
	border: 1px solid var(--my-line); background: #fff; color: var(--my-ink); font-size: .9rem;
}
.my-main .pagination .active > a, .my-main .pagination .active > span,
.my-main ul.pagination .active > a, .my-main ul.pagination .active > span {
	background: var(--my-primary); border-color: var(--my-primary); color: var(--my-on-primary, #fff);
}

table.my-table, .my-main table.table {
	width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--my-radius-sm); overflow: hidden;
}
table.my-table th, .my-main table.table th { background: var(--my-primary); color: var(--my-on-primary, #fff); text-align: start; padding: 10px 12px; font-weight: 600; }
table.my-table td, .my-main table.table td { padding: 10px 12px; border-bottom: 1px solid var(--my-line); }
table.my-table tbody tr:nth-child(even) { background: #f8fafd; }

/* Joomla system messages */
.my-main .alert, joomla-alert { border-radius: var(--my-radius-sm); }

/* -------------------------------------------- right sidebar to the edge -- */
/*
 * "ชิดขอบ": on wide screens the main container spans the full width and the
 * left padding keeps the content lined up with the rest of the page, so the
 * right sidebar gains the width that would otherwise be empty margin.
 *
 * It stops one gutter short of the glass rather than touching it - a card
 * pressed against the screen edge (and the scrollbar beside it) reads as
 * broken. Percentages, not vw, so the scrollbar never causes an overflow.
 */
@media (min-width: 992px) {
	.my-site.is-sidebar-edge .my-main > .my-container {
		max-width: none;
		padding-inline-start: max(16px, calc((100% - var(--my-container)) / 2 + 16px));
		padding-inline-end: 16px;
	}

	/*
	 * .my-row carries a -12px side margin for the column gutters; cancelling it
	 * on the right keeps the card inside that 16px gutter instead of hanging
	 * 12px past it.
	 */
	.my-site.is-sidebar-edge .my-main > .my-container > .my-row { margin-inline-end: 0; }

	.my-site.is-sidebar-edge .my-main .my-sidebar--right { padding-inline-end: 0; }
}

/* Sticky right column on tall screens - handy for menus and contact blocks. */
@media (min-width: 992px) {
	.my-sidebar--right { align-self: flex-start; position: sticky; top: 96px; }
	body[data-sticky="0"] .my-sidebar--right { top: 24px; }
}

/* --------------------------------------------------------- prefooter ---- */
.my-prefooter {
	background: #fff;
	border-top: 1px solid var(--my-line);
	padding-block: 26px;
}
.my-prefooter > .my-container > * + * { margin-top: 22px; }

/* ------------------------------------------------------------ footer ---- */
.my-footer { color: #cfd8e6; background: var(--my-footer-bg); margin-top: 40px; }

.my-footer__strip { position: relative; background-size: cover; background-position: center; }
.my-footer__strip-overlay {
	position: absolute; inset: 0;
	background: linear-gradient(90deg, color-mix(in srgb, var(--my-dark, #10427a) 90%, transparent), color-mix(in srgb, var(--my-primary, #1b5fa8) 68%, transparent));
}
.my-footer__strip-inner {
	position: relative; z-index: 2; padding-block: 26px; color: #fff;
	display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
}
.my-footer__slogan { display: flex; flex-direction: column; }
.my-footer__slogan strong { font-size: 1.35rem; }
.my-footer__slogan span { font-size: .95rem; opacity: .92; }

.my-footer__main { padding-block: 34px; }
.my-footer__title { color: #fff; font-size: 1.05rem; margin-bottom: 14px; }
.my-footer__list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.my-footer__list li { display: flex; gap: 10px; margin-bottom: 9px; align-items: flex-start; }
.my-footer__list li i { color: var(--my-accent); width: 16px; text-align: center; margin-top: 5px; }
.my-footer a { color: #cfd8e6; }
.my-footer a:hover { color: #fff; }

.my-footer__social { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.my-social {
	width: 34px; height: 34px; border-radius: 50%; background: var(--sc, var(--my-primary));
	color: #fff !important; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
}
.my-social:hover { filter: brightness(1.15); text-decoration: none; }

.my-footer__qr { margin-top: 16px; }
.my-footer__qr img { background: #fff; padding: 6px; border-radius: var(--my-radius-sm); }

.my-footer__bottom { background: rgba(0, 0, 0, .25); font-size: .84rem; }
.my-footer__bottom-inner {
	display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center;
	padding-block: 12px; text-align: center;
}
.my-footer__credit { opacity: .75; }

/* footer menu module */
.my-footer .my-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.my-footer .my-card__title { color: #fff; border-bottom-color: rgba(255, 255, 255, .18); }
.my-footer ul.menu, .my-footer .menu { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.my-footer ul.menu li { margin-bottom: 8px; }
.my-footer ul.menu li a::before { content: "\203A"; margin-inline-end: 7px; color: var(--my-accent); }

/* --------------------------------------------------------- back to top -- */
.my-totop {
	position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 900;
	width: 44px; height: 44px; border: 0; border-radius: 50%;
	background: var(--my-primary); color: var(--my-on-primary, #fff); cursor: pointer;
	box-shadow: var(--my-shadow-lg); opacity: 0; visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}
.my-totop.is-visible { opacity: 1; visibility: visible; }
.my-totop:hover { background: var(--my-dark); }

/* ------------------------------------------------------- error/offline -- */
.my-errorpage, .my-offline { background: var(--my-bg); }
.my-error { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.my-error__box {
	background: #fff; border-radius: var(--my-radius); box-shadow: var(--my-shadow-lg);
	padding: 44px 34px; max-width: 560px; width: 100%; text-align: center;
}
.my-error__code { font-size: 4.5rem; font-weight: 700; color: var(--my-primary); line-height: 1; }
.my-error__title { font-size: 1.35rem; }
.my-error__text { color: var(--my-muted); }
.my-error__debug { text-align: start; font-size: .8rem; overflow: auto; margin-top: 20px; }
.my-offline__login { text-align: start; margin-top: 22px; }

/* ------------------------------------------------------- high contrast -- */
body.my-contrast {
	--my-primary: #000000;
	--my-dark: #000000;
	--my-light: #333333;
	--my-accent: #ffdd00;
	--my-ink: #000000;
	--my-muted: #222222;
	--my-bg: #ffffff;
	--my-footer-bg: #000000;
}
body.my-contrast .my-pagehero__overlay,
body.my-contrast .my-footer__strip-overlay { background: rgba(0, 0, 0, .82); }
body.my-contrast a { text-decoration: underline; }

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 991px) {
	.my-col--3, .my-col--4, .my-col--6, .my-col--8, .my-col--9 { width: 50%; }
	.my-main .my-col--3, .my-main .my-col--6, .my-main .my-col--8, .my-main .my-col--9 { width: 100%; }
	.my-main .my-col--main, .my-main .my-sidebar { width: 100%; flex: 0 0 100%; max-width: 100%; }
	.my-sidebar { margin-top: 24px; }
	.my-pagehero__title { font-size: 1.6rem; }
}

@media (max-width: 767px) {
	.my-col--3, .my-col--4, .my-col--6, .my-col--8, .my-col--9 { width: 100%; }

	.my-navtoggle { display: inline-flex; align-items: center; justify-content: center; }
	.my-search__input { width: 120px; }
	.my-brand__name { font-size: 1.05rem; }
	.my-brand__sub { font-size: .76rem; }

	.my-nav__inner { display: block; }
	.my-nav ul { display: none; flex-direction: column; }
	.my-nav.is-open ul { display: flex; }
	.my-nav ul ul { position: static; display: flex; box-shadow: none; background: rgba(0, 0, 0, .14); border-radius: 0; }
	.my-nav ul ul li > a { color: var(--my-on-primary, #fff); padding-inline-start: 34px; }
	.my-nav ul ul li > a:hover { background: color-mix(in srgb, var(--my-on-primary, #fff) 14%, transparent); color: var(--my-on-primary, #fff); }
	.my-nav ul li > a { border-bottom: 1px solid color-mix(in srgb, var(--my-on-primary, #fff) 12%, transparent); }

	.my-quicklinks-wrap.is-overlap { margin-top: 0; }
	.my-main .com-content-article, .my-main .item-page, .my-main .blog { padding: 18px; }
	.my-footer__strip-inner { justify-content: center; text-align: center; }
}

/*
 * Phone gutters.
 *
 * Three paddings stack up before any text is reached: 16px of container, 12px
 * of column and 20px of card put the first letter 48px in from the screen -
 * nearly a third of a 360px screen spent on empty margin down both sides. By
 * this width every column is already full width, so its gutter has no work
 * left to do at all and is taken out; the container and the card keep just
 * enough to stop the text touching the glass.
 */
@media (max-width: 575px) {
	.my-container { padding-inline: 8px; }

	.my-row { margin-inline: 0; }
	.my-col { padding-inline: 0; }

	.my-card { padding-inline: 12px; }

	.my-main .com-content-article,
	.my-main .item-page,
	.my-main .blog { padding-inline: 12px; }
}

@media print {
	.my-header, .my-footer, .my-totop, .my-quicklinks-wrap, .my-pagehero { display: none !important; }
	body.my-site { background: #fff; }
}

/* ------------------------------------------------------ share buttons --- */
/*
 * One implementation for every section that offers sharing: news, photo
 * albums and documents. The markup carries the url and title as data
 * attributes so no per-section script is needed.
 */
.my-share { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.my-share__label { font-size: .78rem; color: var(--my-muted); margin-inline-end: 2px; }

/*
 * The bottom row of a card: what to press on the left, where to share hard
 * against the right. One rule for news cards and photo albums alike. On a
 * narrow card the share buttons drop to their own line, still right-aligned.
 */
.my-cardfoot {
	display: flex; align-items: center; flex-wrap: wrap;
	gap: 10px; margin-top: 12px;
}
.my-cardfoot .my-share { margin-inline-start: auto; }

/* Each network keeps its own colour, so the buttons read at a glance. */
.my-share__btn {
	width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	background: #46566f; color: #fff; font-size: .82rem;
	transition: filter .16s ease, transform .16s ease;
}
.my-share__btn[data-share="facebook"] { background: #1877f2; }
.my-share__btn[data-share="line"]     { background: #06c755; }
.my-share__btn[data-share="x"]        { background: #000; }
.my-share__btn[data-share="email"]    { background: #d97706; }
.my-share__btn[data-share="copy"]     { background: var(--my-primary); }

.my-share__btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.my-share__btn.is-done { background: #16a34a; }

/* Swap the icon for a tick once the link has been copied. */
.my-share__btn.is-done i::before { content: "\f00c"; }

@media (prefers-reduced-motion: reduce) {
	.my-share__btn { transition: none; }
}

/* ------------------------------------------- view count and "ถูกใจ" --- */
/*
 * The small line under a news item or album: how many people opened it and
 * the like button. Shared by both sections so the two read the same.
 */
.my-news__meta,
.my-alb__meta {
	display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
	margin: 8px 0 2px;
}

.my-news__hits,
.my-alb__hits {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: .8rem; color: var(--my-muted, #6b7280);
}
.my-news__hits i,
.my-alb__hits i { color: var(--my-primary, #1b5fa8); }

/*
 * The like button sits at the far right of that line, away from the view
 * count on the left - it is the one thing there to press, so it gets its own
 * corner. On a narrow card the line wraps and it keeps the right edge.
 */
.my-news__meta .my-like,
.my-alb__meta .my-like { margin-inline-start: auto; }

.my-like {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 11px; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--my-line, #e2e8f0);
	background: var(--my-surface, #fff); color: var(--my-muted, #6b7280);
	font: inherit; font-size: .8rem; line-height: 1.4;
	transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.my-like:hover { border-color: var(--my-primary, #1b5fa8); color: var(--my-primary, #1b5fa8); }

/* Already liked in this visit: filled in, and the button stops responding. */
.my-like.is-done {
	background: var(--my-primary, #1b5fa8); border-color: var(--my-primary, #1b5fa8);
	color: #fff; cursor: default;
}
.my-like.is-done:hover { color: #fff; }

.my-like__n { font-variant-numeric: tabular-nums; font-weight: 600; }

/* A short nudge when the count goes up, so the click is felt. */
.my-like.is-bump { animation: my-like-bump .32s ease; }

@keyframes my-like-bump {
	40% { transform: scale(1.12); }
	100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.my-like { transition: none; }
	.my-like.is-bump { animation: none; }
}

/* -------------------------------------------------------- popup modal --- */
/*
 * Opens a page in an overlay instead of navigating. The iframe loads the bare
 * "tmpl=component" layout, so what shows inside is the content alone.
 */
.my-modal {
	position: fixed; inset: 0; z-index: 1300;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
	opacity: 0; transition: opacity .2s ease;
}
.my-modal.is-open { opacity: 1; }
.my-modal[hidden] { display: none; }

.my-modal__backdrop { position: absolute; inset: 0; background: rgba(6, 18, 35, .62); }

.my-modal__box {
	position: relative; z-index: 1;
	display: flex; flex-direction: column;
	width: min(960px, 100%); height: min(86vh, 900px);
	background: #fff; border-radius: var(--my-radius, 14px); overflow: hidden;
	box-shadow: 0 24px 60px rgba(6, 18, 35, .4);
	transform: translateY(12px) scale(.99);
	transition: transform .2s ease;
}
.my-modal.is-open .my-modal__box { transform: none; }

.my-modal__head {
	flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
	padding: 12px 16px; color: var(--my-on-primary, #fff);
	background: linear-gradient(135deg, var(--my-primary), var(--my-light));
}

.my-modal__title {
	flex: 1 1 auto; min-width: 0; margin: 0; color: var(--my-on-primary, #fff);
	font-size: 1rem; line-height: 1.4;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.my-modal__close {
	flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 50%;
	background: color-mix(in srgb, var(--my-on-primary, #fff) 20%, transparent); color: var(--my-on-primary, #fff); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.my-modal__close:hover { background: color-mix(in srgb, var(--my-on-primary, #fff) 34%, transparent); }

.my-modal__frame { flex: 1 1 auto; width: 100%; border: 0; background: var(--my-bg, #f4f7fb); }

/* Stop the page behind from scrolling while the overlay is up. */
body.my-modal-open { overflow: hidden; }

@media (max-width: 575px) {
	.my-modal { padding: 0; }
	.my-modal__box { width: 100%; height: 100%; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.my-modal, .my-modal__box { transition: none; }
}
/* Social icons on the brand row, beside the organisation name. */
.my-topbar__right { display: flex; align-items: center; gap: 14px; }

.my-brandbar__social { display: flex; align-items: center; gap: 6px; }

/* Each network wears its own colour, so it is recognised at a glance. */
.my-brandbar__social .my-social {
	width: 32px; height: 32px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--sc, var(--my-primary)); color: #fff; font-size: .86rem;
	transition: filter .16s ease, transform .16s ease;
}
.my-brandbar__social .my-social:hover {
	color: #fff; text-decoration: none;
	filter: brightness(1.12); transform: translateY(-2px);
}

/* A white ring keeps them apart from a dark or gradient brand bar. */
.my-brandbar.is-light .my-brandbar__social .my-social {
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .45);
}

@media (max-width: 767px) {
	/* The brand row is for the emblem and the name on a phone; the footer
	   still lists every channel. */
	.my-brandbar__social { display: none; }

	/* And a long organisation name gives way rather than break the row. */
	.my-brandbar__inner { gap: 10px; }
	.my-brandbar__tools { flex: 0 0 auto; }
	.my-brand { min-width: 0; }
	.my-brand__text { min-width: 0; }
	.my-brand__name,
	.my-brand__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}