/* =========================================
   1. GLOBAL & VARIABLES
   ========================================= */
:root {
  --black: #111;
  --muted: #7a7a7a;
  --light-gray: #f9f9f9;
  --border: #e5e5e5;
  --radius: 8px;
  --container-max: 1200px;
  
  /* Navbar specific */
  --nav-solid: rgba(0, 0, 0, 0.86);
  --nav-transparent: transparent;
  --icon-color: #fff;
  --brand-orange: #EF8354;

  /* Browsers resolve font fallback per glyph, so Latin comes from the first
     family that has it and Thai from the first family that has Thai. None of
     Inter / Manrope / Fraunces / Playfair carry Thai, so Prompt supplies it.
     Prompt must sit AFTER every Latin family in a stack, not just after the
     first: put it earlier and it silently takes over the Latin fallback too
     whenever a preceding face fails to load. */
  --font-thai: 'Prompt';
  --font-sans: 'Inter', 'Helvetica Neue', Arial, var(--font-thai), sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: #fff;
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  
  /* Sticky Footer Logic */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

/* Common Layout Utilities */
main, .page-container {
  flex: 1; /* Pushes footer down */
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px 24px 100px;
}

/* =========================================
   2. NAVBAR STYLES
   ========================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-solid);
  padding: 10px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  transition: background 280ms ease, box-shadow 280ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.nav.transparent {
  background: var(--nav-transparent);
  box-shadow: none;
  backdrop-filter: none;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 160ms, opacity 160ms;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.95;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.nav-icon {
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav svg {
  stroke: var(--icon-color);
  width: 18px;
  height: 18px;
  display: block;
}

/* Sidebar & Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity .25s;
}

.overlay[aria-visible="true"] { opacity: 1; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: #fff;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
}

.sidebar[aria-hidden="false"] { transform: translateX(0); }

.close-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
}

.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #222;
  margin: 0;
}

.menu {
  list-style: none;
  padding: 12px 0;
  margin: 0;
}

.menu li a {
  display: block;
  padding: 12px 20px;
  color: #222;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 150ms;
}

.menu li a:hover {
  background: rgba(239, 131, 84, 0.06);
  border-left-color: var(--brand-orange);
  color: var(--brand-orange);
}

/* Mobile Nav Tweaks */
@media (max-width: 576px) {
  .nav { padding: 8px 14px; }
  .logo { height: 30px; }
  .nav-right { gap: 8px; }
}

/* =========================================
   3. FOOTER STYLES
   ========================================= */
.site-footer {
  background-color: #111;
  color: #fff;
  font-family: var(--font-sans);
  padding: 4rem 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  margin-top: auto; /* Ensures sticky footer */
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr; 
  gap: 3rem;
}

.footer-heading {
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  color: #fff;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  color: #a0a0a0;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--brand-orange); }

.footer-logo img {
  height: 30px;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1);
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-icons a {
  color: #fff;
  transition: transform 0.2s, color 0.2s;
}

.social-icons a:hover {
  color: var(--brand-orange);
  transform: translateY(-2px);
}

/* Newsletter */
.newsletter-text {
  color: #a0a0a0;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.newsletter-form { display: flex; gap: 0.5rem; }

.newsletter-input {
  flex: 1;
  background: #222;
  border: 1px solid #333;
  padding: 10px 14px;
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--brand-orange);
}

.newsletter-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 0 16px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}

.newsletter-btn:hover {
  background: var(--brand-orange);
  color: #fff;
}

.newsletter-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.newsletter-btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: stb-newsletter-spin 0.7s linear infinite;
}

@keyframes stb-newsletter-spin {
  to { transform: rotate(360deg); }
}

.newsletter-status {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.newsletter-status.is-success {
  color: #7bd389;
}

.newsletter-status.is-error {
  color: #ff8a8a;
}

.footer-bottom {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: #555;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .social-icons, .newsletter-form { justify-content: center; }
  .newsletter-form { flex-direction: column; align-items: stretch; }
  .newsletter-btn { width: 100%; min-height: 42px; }
  .footer-logo img { margin: 0 auto 1.5rem; display: block; }
}
/* Style ปุ่มสลับภาษาแบบแคปซูล */
.lang-toggle {
    display: flex;
    background: #e9ecef;
    padding: 4px;
    border-radius: 50px;
    position: relative;
    width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.lang-btn {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    padding: 6px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    line-height: 1;
}

.lang-btn.active {
    background: #ffffff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-btn:hover:not(.active) {
    color: #555;
}
