/**
 * Public shell — layout-public only.
 * Minimal overrides so header/nav/footer match Tailwind layout (layout.blade.php).
 * No homepage section styling. Load after Tailwind.
 */

/* Topbar: ensure single border (avoid double with .site-header) */
.site-header .topbar {
  border-bottom: none;
}

/* Nav items: Tailwind-like spacing and hover */
.mainnav__item {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: color 0.15s, background-color 0.15s;
}
.mainnav__item:hover {
  color: var(--primary-600);
}
.mainnav__item--active {
  font-weight: 700;
  color: var(--primary-800);
}

/* Dropdown wrapper */
.mainnav__item-wrap {
  position: relative;
  display: inline-block;
}
.mainnav__item-wrap:hover .mainnav__dropdown,
.mainnav__item-wrap:focus-within .mainnav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mainnav__dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  min-width: 12rem;
  max-height: min(70vh, 400px);
  overflow-y: auto;
  padding: 0.25rem 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 50;
}
.mainnav__dropdown-link {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.mainnav__dropdown-link:hover {
  background: #f1f5f9;
  color: var(--primary-600);
}
.mainnav__dropdown-link--active {
  font-weight: 600;
  background: #eff6ff;
  color: var(--primary-600);
}

/* Header utility actions (หน้าแรก, ติดต่อ, เข้าสู่ระบบ) */
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.header-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.15s, color 0.15s;
}
.header-action:hover {
  background: #f8fafc;
  color: var(--primary-600);
}
.header-action__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.header-action__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.header-action__icon path[fill="var(--icon-outline)"],
.header-action__icon path[fill="var(--icon-fill)"] {
  fill: currentColor;
}

/* Hamburger bars (when no legacy style.css) */
.topbar__menu-btn-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.topbar__menu-btn-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 40;
  transition: opacity 0.2s;
}
.mobile-overlay[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}
.mobile-menu-open .mobile-overlay[aria-hidden="false"] {
  opacity: 1;
}

/* Mobile drawer panel */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 320px;
  height: 100%;
  z-index: 50;
  overflow: auto;
  transition: transform 0.25s ease;
}
.mobile-drawer[aria-hidden="true"] {
  transform: translateX(100%);
  visibility: hidden;
}
.mobile-menu-open .mobile-drawer[aria-hidden="false"] {
  transform: translateX(0);
  visibility: visible;
}
.mobile-drawer__panel {
  min-height: 100%;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  padding-top: 3rem;
}
.mobile-drawer__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 0.5rem;
}
.mobile-drawer__close:hover {
  background: #f1f5f9;
  color: #334155;
}
.mobile-drawer__section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.mobile-drawer__utilities {
  margin-bottom: 1rem;
}
.mobile-drawer__utilities .header-actions {
  flex-direction: column;
  align-items: stretch;
}
.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-drawer__link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.15s, color 0.15s;
}
.mobile-drawer__link:hover {
  background: #f8fafc;
  color: var(--primary-600);
}
.mobile-drawer__link--sub {
  padding-left: 1.5rem;
}
.mobile-drawer__link--active {
  font-weight: 700;
  background: #eff6ff;
  color: var(--primary-600);
}

/* Footer */
.footer {
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(52, 46, 28, 0.30) 0%, rgba(20, 30, 19, 0.46) 52%, rgba(10, 20, 15, 0.58) 100%),
    url("../images/misc/footer-bg-fppter.png");
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, cover;
  background-position: center center, center calc(30% + 80px);
  color: #f8fafc;
  min-height: 300px;
}

.footer__inner {
  padding-top: 3.4rem;
  padding-bottom: 2.8rem;
}

.footer__topgrid {
  align-items: start;
}

.footer__brandCol,
.footer__contactCol {
  min-width: 0;
}

.footer__ctaCol {
  justify-self: end;
  align-items: flex-end;
}

.footer__org {
  display: block;
  margin: 0;
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.35;
  color: #ffffff;
}

.footer__subtitle {
  display: block;
  margin-top: 0.2rem;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.35;
  color: #e2e8f0;
  opacity: 1;
}

.footer__copy {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #dbeafe;
}

.footer .contact-section__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.footer .contact-section__list li {
  color: #e2e8f0;
  line-height: 1.5;
}

.footer a {
  color: #f8fafc;
}

.footer .contact-section__list a {
  text-decoration: none;
  border-bottom: 1px dotted rgba(248, 250, 252, 0.65);
}

.footer .contact-section__list a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.footer__social {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  color: #f8fafc;
  opacity: 0.92;
}

.footer__social-link:hover {
  opacity: 1;
}

.footer .pill-btn {
  white-space: nowrap;
}

