/*
 * tpl_uthong - mockup B (docs/design.md)
 * Loaded after Bootstrap 5 and Font Awesome from Joomla core.
 */

/* ---------- Fonts (files in ../fonts, SIL Open Font License) ---------- */
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/prompt-thai-500-normal.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/prompt-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/prompt-thai-600-normal.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/prompt-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/sarabun-thai-400-normal.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/sarabun-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/sarabun-thai-500-normal.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/sarabun-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/sarabun-thai-600-normal.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/sarabun-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  --ut-primary: #0f5e73;
  --ut-primary-hover: #0b4757;
  --ut-primary-rgb: 15, 94, 115;
  --ut-primary-hover-rgb: 11, 71, 87;
  --ut-primary-soft: #e2f0f4;
  --ut-text: #192a2e;
  --ut-text-muted: #4d646a;
  --ut-text-footer: #394f56;
  --ut-heading: var(--ut-primary);
  --ut-dark: #14292e;
  --ut-dark-deep: #0d1d21;
  --ut-on-dark: #cfe3e8;
  --ut-border: #dde3e9;
  --ut-surface: #f4f6f8;
  --ut-surface-tint: #eef5f7;
  --ut-placeholder: #dbe3ea;
  --ut-bg: #ffffff;
  --ut-font-body: "Sarabun", "Leelawadee UI", Tahoma, sans-serif;
  --ut-font-head: "Prompt", "Leelawadee UI", Tahoma, sans-serif;
  --ut-radius: 12px;
  --ut-radius-lg: 24px;
  --ut-container: 1180px;
  --ut-gutter: 24px;
  --ut-section: 56px;
  --ut-tap: 44px;

  /* Bootstrap variables used by core layouts */
  --bs-body-font-family: var(--ut-font-body);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--ut-text);
  --bs-body-bg: var(--ut-bg);
  --bs-border-color: var(--ut-border);
  --bs-link-color: var(--ut-primary);
  --bs-link-color-rgb: var(--ut-primary-rgb);
  --bs-link-hover-color: var(--ut-primary-hover);
  --bs-link-hover-color-rgb: var(--ut-primary-hover-rgb);
  --bs-primary: var(--ut-primary);
  --bs-primary-rgb: var(--ut-primary-rgb);
  --bs-border-radius: var(--ut-radius);
}

/* ---------- Color schemes (template setting, class on <html>) ---------- */
/* Default (no class) = teal above. Each scheme also sets its own tint for the surface option
   its text colors (dark gray tinted with the scheme's hue) and the dark tones
   (top strip, footer, photo band). */
html.ut-scheme-green {
  --ut-primary: #1e6b3c;
  --ut-primary-hover: #154f2c;
  --ut-primary-rgb: 30, 107, 60;
  --ut-primary-hover-rgb: 21, 79, 44;
  --ut-primary-soft: #e3f1e7;
  --ut-surface-tint: #eef6f0;
  --ut-text: #192e21;
  --ut-text-muted: #4d6a58;
  --ut-text-footer: #395644;
  --ut-dark: #16291d;
  --ut-dark-deep: #0e1d13;
  --ut-on-dark: #d3e6d9;
}
html.ut-scheme-navy {
  --ut-primary: #1f4e8c;
  --ut-primary-hover: #173a69;
  --ut-primary-rgb: 31, 78, 140;
  --ut-primary-hover-rgb: 23, 58, 105;
  --ut-primary-soft: #e5edf8;
  --ut-surface-tint: #eef3fa;
  --ut-text: #19222e;
  --ut-text-muted: #4d5a6a;
  --ut-text-footer: #394556;
  --ut-dark: #15202e;
  --ut-dark-deep: #0e1520;
  --ut-on-dark: #d3dfee;
}
html.ut-scheme-maroon {
  --ut-primary: #8c2a3c;
  --ut-primary-hover: #6b1f2d;
  --ut-primary-rgb: 140, 42, 60;
  --ut-primary-hover-rgb: 107, 31, 45;
  --ut-primary-soft: #f6e7ea;
  --ut-surface-tint: #f9eff1;
  --ut-text: #2e191d;
  --ut-text-muted: #6a4d52;
  --ut-text-footer: #56393e;
  --ut-dark: #2b1519;
  --ut-dark-deep: #1d0e11;
  --ut-on-dark: #ecd5da;
}
html.ut-surface-tint { --ut-surface: var(--ut-surface-tint); }

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--ut-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ut-text);
  background: var(--ut-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ut-font-head);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ut-text);
}
/* Page and section headings use the scheme's primary color (footer headings keep --ut-text) */
h1, h2,
.ut-article__title, .ut-list__title, .ut-error__title, .ut-herob__title,
.ut-section__title, .ut-card__title { color: var(--ut-heading); }
h1 { font-size: 2.375rem; }   /* 38 */
h2 { font-size: 1.875rem; }   /* 30 */
h3 { font-size: 1.25rem; }    /* 20 */

a { color: var(--ut-primary); }
a:hover { color: var(--ut-primary-hover); }

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

img, video { max-width: 100%; height: auto; }

.ut-container {
  max-width: calc(var(--ut-container) + 2 * var(--ut-gutter));
  margin: 0 auto;
  padding: 0 var(--ut-gutter);
  box-sizing: border-box;
}

