/* Lertchai Master — shared public shell
   Header, footer, typography and cross-page interaction styles only.
   Keep page-specific components in their own stylesheet. */

:root {
  --lm-navy: #061a38;
  --lm-navy-2: #0b3c78;
  --lm-blue: #0b579f;
  --lm-gold: #f4c542;
  --lm-gold-deep: #d7a437;
  --lm-surface: #ffffff;
  --lm-page: #f6f8fb;
  --lm-line: rgba(6, 26, 56, .09);
  --lm-text: #172033;
  --lm-muted: #667085;
  --lm-font-th: "Prompt", "Noto Sans Thai", Tahoma, system-ui, sans-serif;
  --lm-font-reading: "Noto Sans Thai", "Prompt", Tahoma, system-ui, sans-serif;
  --lm-font-en: "Inter", "Segoe UI", Arial, sans-serif;
  --lm-shadow-sm: 0 8px 24px rgba(6, 26, 56, .07);
  --lm-shadow-md: 0 18px 46px rgba(6, 26, 56, .11);
  --lm-container: 1180px;
}

html { scroll-padding-top: 88px; }

body,
button,
input,
select,
textarea {
  font-family: var(--lm-font-th);
}

body {
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  word-break: normal;
  overflow-wrap: normal;
  line-break: auto;
  hyphens: none;
}

.site-header *,
.site-footer * { box-sizing: border-box; }

.site-header a,
.site-footer a { color: inherit; text-decoration: none; }

.site-header img,
.site-footer img { display: block; max-width: 100%; }

.site-header .container,
.site-footer .container {
  width: min(var(--lm-container), calc(100% - 36px));
  margin-inline: auto;
}

.utility-brand-name,
.footer-brand-block h2,
.footer-total-counter strong {
  font-family: var(--lm-font-en);
}

.nav-link,
.dropdown,
.footer-tagline,
.footer-motto,
.footer-contact-copy strong,
.footer-links-block a,
.footer-copyright {
  word-break: normal;
  overflow-wrap: normal;
  line-break: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--lm-line);
  box-shadow: 0 6px 22px rgba(6, 26, 56, .065);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow .22s ease, background .22s ease;
}