.footer .pill-btn,
.footer .pill-btn:hover,
.footer a.pill-btn {
  color: #ffffff;
}

.footer .text-slate-400 {
  color: #cbd5e1 !important;
}

.footer .text-slate-500 {
  color: #a8c4dd !important;
}

.footer .border-white\/10 {
  border-color: rgba(255, 255, 255, 0.22) !important;
}

@media (max-width: 767px) {
  .footer__ctaCol {
    justify-self: stretch;
    align-items: flex-start;
  }

  .footer__social {
    justify-content: flex-start;
  }

  .footer {
    min-height: 0;
  }

  .footer__inner {
    padding-top: 2.2rem;
    padding-bottom: 1.8rem;
  }
}

/* ========== Site footer (light 4-column — Na Wang Hin style) ========== */
/* ฟอนต์เดียวกับทั้งเว็บ (site-theme: --tt-font-sans = Mitr) */
.site-footer--surface {
  font-family: var(--tt-font-sans, 'Mitr', system-ui, -apple-system, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #fff;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  position: relative;
}

.site-footer--surface *,
.site-footer--surface *::before,
.site-footer--surface *::after {
  font-family: inherit;
}

.site-footer__inner {
  padding-top: 2.75rem;
  padding-bottom: 1.5rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1.05fr) repeat(3, minmax(0, 1fr));
    gap: 2rem 2.5rem;
    align-items: start;
  }
}

.site-footer__brand {
  font-weight: 800;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--primary-700, #0c3d6b);
  margin: 0 0 0.5rem;
}

.site-footer__subtitle {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #475569;
}

.site-footer__hours {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 1rem;
}

.site-footer__iconlinks {
  display: flex;
  gap: 0.5rem;
}

.site-footer__iconlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  color: var(--primary-600, #0f4c81);
  background: #f8fafc;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-footer__iconlink:hover {
  background: #eff6ff;
  border-color: color-mix(in srgb, var(--primary-600, #0f4c81) 35%, #e2e8f0);
  color: var(--primary-700, #0c3d6b);
}

.site-footer__heading {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-700, #0c3d6b);
  margin: 0 0 1rem;
}

.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__link {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer__link:hover {
  color: var(--primary-600, #0f4c81);
}

.site-footer__link--strong {
  font-weight: 600;
  color: #334155;
}

.site-footer__contactblock {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #64748b;
}

.site-footer__contacticon {
  flex-shrink: 0;
  margin-top: 0.08rem;
  color: var(--primary-600, #0f4c81);
}

.site-footer__contactlabel {
  font-weight: 700;
  color: var(--primary-700, #0c3d6b);
  font-size: 0.8125rem;
}

.site-footer__address {
  color: #64748b;
}

.site-footer__bar {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.site-footer__legal-link {
  font-size: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
}

.site-footer__legal-link:hover {
  color: var(--primary-600, #0f4c81);
}

.site-footer__a11y {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.site-footer__a11y-inner {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.site-footer__a11y-label {
  margin-right: 0.75rem;
}

.site-footer__a11y-link {
  color: #64748b;
  text-decoration: none;
}

.site-footer__a11y-link:hover {
  color: var(--primary-600, #0f4c81);
}

.site-footer__a11y-link.is-active {
  color: var(--primary-700, #0c3d6b);
  font-weight: 600;
}

.site-footer__a11y-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.site-footer__sos {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-family: var(--tt-font-sans, 'Mitr', system-ui, -apple-system, sans-serif);
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(145deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.site-footer__sos:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(185, 28, 28, 0.35);
  color: #fff;
}

@media (min-width: 1024px) {
  .site-footer__sos {
    right: 1.5rem;
    bottom: 2rem;
  }
}

body.theme-high-contrast .site-footer--surface {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
body.theme-high-contrast .site-footer__brand,
body.theme-high-contrast .site-footer__heading,
body.theme-high-contrast .site-footer__contactlabel {
  color: #f1f5f9 !important;
}
body.theme-high-contrast .site-footer__link,
body.theme-high-contrast .site-footer__subtitle,
body.theme-high-contrast .site-footer__hours,
body.theme-high-contrast .site-footer__address,
body.theme-high-contrast .site-footer__copy,
body.theme-high-contrast .site-footer__legal-link,
body.theme-high-contrast .site-footer__a11y-inner,
body.theme-high-contrast .site-footer__a11y-link {
  color: #cbd5e1 !important;
}
body.theme-high-contrast .site-footer__bar,
body.theme-high-contrast .site-footer__a11y {
  border-color: #334155 !important;
}
body.theme-high-contrast .site-footer__iconlink {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #93c5fd !important;
}

/* Dark / civic footer legacy — keep if old .footer still used elsewhere */