.ut-skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 2000;
  padding: 10px 18px;
  border-radius: var(--ut-radius);
  background: var(--ut-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.ut-skip:focus { top: 8px; color: #fff; }

.ut-icon { flex-shrink: 0; vertical-align: middle; }

/* ---------- Buttons ---------- */
.ut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ut-tap);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.ut-btn--primary { background: var(--ut-primary); border-color: var(--ut-primary); color: #fff; }
.ut-btn--primary:hover { background: var(--ut-primary-hover); color: #fff; }
.ut-btn--outline { background: transparent; border-color: var(--ut-primary); color: var(--ut-primary); }
.ut-btn--light { background: #fff; color: var(--ut-text); }

.ut-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ut-tap);
  height: var(--ut-tap);
  padding: 0;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
  background: transparent;
  color: var(--ut-text);
  cursor: pointer;
}

/* Core Bootstrap buttons follow the template colour */
.btn-primary {
  --bs-btn-bg: var(--ut-primary);
  --bs-btn-border-color: var(--ut-primary);
  --bs-btn-hover-bg: var(--ut-primary-hover);
  --bs-btn-hover-border-color: var(--ut-primary-hover);
  --bs-btn-active-bg: var(--ut-primary-hover);
  --bs-btn-active-border-color: var(--ut-primary-hover);
}

/* ---------- Top strip (topbar + lang) ---------- */
.ut-topstrip {
  background: var(--ut-dark);
  font-size: 14px;
  color: var(--ut-on-dark);
}
.ut-topstrip a { color: #fff; }
.ut-topstrip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}
.ut-topstrip__text { flex: 1 1 auto; min-width: 0; }
.ut-topstrip p { margin: 0; }
.ut-topstrip__lang { flex: 0 0 auto; }

/* ---------- Header ---------- */
.ut-header {
  position: relative;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--ut-border);
  padding: 12px 0;
}
.ut-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ut-header__logo { flex: 0 1 auto; min-width: 0; }
.ut-header__logo p { margin: 0; }
.ut-header__logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ut-text);
  text-decoration: none;
  font-family: var(--ut-font-head);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
}
.ut-header__logo img { max-height: 52px; width: auto; }
.ut-header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ut-header__cta p { margin: 0; }
.ut-header__cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ut-tap);
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ut-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.ut-header__cta a:hover { background: var(--ut-primary-hover); color: #fff; }
.ut-nav-toggle { display: none; }
.ut-nav__head { display: none; }

/* ---------- Mega menu (desktop) ---------- */
.ut-mega__top {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ut-mega__topitem { position: relative; }
.ut-mega__toprow {
  display: flex;
  align-items: center;
  border-radius: var(--ut-radius);
}
.ut-mega__toprow:hover { background: var(--ut-primary-soft); }
/* Current top item: filled primary, white text */
.ut-mega__topitem.is-active > .ut-mega__toprow { background: var(--ut-primary); }
.ut-mega__topitem.is-active > .ut-mega__toprow .ut-mega__toplink,
.ut-mega__topitem.is-active > .ut-mega__toprow .ut-mega__toggle { color: #fff; }
.ut-mega__toplink {
  display: inline-flex;
  align-items: center;
  min-height: var(--ut-tap);
  padding: 0 14px;
  color: var(--ut-text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.has-panel .ut-mega__toplink { padding-right: 2px; }
.ut-mega__toplink:hover { color: var(--ut-text); }
.ut-mega__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: var(--ut-tap);
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--ut-text);
  cursor: pointer;
}
.ut-mega__toggle .ut-icon { transition: transform .15s; }
.ut-mega__toggle[aria-expanded="true"] .ut-icon { transform: rotate(180deg); }

/* Dropdown box under the top item: level 2 listed down, level 3 indented under it */
.ut-mega__panel {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 10;
  display: none;
  min-width: 240px;
  width: max-content;
  max-width: 340px;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
  box-shadow: 0 12px 24px rgba(28, 38, 48, .12);
}
/* The last two top items open toward the left so the box stays on screen */
.ut-mega__topitem:nth-last-child(-n+2) > .ut-mega__panel { left: auto; right: 0; }
.ut-mega__topitem.is-open > .ut-mega__panel { display: block; }
@media (min-width: 901px) and (hover: hover) {
  .ut-mega__topitem.has-panel:hover > .ut-mega__panel { display: block; }
  /* keeps the box open while the pointer crosses the 4px gap */
  .ut-mega__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 6px; }
}
.ut-mega__cols { padding: 8px 0; }
.ut-mega__colhead,
.ut-mega__link {
  display: flex;
  align-items: center;
  min-height: var(--ut-tap);
  padding: 4px 18px;
  color: var(--ut-text);
  text-decoration: none;
  line-height: 1.4;
}
.ut-mega__colhead.is-heading { font-weight: 600; }
.ut-mega__list { margin: 0; padding: 0; list-style: none; }
.ut-mega__list .ut-mega__link { padding-left: 38px; }
.ut-mega__list .ut-mega__list .ut-mega__link { padding-left: 58px; }
a.ut-mega__colhead:hover,
a.ut-mega__link:hover { background: var(--ut-primary-soft); color: var(--ut-text); }
.ut-mega__item.is-active > .ut-mega__link,
.ut-mega__col.is-active > .ut-mega__colhead { color: var(--ut-primary); font-weight: 600; }

/* ---------- Mobile menu (<= 900px) ---------- */
@media (max-width: 900px) {
  .ut-nav-toggle { display: inline-flex; }
  /* mockup B mobile header: logo, name and menu button only */
  .ut-header__cta { display: none; }
  .ut-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1100;
    width: min(360px, 88vw);
    overflow-y: auto;
    background: #fff;
    box-shadow: -8px 0 24px rgba(28, 38, 48, .15);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .2s, visibility .2s;
  }
  .ut-nav.is-open { transform: none; visibility: visible; }
  .ut-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ut-border);
  }
  .ut-nav__title { font-family: var(--ut-font-head); font-weight: 600; }
  .ut-mega__top { flex-direction: column; align-items: stretch; gap: 0; padding: 8px; }
  .ut-mega__toprow { justify-content: space-between; }
  .ut-mega__toplink { flex: 1 1 auto; white-space: normal; padding: 0 12px; }
  .ut-mega__toggle { width: var(--ut-tap); padding: 0; }
  .ut-mega__panel { position: static; width: auto; max-width: none; margin: 0; box-shadow: none; border: 0; border-radius: 0; }
  .ut-mega__panel::before { content: none; }
  .ut-mega__cols { padding: 0 0 8px; }
  .ut-mega__colhead { padding-left: 24px; }
  .ut-mega__list .ut-mega__link { padding-left: 44px; }
  .ut-mega__list .ut-mega__list .ut-mega__link { padding-left: 64px; }
  body.ut-nav-open { overflow: hidden; }
  /* the slide-in menu lives inside the header, so the header goes above the backdrop */
  body.ut-nav-open .ut-header { z-index: 1100; }
  .ut-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(28, 38, 48, .45);
  }
}
@media (prefers-reduced-motion: reduce) { .ut-nav { transition: none; } }