.utility-bar {
  max-height: 34px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(90deg, #061a38 0%, #0a315f 100%);
  border-bottom: 1px solid rgba(244, 197, 66, .24);
  transition: max-height .22s ease, opacity .18s ease, border-color .18s ease;
}

.utility-shell {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: .74rem;
  line-height: 1;
}

.utility-brand,
.utility-links,
.utility-link { display: flex; align-items: center; }

.utility-brand {
  min-width: 0;
  gap: 7px;
  white-space: nowrap;
}

.utility-brand-name {
  color: var(--lm-gold);
  font-weight: 700;
  letter-spacing: .01em;
}
.utility-divider { color: rgba(255, 255, 255, .32); }
.utility-desc { color: rgba(255, 255, 255, .80); font-weight: 500; }

.utility-links { flex: 0 0 auto; gap: 4px; }
.utility-link {
  min-height: 28px;
  gap: 6px;
  padding: 0 9px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .90);
  font-weight: 600;
  transition: color .18s ease, background .18s ease;
}
.utility-link:hover,
.utility-link:focus-visible { color: #fff; background: rgba(255, 255, 255, .09); }

.utility-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--lm-gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.utility-admin-link {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: 3px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  transition: background .18s ease, border-color .18s ease;
}
.utility-admin-link .utility-icon { stroke: rgba(255, 255, 255, .72); }
.utility-admin-link:hover,
.utility-admin-link:focus-visible { background: rgba(255, 255, 255, .12); border-color: rgba(244, 197, 66, .46); }
.utility-admin-link:hover .utility-icon,
.utility-admin-link:focus-visible .utility-icon { stroke: var(--lm-gold); }

.site-header.is-scrolled .utility-bar { max-height: 0; opacity: 0; border-bottom-color: transparent; }
.site-header.is-scrolled { background: rgba(255, 255, 255, .985); box-shadow: 0 9px 28px rgba(6, 26, 56, .10); }

.brand-area { background: rgba(255, 255, 255, .96); border-bottom: 0; }
.header-shell {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 30px;
  transition: min-height .22s ease;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; margin-right: auto; }
.brand-logo-wrap { display: flex; align-items: center; }
.brand-logo {
  height: 65px;
  width: auto;
  object-fit: contain;
  filter: none;
  transition: height .22s ease, transform .18s ease;
}
.brand:hover .brand-logo { transform: translateY(-1px); }
.site-header.is-scrolled .header-shell { min-height: 70px; }
.site-header.is-scrolled .brand-logo { height: 54px; }

.main-nav-wrap { flex: 0 1 auto; background: transparent; border: 0; box-shadow: none; }
.main-nav { min-height: 0; display: flex; justify-content: flex-end; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-item { position: relative; border: 0; }
.nav-link {
  position: relative;
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border-radius: 12px;
  color: #24364f;
  background: transparent;
  font-size: .91rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: var(--lm-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}
.nav-link:hover,
.nav-item:hover > .nav-link,
.nav-link:focus-visible,
.nav-link.is-active {
  color: var(--lm-navy-2);
  background: rgba(11, 87, 159, .055);
}
.nav-link:hover::after,
.nav-item:hover > .nav-link::after,
.nav-link:focus-visible::after,
.nav-link.is-active::after { transform: scaleX(1); }
.dropdown-icon { color: var(--lm-gold-deep); font-size: .94rem; }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 318px;
  padding: 10px;
  border-top: 3px solid var(--lm-gold);
  border-radius: 18px;
  background: rgba(6, 26, 56, .98);
  box-shadow: 0 24px 56px rgba(6, 26, 56, .25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  z-index: 1001;
}
.dropdown-right { left: auto; right: 0; }
.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-intro,
.dropdown a { display: block; color: #fff; border-radius: 10px; }
.dropdown-intro {
  padding: 12px 13px;
  margin-bottom: 8px;
  border: 1px solid rgba(244, 197, 66, .28);
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 255, 255, .84);
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.65;
}
.dropdown a {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(88, 113, 149, .14);
  font-size: .84rem;
  font-weight: 400;
  line-height: 1.55;
  transition: color .18s ease, background .18s ease, padding-left .18s ease;
}
.dropdown a:last-child { border-bottom: 0; }
.dropdown a:hover,
.dropdown a:focus-visible { color: var(--lm-gold); background: rgba(255, 255, 255, .07); padding-left: 15px; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(6, 26, 56, .10);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--lm-shadow-sm);
  color: var(--lm-navy);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Cross-page interactions */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.show { opacity: 1; transform: none; }

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  z-index: 999;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 164, 55, .36);
  border-radius: 999px;
  color: var(--lm-navy);
  background: radial-gradient(circle at 30% 12%, rgba(255,255,255,.82), transparent 36%), linear-gradient(135deg,#fff7df 0%,#f4c542 54%,#d7a437 100%);
  box-shadow: 0 12px 26px rgba(7,36,77,.16), 0 0 0 4px rgba(255,243,209,.44);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, visibility .25s ease, transform .25s ease, box-shadow .25s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(7,36,77,.18), 0 0 0 5px rgba(255,243,209,.56); }
.back-to-top:focus-visible,
.nav-link:focus-visible,
.dropdown a:focus-visible,
.utility-link:focus-visible,
.utility-admin-link:focus-visible,
.footer-admin-link:focus-visible,
.footer-contact-line:focus-visible,
.footer-links-block a:focus-visible { outline: 3px solid rgba(244, 197, 66, .72); outline-offset: 3px; }

/* Footer */
.site-footer.footer-main {
  position: relative;
  overflow: hidden;
  padding: 38px 0 18px;
  border-top: 0;
  background: radial-gradient(circle at 93% -15%, rgba(244,197,66,.12), transparent 34%), radial-gradient(circle at -8% 115%, rgba(255,255,255,.055), transparent 30%), linear-gradient(135deg,#061a38 0%,#0a315f 62%,#0b3c78 100%);
  color: #fff;
}
.footer-shell {
  display: grid;
  grid-template-columns: minmax(0,1.28fr) minmax(150px,.66fr) minmax(360px,1.18fr);
  gap: clamp(28px,4vw,54px);
  align-items: start;
}
.footer-brand-block { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.footer-logo { width: 72px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 8px 18px rgba(0,0,0,.14)); }
.footer-brand-copy { min-width: 0; }
.footer-brand-block h2 { margin: 0 0 7px; color: #fff; font-size: 1.14rem; font-weight: 700; line-height: 1.45; }
.footer-tagline { max-width: 370px; margin: 0; color: rgba(255,255,255,.78); font-size: .77rem; line-height: 1.7; }
.footer-motto { margin: 9px 0 0; color: var(--lm-gold); font-size: .75rem; font-weight: 700; }
.footer-label { display: block; margin: 0 0 11px; color: var(--lm-gold); font-size: .72rem; font-weight: 700; }
.footer-links-block { display: grid; align-content: start; gap: 8px; min-width: 0; }
.footer-links-block a { width: fit-content; color: rgba(255,255,255,.79); font-size: .77rem; font-weight: 500; line-height: 1.65; transition: color .18s ease, transform .18s ease; }
.footer-links-block a:hover { color: #fff; transform: translateX(2px); }
.footer-contact-block { min-width: 0; }
.footer-contact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 24px; }
.footer-contact-column { display: grid; align-content: start; gap: 13px; min-width: 0; }
.footer-contact-line { display: flex; align-items: flex-start; gap: 9px; min-width: 0; color: rgba(255,255,255,.88); transition: color .18s ease, transform .18s ease; }
.footer-contact-line:hover { color: #fff; transform: translateX(2px); }
.footer-contact-icon { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; margin-top: 1px; color: var(--lm-gold); font: 800 .72rem/1 Arial,sans-serif; }
.footer-facebook .footer-contact-icon { color: #fff; font-size: .76rem; text-transform: lowercase; }
.footer-contact-copy { display: block; min-width: 0; }
.footer-contact-copy small,
.footer-contact-copy strong { display: block; }
.footer-contact-copy small { margin-bottom: 2px; color: rgba(255,255,255,.52); font-size: .58rem; line-height: 1.25; }
.footer-contact-copy strong { color: rgba(255,255,255,.90); font-size: .69rem; font-weight: 600; line-height: 1.65; white-space: normal; }
.footer-email-copy strong { overflow-wrap: anywhere; }
.footer-bottom {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(62px,1fr);
  align-items: center;
  gap: 20px;
  margin-top: 25px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.11);
  color: rgba(255,255,255,.56);
  font-size: .67rem;
}
.footer-total-counter { display: inline-flex; align-items: baseline; justify-content: center; gap: 6px; min-width: max-content; color: rgba(255,255,255,.72); font-size: .67rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.footer-total-counter strong { color: var(--lm-gold); font-size: .82rem; font-weight: 900; letter-spacing: .01em; }
.footer-total-counter small { color: rgba(255,255,255,.50); font-size: .58rem; }
.footer-admin-link { justify-self: end; color: rgba(255,255,255,.58); font-size: .64rem; transition: color .18s ease; }
.footer-admin-link:hover { color: var(--lm-gold); }

@media (max-width: 1180px) {
  .header-shell { gap: 18px; }
  .brand-logo { height: 58px; }
  .nav-menu { gap: 5px; }
  .nav-link { padding-inline: 8px; font-size: .84rem; }
}

@media (max-width: 1050px) {
  .footer-shell { grid-template-columns: minmax(0,1.1fr) minmax(140px,.62fr) minmax(330px,1.16fr); gap: 24px; }
  .footer-contact-grid { gap-inline: 18px; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 80px; }
  .header-shell { min-height: 72px; }
  .brand-logo { height: 52px; }
  .site-header.is-scrolled .header-shell { min-height: 66px; }
  .site-header.is-scrolled .brand-logo { height: 48px; }
  .menu-toggle { display: grid; place-items: center; margin-left: auto; }
  .main-nav-wrap { position: static; }
  .nav-menu {
    position: fixed;
    top: 110px;
    left: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    max-height: calc(100vh - 126px);
    overflow-y: auto;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    background: rgba(6,26,56,.985);
    box-shadow: 0 24px 56px rgba(6,26,56,.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  }
  .nav-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-link { width: 100%; height: auto; min-height: 48px; justify-content: space-between; padding: 11px 14px; color: #fff; font-size: .95rem; }
  .nav-link::after { display: none; }
  .nav-link:hover,
  .nav-item:hover > .nav-link,
  .nav-link.is-active { color: var(--lm-gold); background: rgba(255,255,255,.07); }
  .dropdown { position: static; width: 100%; display: none; margin: 4px 0 10px; opacity: 1; visibility: visible; transform: none; box-shadow: none; }
  .dropdown-right { right: auto; }
  .nav-item.open > .dropdown { display: block; }
  .site-header.is-scrolled .nav-menu { top: 70px; max-height: calc(100vh - 84px); }
}

@media (max-width: 820px) {
  .footer-shell { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-contact-block { grid-column: 1 / -1; }
  .footer-contact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 28px; }
  .footer-bottom { grid-template-columns: 1fr auto; row-gap: 8px; }
  .footer-total-counter { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .footer-copyright { grid-column: 1; grid-row: 2; }
  .footer-admin-link { grid-column: 2; grid-row: 2; }
}

@media (max-width: 680px) {
  .site-header .container,
  .site-footer .container { width: min(100% - 28px, var(--lm-container)); }
  .utility-shell { min-height: 32px; font-size: .72rem; gap: 10px; }
  .utility-bar { max-height: 32px; }
  .utility-desc,
  .utility-divider,
  .utility-link-label { display: none; }
  .utility-brand { gap: 0; }
  .utility-link { width: 30px; min-height: 28px; justify-content: center; padding: 0; }
  .utility-admin-link { width: 28px; height: 28px; margin-left: 1px; }
  .header-shell { min-height: 68px; }
  .brand-logo { height: 48px; }
  .menu-toggle { width: 42px; height: 42px; }
  .nav-menu { top: 104px; }
  .site-header.is-scrolled .nav-menu { top: 68px; }
}

@media (max-width: 600px) {
  .site-footer.footer-main { padding-top: 32px; }
  .footer-shell { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand-block { display: block; }
  .footer-logo { width: 68px; margin-bottom: 11px; }
  .footer-contact-block { grid-column: auto; }
  .footer-contact-grid { grid-template-columns: 1fr; gap: 13px; }
  .footer-contact-column { gap: 13px; }
  .footer-bottom { display: flex; align-items: center; flex-direction: column; gap: 7px; margin-top: 22px; text-align: center; }
  .footer-total-counter { order: -1; }
  .footer-admin-link { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