/* ---------- Banner, breadcrumbs, hero ---------- */
.ut-banner { padding: 24px 0 0; }
.ut-banner img { border-radius: var(--ut-radius); }

.ut-breadcrumbs {
  background: var(--ut-surface);
  border-bottom: 1px solid var(--ut-border);
  font-size: 14px;
}
.ut-breadcrumbs .breadcrumb,
.ut-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  background: none;
  list-style: none;
}
.ut-breadcrumbs .breadcrumb-item,
.ut-breadcrumbs li { display: inline-flex; align-items: center; min-height: var(--ut-tap); color: var(--ut-text-muted); }
.ut-breadcrumbs .breadcrumb-item + .breadcrumb-item::before { color: var(--ut-text-muted); }
.ut-breadcrumbs a { color: var(--ut-primary); text-decoration: none; }
.ut-breadcrumbs a:hover { text-decoration: underline; }

/* Slider position: full width band under the header (mod_uthong_slider) */
.ut-sliderband { background: var(--ut-surface); }

/* ---------- Main, sidebar, sections ---------- */
.ut-main { padding: 40px 0 64px; }
.ut-main:focus { outline: none; }
.is-home .ut-main { padding: 0; }
.is-home .ut-main .ut-content:empty { display: none; }
.ut-main--sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-start;
}
.ut-main--sidebar .ut-content { flex: 999 1 560px; min-width: 0; }
.ut-sidebar { flex: 1 1 280px; display: flex; flex-direction: column; gap: 24px; }

.ut-section { padding: var(--ut-section) 0; }
.ut-section--home-2 { background: var(--ut-surface); }
.ut-section__title { margin: 0 0 24px; font-size: 1.875rem; }
.ut-module + .ut-module { margin-top: 40px; }

.ut-card {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
}
.ut-card__title { margin: 0 0 12px; font-size: 18px; }
.ut-card__body > :last-child { margin-bottom: 0; }

/* ---------- Article body and content converted in phase 2 ---------- */
.com-content-article__body,
.item-page .article-body {
  font-size: 18px;
  line-height: 1.85;
}
.com-content-article__body img { height: auto; border-radius: var(--ut-radius); }
.com-content-article__body iframe,
.com-content-article__body embed,
.com-content-article__body object,
.com-content-article__body video {
  display: block;
  max-width: 100%;
  border: 0;
}
.com-content-article__body iframe:not([width]),
.com-content-article__body iframe[width="100%"] { width: 100%; }
.com-content-article__body iframe:not([height]) { aspect-ratio: 16 / 9; height: auto; }
/* FlipHTML5 books: kept without size in phase 2 */
.com-content-article__body iframe[src*="fliphtml5"],
.ut-module iframe[src*="fliphtml5"] {
  width: 100%;
  min-height: 380px;
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: var(--ut-radius);
}
/* PDF shown by the old PDF Embed plugin as <embed>/<object> */
.com-content-article__body embed[type="application/pdf"],
.com-content-article__body object[type="application/pdf"],
.com-content-article__body embed[src$=".pdf"],
.com-content-article__body iframe[src$=".pdf"] {
  width: 100%;
  height: 80vh;
  min-height: 480px;
}
@media (max-width: 600px) {
  /* the converted PDFs carry height:800px in the tag, so !important is needed here */
  .com-content-article__body embed[type="application/pdf"],
  .com-content-article__body object[type="application/pdf"],
  .com-content-article__body embed[src$=".pdf"],
  .com-content-article__body iframe[src$=".pdf"] { height: 70vh !important; min-height: 360px; }
}
/* Galleries converted in phase 2: a block of links to images/gallery
   with thumbnails from images/gallery/thumbs - shown like the gallery field */
.com-content-article__body :is(div, p):has(> a > img[src*="gallery/thumbs/"]) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.com-content-article__body :is(div, p) > a:has(> img[src*="gallery/thumbs/"]) {
  display: block;
  overflow: hidden;
  border-radius: var(--ut-radius);
  background: var(--ut-placeholder);
}
.com-content-article__body a > img[src*="gallery/thumbs/"] {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 0;
}

/* Wide tables scroll inside their own box */
.com-content-article__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}
.com-content-article__body th,
.com-content-article__body td { padding: 8px 12px; border: 1px solid var(--ut-border); vertical-align: top; }
.com-content-article__body th { background: var(--ut-surface); }
/* Columns from Page Builder CK converted to Bootstrap col-md-* */
.com-content-article__body .row,
.ut-module .row { --bs-gutter-x: 24px; row-gap: 16px; }

/* ---------- Share buttons (layout uthong.share) ---------- */
.ut-share { display: flex; flex-wrap: wrap; gap: 8px; }
.ut-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ut-tap);
  height: var(--ut-tap);
  padding: 0;
  border: 1px solid var(--ut-border);
  border-radius: 50%;
  background: #fff;
  color: var(--ut-text);
  cursor: pointer;
}
.ut-share__btn:hover { border-color: var(--ut-primary); color: var(--ut-primary); }
.ut-share__btn.is-done { border-color: var(--ut-primary); background: var(--ut-primary-soft); color: var(--ut-primary); }

/* ---------- Article page (mockup B) ---------- */
.ut-article { display: flex; flex-direction: column; gap: 22px; }
.ut-article > * { margin-top: 0; margin-bottom: 0; }
.ut-article__head { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.ut-article__kicker { margin: 0; font-weight: 600; color: var(--ut-primary); }
.ut-article__kicker a { color: inherit; text-decoration: none; }
.ut-article__kicker a:hover { text-decoration: underline; }
.ut-article__title { margin: 0; font-size: 36px; line-height: 1.4; }
.ut-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ut-article__date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  color: var(--ut-text-muted);
}
.ut-article .item-image { margin: 0; }
.ut-article .item-image img { display: block; width: 100%; height: auto; border-radius: var(--ut-radius); }
.ut-article .item-image .caption { margin-top: 8px; font-size: 14px; color: var(--ut-text-muted); }
.com-content-article__body > :first-child { margin-top: 0; }
.com-content-article__body > :last-child { margin-bottom: 0; }

/* Gallery section under the text */
.ut-article__gallery { display: flex; flex-direction: column; gap: 12px; }
.ut-article__gallery-title { margin: 0; font-size: 20px; }

/* Previous / next (plugin Content - Page Navigation) */
.ut-article .pagenavigation { padding-top: 20px; border-top: 1px solid var(--ut-border); }
.ut-article .pagenavigation .pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 0; }
.ut-article .pagenavigation a,
.ut-article .pagenavigation .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ut-tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ut-primary);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.ut-article .pagenavigation a:hover { text-decoration: underline; }

/* Gallery field (plg_fields_uthonggallery) */
.ut-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ut-gallery__item { display: block; border-radius: var(--ut-radius); overflow: hidden; background: var(--ut-placeholder); }
.ut-gallery__item img { display: block; width: 100%; height: 110px; object-fit: cover; border-radius: 0; transition: transform .2s; }
.ut-gallery__item:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .ut-gallery__item img { transition: none; } }
.field-entry .field-label { font-family: var(--ut-font-head); font-weight: 600; }

/* ---------- Lightbox ---------- */
.ut-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 8px 16px;
  background: rgba(15, 20, 26, .92);
  touch-action: pan-y;
  user-select: none;
}
.ut-lightbox[hidden] { display: none; }
.ut-lightbox__figure { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; min-width: 0; max-width: 100%; }
.ut-lightbox__img { max-width: min(1200px, calc(100vw - 140px)); max-height: calc(100vh - 120px); width: auto; height: auto; border-radius: 4px; }
.ut-lightbox__count { color: #fff; font-size: 14px; }
.ut-lightbox__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
}
.ut-lightbox__btn:hover { background: rgba(255, 255, 255, .26); }
.ut-lightbox__btn[hidden] { display: none; }
.ut-lightbox__btn:focus-visible { outline-color: #fff; }
.ut-lightbox__close { position: absolute; top: 8px; right: 8px; }
@media (max-width: 600px) {
  .ut-lightbox__img { max-width: calc(100vw - 16px); }
  .ut-lightbox__prev, .ut-lightbox__next { position: absolute; bottom: 12px; }
  .ut-lightbox__prev { left: 16px; }
  .ut-lightbox__next { right: 16px; }
  .ut-lightbox { padding-bottom: 80px; }
}
body.ut-lightbox-open { overflow: hidden; }

/* ---------- Category pages: news list and table (mockup B) ---------- */
.ut-list { display: flex; flex-direction: column; gap: 28px; }
.ut-list > * { margin-top: 0; margin-bottom: 0; }
.ut-list__head { display: flex; flex-direction: column; gap: 8px; }
.ut-list__title,
.ut-list h1,
.ut-list .page-header h1 { margin: 0; font-size: 38px; line-height: 1.3; }
.ut-list__desc, .ut-list .category-desc { color: var(--ut-text-muted); }
.ut-list__desc > :last-child, .ut-list .category-desc > :last-child { margin-bottom: 0; }
.category-list.ut-list > div { display: flex; flex-direction: column; gap: 28px; }
.category-list.ut-list > div > * { margin: 0; }

.ut-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ut-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--ut-tap);
  padding: 0 18px;
  border: 1px solid var(--ut-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ut-text);
  text-decoration: none;
}
.ut-chip:hover { border-color: var(--ut-primary); color: var(--ut-primary); }
.ut-chip.is-current { border-color: var(--ut-primary); background: var(--ut-primary); color: #fff; font-weight: 600; }

.ut-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
}
.ut-newscard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
}
.ut-newscard__media { height: 170px; background: var(--ut-placeholder); }
.ut-newscard__media img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.ut-newscard__body { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.ut-newscard__title { margin: 0; font-family: var(--ut-font-body); font-size: 17px; line-height: 1.5; font-weight: 600; }
.ut-newscard__title a { color: var(--ut-text); text-decoration: none; }
.ut-newscard__title a::after { content: ""; position: absolute; inset: 0; }
.ut-newscard { position: relative; }
.ut-newscard:hover { border-color: var(--ut-primary); }
.ut-newscard:hover .ut-newscard__title a { color: var(--ut-primary); }
.ut-newscard:focus-within { outline: 3px solid var(--ut-primary); outline-offset: 2px; }
.ut-newscard__title a:focus-visible { outline: none; }
.ut-newscard__text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ut-text-muted); }

/* Pagination (core markup) */
.ut-pagination { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ut-pagination .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ut-pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ut-tap);
  min-height: var(--ut-tap);
  padding: 0 12px;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius) !important;
  background: #fff;
  color: var(--ut-text);
  text-decoration: none;
}
.ut-pagination .page-link:hover { border-color: var(--ut-primary); color: var(--ut-primary); }
.ut-pagination .active .page-link,
.ut-pagination .page-link[aria-current] { border-color: var(--ut-primary); background: var(--ut-primary); color: #fff; }
.ut-pagination .disabled .page-link { color: var(--ut-text-muted); background: var(--ut-surface); }
.ut-pagination__counter { margin: 0; font-size: 14px; color: var(--ut-text-muted); }

/* Table list (e.g. ITA) in mockup B colours */
.ut-table-wrap { overflow-x: auto; }
.ut-list .com-content-category__table,
.ut-list table.category {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: #fff;
  --bs-table-bg: #fff;
  --bs-table-striped-bg: var(--ut-surface);
  --bs-table-hover-bg: var(--ut-primary-soft);
}
.ut-list table.category th,
.ut-list table.category td { padding: 12px 14px; border-bottom: 1px solid var(--ut-border); vertical-align: top; }
.ut-list table.category thead th { background: var(--ut-surface); font-weight: 600; color: var(--ut-text); }
.ut-list table.category thead th a { color: var(--ut-text); }
.ut-list table.category tbody a { color: var(--ut-text); text-decoration: none; }
.ut-list table.category tbody a:hover { color: var(--ut-primary); text-decoration: underline; }
.ut-list table.category tbody th { font-weight: 400; }
.ut-list .com-content-category__pagination { display: flex; flex-direction: column; align-items: center; gap: 8px; }

@media (max-width: 600px) {
  .ut-article__title { font-size: 26px; }
  .ut-list__title, .ut-list h1, .ut-list .page-header h1 { font-size: 30px; }
}

/* ---------- Footer ---------- */
.ut-footer {
  background: var(--ut-dark);
  color: var(--ut-on-dark);
  padding: 56px 0 0;
}
.ut-footer a { color: var(--ut-on-dark); }
.ut-footer a:hover { color: #fff; }
.ut-footer :focus-visible { outline-color: #fff; }
.ut-footer h2, .ut-footer h3, .ut-footer h4 { color: #fff; font-size: 17px; }
.ut-footer__modules { padding-bottom: 32px; }
/* Office logo in the footer module (images/logo.png, width="60%" in the content) */
.ut-footer__modules img[src*="logo"] { width: 96px; max-width: 96px; height: auto; }
/* Lists in the footer module: no bullets, no underline (mockup B) */
.ut-footer__modules ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ut-footer__modules li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--ut-tap);
  text-decoration: none;
}
.ut-footer__modules li a:hover,
.ut-footer__modules li a:focus-visible { text-decoration: underline; }
.ut-footer__bar { background: var(--ut-dark-deep); }
.ut-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 14px;
}
.ut-footer__copyright p { margin: 0; }
.ut-social { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ut-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ut-tap);
  height: var(--ut-tap);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
}
.ut-social__link:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Back to top ---------- */
.ut-totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--ut-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(28, 38, 48, .2);
  cursor: pointer;
}
.ut-totop[hidden] { display: none; }
body.has-cookie .ut-totop { bottom: 96px; }

/* ---------- Cookie notice ---------- */
.ut-cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  background: var(--ut-text);
  color: #fff;
  padding: 14px 0;
}
.ut-cookie__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ut-cookie__text { flex: 1 1 320px; margin: 0; font-size: 14px; line-height: 1.6; }
.ut-cookie a { color: #fff; }
.ut-cookie[hidden] { display: none; }
body.has-cookie { padding-bottom: 96px; }

/* ---------- Special day splash ---------- */
.ut-splash {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 38, 48, .92);
}
.ut-splash[hidden] { display: none; }
.ut-splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 100%;
  max-height: 100%;
}
.ut-splash__img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
}
body.ut-splash-open { overflow: hidden; }

/* ---------- Error page ---------- */
.ut-error__box { max-width: 640px; margin: 0 auto; padding: 32px 0; text-align: center; }
.ut-error__code {
  margin: 0;
  font-family: var(--ut-font-head);
  font-size: 72px;
  font-weight: 600;
  line-height: 1;
  color: var(--ut-primary);
}
.ut-error__title { margin: 16px 0 8px; font-size: 1.875rem; }
.ut-error__text { color: var(--ut-text-muted); }
.ut-error__debug { margin-top: 32px; text-align: left; font-size: 14px; }
.ut-error__debug pre { white-space: pre-wrap; background: var(--ut-surface); padding: 12px; border-radius: var(--ut-radius); }

/* ---------- Home page bands (mockup B; module chrome "homesection") ---------- */
.ut-hsec { padding: var(--ut-section) 0; }
.ut-hsec--alt { background: var(--ut-surface); }
.ut-hsec--tight { padding: 40px 0; }
.ut-hsec--hero { padding: 64px 0; }
/* Photo band (module class "ut-hsec--photo"): image from the template setting, dark layer on top.
   The layer (.68) keeps white and --ut-on-dark text above 4.5:1 even on a white photo. */
.ut-hsec--photo {
  background: linear-gradient(rgba(0, 0, 0, .68), rgba(0, 0, 0, .68)), var(--ut-photo, none) center / cover no-repeat, var(--ut-dark);
  color: var(--ut-on-dark);
}
.ut-hsec--photo .ut-section__title,
.ut-hsec--photo h2, .ut-hsec--photo h3 { color: #fff; }
.ut-hsec--photo a,
.ut-hsec--photo .ut-more,
.ut-hsec--photo .ut-video__title a { color: #fff; }
.ut-hsec--photo .ut-video:hover .ut-video__title a { color: var(--ut-on-dark); }
.ut-hsec--photo :focus-visible,
.ut-hsec--photo .ut-video:focus-within { outline-color: #fff; }
/* Map above the footer (home page, template setting) */
.ut-map { background: var(--ut-placeholder); }
.ut-map iframe { display: block; width: 100%; height: 360px; border: 0; }
.ut-hsec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.ut-hsec__head .ut-section__title { margin: 0; }
.ut-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ut-tap);
  font-weight: 600;
  text-decoration: none;
  color: var(--ut-primary);
}
.ut-more::after { content: "\2192"; font-weight: 600; }
.ut-more:hover { text-decoration: underline; }
.ut-hsec .ut-cards + .ut-more,
.ut-tabpanel + .ut-more { margin-top: 16px; }

/* Hero */
.ut-herob { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.ut-herob__text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 18px; }
.ut-herob__kicker { margin: 0; font-weight: 600; color: var(--ut-primary); }
.ut-herob__title { margin: 0; font-size: 46px; line-height: 1.3; }
.ut-herob__lead { margin: 0; font-size: 18px; line-height: 1.7; color: var(--ut-text-muted); }
.ut-herob__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ut-herob__actions .ut-btn { min-height: 48px; }
.ut-herob__media { flex: 1 1 420px; min-width: 0; }
.ut-herob__media img { display: block; width: 100%; height: 360px; object-fit: cover; border-radius: var(--ut-radius-lg); }
/* Slides (mod_uthong_slider via {loadmoduleid}) inside the hero picture box */
.ut-herob__media .ut-slider img { height: 100%; border-radius: 0; }
/* The box is only ~130px tall: dots and pause go under the picture, arrows hidden (swipe/dots stay) */
.ut-herob__media .ut-slider { background: transparent; }
.ut-herob__media .ut-slider__track { overflow: hidden; border-radius: var(--ut-radius); }
.ut-herob__media .ut-slider__arrow { display: none; }
.ut-herob__media .ut-slider__controls { position: static; transform: none; justify-content: center; margin-top: 6px; padding: 0; border-radius: 0; background: transparent; }
.ut-herob__media .ut-slider__pause { color: var(--ut-text); }
.ut-herob__media .ut-slider__dot::before { background: rgba(28, 38, 48, .3); }
.ut-herob__media .ut-slider__dot[aria-current="true"]::before { background: var(--ut-primary); }
.ut-herob__media .ut-slider :focus-visible { outline-color: var(--ut-primary); box-shadow: none; }
/* Slider shape "Automatic": as tall as the hero text, when the two sit side by side
   (both columns are 420px min + 40px gap + gutters = from 930px wide) */
@media (min-width: 930px) {
  .ut-herob:has(.ut-slider--fill) { align-items: stretch; }
  .ut-herob__media:has(.ut-slider--fill) { display: flex; }
  .ut-herob__media .ut-slider--fill { flex: 1; display: flex; flex-direction: column; }
  .ut-herob__media .ut-slider--fill .ut-slider__track { flex: 1; aspect-ratio: auto; min-height: 200px; }
}

/* Shortcut buttons */
.ut-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ut-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  height: 100%;
  box-sizing: border-box;
  padding: 24px 12px;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
  background: #fff;
  color: var(--ut-text);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}
.ut-shortcut:hover { border-color: var(--ut-primary); color: var(--ut-primary); }
.ut-shortcut__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ut-primary-soft);
  color: var(--ut-primary);
  font-size: 22px;
}

/* Tabs (template.js: [data-ut-tabs]) */
.ut-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ut-tab {
  min-height: var(--ut-tap);
  padding: 0 20px;
  border: 1px solid var(--ut-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ut-text);
  font: inherit;
  cursor: pointer;
}
.ut-tab:hover { border-color: var(--ut-primary); color: var(--ut-primary); }
.ut-tab[aria-selected="true"] { border-color: var(--ut-primary); background: var(--ut-primary); color: #fff; font-weight: 600; }
.ut-tabpanel[hidden] { display: none; }

/* About the office */
.ut-about { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.ut-about__person {
  flex: 1 1 260px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  background: #fff;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
}
.ut-about__person img { display: block; width: 100%; max-width: 240px; height: auto; border-radius: var(--ut-radius); }
.ut-about__name { margin: 0; font-family: var(--ut-font-head); font-size: 20px; font-weight: 600; }
.ut-about__role { margin: 0; color: var(--ut-text-muted); }
.ut-about__main { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ut-about__main .ut-section__title { margin: 0; }
.ut-about__sub { margin: 0 0 8px; font-size: 20px; }
.ut-linklist { margin: 0; padding: 0; list-style: none; }
.ut-linklist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--ut-tap);
  padding: 0 4px;
  border-bottom: 1px solid var(--ut-border);
  color: var(--ut-text);
  text-decoration: none;
}
.ut-linklist a::after { content: "\2192"; color: var(--ut-primary); }
.ut-linklist a:hover { color: var(--ut-primary); }
.ut-values { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.ut-values__title { margin: 0; font-size: 20px; }
.ut-values__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ut-values__list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--ut-border);
  border-radius: var(--ut-radius);
}
.ut-values__letter { min-width: 22px; font-family: var(--ut-font-head); font-size: 22px; font-weight: 600; color: var(--ut-primary); }
.ut-values__text { display: flex; flex-direction: column; font-weight: 600; }
.ut-values__en { font-size: 14px; font-weight: 400; color: var(--ut-text-muted); }

/* Videos */
.ut-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ut-video { position: relative; display: flex; flex-direction: column; gap: 10px; }
.ut-video__thumb { position: relative; display: block; height: 150px; overflow: hidden; border-radius: var(--ut-radius); background: var(--ut-placeholder); }
.ut-video__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ut-video__thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(28, 38, 48, .7) no-repeat center / 22px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}
.ut-video__title { margin: 0; font-family: var(--ut-font-body); font-size: 16px; line-height: 1.5; font-weight: 500; }
.ut-video__title a { color: var(--ut-text); text-decoration: none; }
.ut-video__title a::after { content: ""; position: absolute; inset: 0; }
.ut-video:hover .ut-video__title a { color: var(--ut-primary); }
.ut-video:focus-within { outline: 3px solid var(--ut-primary); outline-offset: 4px; border-radius: var(--ut-radius); }
.ut-video__title a:focus-visible { outline: none; }

/* Cyber manual + documents + side boxes */
.ut-split { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
/* Two equal columns (Samran 15 Nov): cyber manual + downloads | Facebook box + counter */
.ut-split__main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ut-split__main .ut-section__title { margin: 0; }
.ut-split__aside { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.ut-flip { overflow: hidden; border-radius: var(--ut-radius); background: var(--ut-placeholder); }
.ut-flip iframe { display: block; width: 100%; height: 380px; border: 0; }
.ut-doclist { margin: 0; padding: 0; list-style: none; }
.ut-doclist__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--ut-border);
  color: var(--ut-text);
  text-decoration: none;
}
.ut-doclist__link:hover { color: var(--ut-primary); }
.ut-doclist__icon { display: inline-flex; color: var(--ut-primary); }
.ut-doclist__title { flex: 1; }
.ut-doclist__date { font-size: 14px; color: var(--ut-text-muted); }

/* ---------- Visitor counter (mod_uthong_counter) ---------- */
.ut-counter__total { margin: 0 0 8px; font-family: var(--ut-font-head); font-size: 34px; font-weight: 600; letter-spacing: 2px; line-height: 1.2; color: var(--ut-primary); }
.ut-counter__list { margin: 0; }
.ut-counter__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--ut-border); }
.ut-counter__row dt { font-weight: 400; color: var(--ut-text-muted); }
.ut-counter__row dd { margin: 0; font-weight: 600; }

/* ---------- Facebook page box (mod_uthong_fbpage) ---------- */
.ut-fbpage { display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--ut-radius); background: var(--ut-surface); }
.ut-fbpage.is-loaded { display: block; background: none; }
.ut-fbpage.is-loaded .ut-fbpage__link { display: none; }
.ut-fbpage iframe { display: block; margin: 0 auto; }

/* ---------- Staff bar (position staffbar, phase 4) ---------- */
.ut-staffbar { background: var(--ut-surface); border-bottom: 1px solid var(--ut-border); }
.ut-staffbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 52px; }
.ut-staffbar__user { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ut-text-muted); font-size: 15px; }
.ut-staffbar ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ut-staffbar li { margin: 0; }
.ut-staffbar li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--ut-tap);
  padding: 0 12px;
  border-radius: var(--ut-radius);
  color: var(--ut-text);
  font-weight: 600;
  text-decoration: none;
}
.ut-staffbar li a:hover { background: var(--ut-bg); }
.ut-staffbar li.current > a,
.ut-staffbar li.active > a { background: var(--ut-primary-soft); color: var(--ut-primary); }

/* ---------- Front-end article form (core com_content form, phase 4) ---------- */
.view-form .edit.item-page { max-width: 880px; margin: 0 auto; }
.view-form .edit.item-page .page-header h1 { font-family: var(--ut-font-head); font-size: 38px; line-height: 1.3; }
.view-form joomla-tab[orientation="horizontal"] > div[role="tablist"] { gap: 4px; border: 0; border-bottom: 1px solid var(--ut-border); border-radius: 0; background: transparent; box-shadow: none; overflow-x: auto; }
.view-form joomla-tab button[role="tab"] {
  min-height: var(--ut-tap);
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--ut-radius) var(--ut-radius) 0 0;
  background: transparent;
  color: var(--ut-text-footer);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
}
.view-form joomla-tab button[role="tab"][aria-selected="true"] {
  border-color: var(--ut-border);
  border-bottom-color: var(--ut-bg);
  background: var(--ut-bg);
  color: var(--ut-primary);
  font-weight: 600;
  box-shadow: none;
}
.view-form joomla-tab button[role="tab"]::after { display: none; }
.view-form joomla-tab joomla-tab-element { padding: 24px 0 8px; border: 0; background: transparent; }
.view-form .control-group { margin-bottom: 20px; }
.view-form .control-label label { font-weight: 600; margin-bottom: 6px; }
.view-form .form-control,
.view-form .form-select { min-height: var(--ut-tap); border-color: #b9c3cd; border-radius: var(--ut-radius); }
.view-form .form-control:focus,
.view-form .form-select:focus { border-color: var(--ut-primary); box-shadow: 0 0 0 3px rgba(var(--ut-primary-rgb), .2); }
.view-form .tox-tinymce { border-color: #b9c3cd; border-radius: var(--ut-radius); }
/* fields the staff do not use; values keep their defaults (cannot be hidden by settings, task 2 (ช)) */
.view-form .control-group:has(#jform_access),
.view-form .control-group:has(#jform_language),
.view-form .control-group:has(#jform_note),
.view-form .control-group:has(#jform_version_note),
.view-form .control-group:has([id^="jform_urls_"]),
.view-form .control-group:has([id^="jform_images_float_"]),
.view-form .control-group:has([id^="jform_images_imgclass_"]),
.view-form .btns:has(> [data-joomla-dialog*="workflow-graph"]),
.view-form #options .control-group:not(:has(.control-label)) { display: none; }
/* Save / Save & Close / Cancel */
.view-form #adminForm > .d-grid { display: flex !important; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid var(--ut-border); }
.view-form #adminForm > .d-grid .btn { min-height: var(--ut-tap); padding: 0 24px; border-radius: var(--ut-radius); font-weight: 600; }
.view-form #adminForm > .d-grid .btn-primary { background: var(--ut-primary); border-color: var(--ut-primary); }
.view-form #adminForm > .d-grid .btn-primary:hover { background: var(--ut-primary-hover); border-color: var(--ut-primary-hover); }
.view-form #adminForm > .d-grid .btn-danger { background: var(--ut-bg); border-color: var(--ut-border); color: var(--ut-text); }
.view-form #adminForm > .d-grid .btn-danger:hover { background: var(--ut-surface); }

/* ---------- Fancy select (choices.js of the core; Joomla leaves its look to the template) ---------- */
.choices { margin-bottom: 0; border: 1px solid #b9c3cd; border-radius: var(--ut-radius); background: #fff; }
.choices.is-focused { border-color: var(--ut-primary); box-shadow: 0 0 0 3px rgba(var(--ut-primary-rgb), .2); }
.choices__inner { min-height: calc(var(--ut-tap) - 2px); padding: 6px 12px; border: 0; border-radius: var(--ut-radius); background: transparent; font-size: 1rem; }
.choices__input { margin-bottom: 0; padding: 0; background: transparent; font-size: 1rem; }
.choices__list--dropdown, .choices__list[aria-expanded] { z-index: 1070; }
.choices__list--multiple .choices__item { margin: 2px; border: 0; border-radius: 999px; background: var(--ut-primary); }
.choices[data-type*="select-one"] .choices__inner { padding-inline-end: 3rem; }
.choices__button_joomla {
  position: relative;
  padding: 0 10px;
  border: 0;
  background: none;
  color: inherit;
  text-indent: -9999px;
  opacity: .6;
  cursor: pointer;
  appearance: none;
}
.choices__button_joomla::before { content: "\00d7"; position: absolute; inset: 0; display: block; text-align: center; text-indent: 0; }
.choices__button_joomla:hover, .choices__button_joomla:focus-visible { opacity: 1; }
.choices[data-type*="select-one"] .choices__button_joomla { position: absolute; top: 50%; inset-inline-end: 0; width: 20px; height: 20px; margin-block-start: -10px; margin-inline-end: 36px; padding: 0; border-radius: 50%; }

/* ---------- Staff login page (com_users login, phase 4) ---------- */
.view-login .com-users-login { max-width: 480px; margin: 0 auto; }
.view-login .com-users-login__form { padding: 0; border: 0; background: transparent; box-shadow: none; }
.view-login .control-group { margin-bottom: 18px; }
.view-login .control-label label { font-weight: 600; margin-bottom: 6px; }
.view-login .form-control { min-height: var(--ut-tap); border-color: #b9c3cd; border-radius: var(--ut-radius); }
.view-login .btn { min-height: var(--ut-tap); border-radius: var(--ut-radius); font-weight: 600; }
.view-login .btn-primary { background: var(--ut-primary); border-color: var(--ut-primary); }
.view-login .btn-primary:hover { background: var(--ut-primary-hover); border-color: var(--ut-primary-hover); }
/* passkey button icon of the core WebAuthn plugin has no size of its own */
.plg_system_webauthn_login_button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.plg_system_webauthn_login_button svg { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* ---------- My articles page (mod_uthong_myarticles in position content-top, phase 4) ---------- */
/* the page's menu item is a core Login Form; once logged in it only shows a log-out form, which the staff bar already has */
.ut-content:has(.ut-mya) .com-users-logout { display: none; }

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  :root { --ut-gutter: 16px; }
  h1 { font-size: 1.875rem; }
  .ut-header__logo a { font-size: 16px; }
  .ut-header__cta a { padding: 0 12px; }
  .ut-hsec--hero { padding: 40px 0; }
  .ut-map iframe { height: 280px; }
  .ut-herob__title { font-size: 30px; }
  .ut-herob__media img { height: 220px; }
  .ut-flip iframe { height: 320px; }
  .ut-about__person { max-width: none; }
}

/* ---------- Print ---------- */
/* ---------- Classic look (template setting "look_new" = off) ----------
   Puts back mockup B as before 0.5.2: gray text with plain headings, light top strip
   and footer, soft current menu item, rounded (not pill) buttons. The color scheme
   still applies. The photo band and the map are switched off in PHP. */
html.ut-look-classic {
  --ut-text: #1c2630;
  --ut-text-muted: #566270;
  --ut-text-footer: #3d4a57;
  --ut-heading: var(--ut-text);
}
html.ut-look-classic .ut-btn { border-radius: var(--ut-radius); }
html.ut-look-classic .ut-header__cta a { padding: 0 18px; border-radius: var(--ut-radius); }
html.ut-look-classic .ut-topstrip {
  background: var(--ut-surface);
  border-bottom: 1px solid var(--ut-border);
  color: var(--ut-text-footer);
}
html.ut-look-classic .ut-topstrip a { color: var(--ut-primary); }
html.ut-look-classic .ut-mega__topitem.is-active > .ut-mega__toprow { background: var(--ut-primary-soft); }
html.ut-look-classic .ut-mega__topitem.is-active > .ut-mega__toprow .ut-mega__toplink,
html.ut-look-classic .ut-mega__topitem.is-active > .ut-mega__toprow .ut-mega__toggle { color: var(--ut-text); }
html.ut-look-classic .ut-footer { background: var(--ut-surface); color: var(--ut-text-footer); }
html.ut-look-classic .ut-footer a { color: var(--ut-text-footer); }
html.ut-look-classic .ut-footer a:hover { color: var(--ut-primary); }
html.ut-look-classic .ut-footer :focus-visible { outline-color: var(--ut-primary); }
html.ut-look-classic .ut-footer h2,
html.ut-look-classic .ut-footer h3,
html.ut-look-classic .ut-footer h4 { color: var(--ut-text); }
html.ut-look-classic .ut-footer__bar { background: none; }
/* the line above the bottom row spans the content width only, as before */
html.ut-look-classic .ut-footer__bottom {
  border-top: 1px solid transparent;
  background: linear-gradient(var(--ut-border), var(--ut-border)) center top / calc(100% - 2 * var(--ut-gutter)) 1px no-repeat border-box;
}
html.ut-look-classic .ut-social__link,
html.ut-look-classic .ut-social__link:hover { border-color: var(--ut-border); background: #fff; }

@media print {
  .ut-topstrip, .ut-nav, .ut-nav-toggle, .ut-header__cta, .ut-totop, .ut-cookie, .ut-splash, .ut-share { display: none !important; }
}
