:root {
  --site-nav-gutter: clamp(20px, 4vw, 64px);
}

body > header.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 88px;
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 253, 249, 0.97);
}

body > header.site-header .nav {
  position: relative;
  width: calc(100% - (var(--site-nav-gutter) * 2));
  max-width: none;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

body > header.site-header .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 250px;
  min-width: 0;
  text-decoration: none;
}

body > header.site-header .brand picture {
  flex: 0 0 auto;
}

body > header.site-header .brand img {
  width: 92px;
  height: 54px;
  object-fit: contain;
}

body > header.site-header .brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body > header.site-header .brand-name {
  font-family: var(--font-thai);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

body > header.site-header .brand-sub {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

body > header.site-header .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 2.2vw, 38px);
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body > header.site-header .nav-links a {
  display: block;
  padding: 4px 0;
  font-family: var(--font-thai);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}

body > header.site-header .nav-links a:hover,
body > header.site-header .nav-links a:focus-visible,
body > header.site-header .nav-links a[aria-current="page"] {
  color: var(--forest-2, var(--ink));
  box-shadow: inset 0 -2px currentColor;
}

body > header.site-header .nav-actions {
  position: static;
  top: auto;
  right: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 3px;
}

body > header.site-header .language-switch {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--nav-forest, #174c3d);
  border-radius: 999px;
}

body > header.site-header .language-switch a {
  display: grid;
  place-items: center;
  min-height: 38px;
  color: #174c3d;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

body > header.site-header .language-switch a[aria-current="page"] {
  background: #174c3d;
  color: #fff;
}

body > header.site-header .line-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #078b4c;
  color: #fff;
  font-family: var(--font-thai);
  font-weight: 700;
  text-decoration: none;
}

body > header.site-header .phone {
  display: grid;
  gap: 1px;
  font-size: 0.76rem;
  line-height: 1.25;
  white-space: nowrap;
}

body > header.site-header .phone br {
  display: none;
}

body > header.site-header .phone span {
  color: var(--muted, #65736e);
  font-size: 0.67rem;
}

body > header.site-header .phone a {
  font-weight: 700;
  text-decoration: none;
}

body > header.site-header .menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: none;
  color: var(--ink);
}

body > header.site-header .menu-btn span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

body > header.site-header .menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body > header.site-header .menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

body > header.site-header .menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1240px) {
  body > header.site-header {
    height: 72px;
  }

  body > header.site-header .nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  body > header.site-header .nav-actions {
    gap: 12px;
    padding-right: 0;
  }

  body > header.site-header .brand img {
    width: 76px;
  }

  body > header.site-header .brand-name {
    font-size: 1.05rem;
  }

  body > header.site-header .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: calc(var(--site-nav-gutter) * -1);
    right: calc(var(--site-nav-gutter) * -1);
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 12px var(--site-nav-gutter) 20px;
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 14px 24px rgba(23, 55, 45, 0.08);
  }

  body > header.site-header .nav-links.open {
    display: flex;
  }

  body > header.site-header .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--rule);
  }

  body > header.site-header .nav-links li:last-child {
    border-bottom: 0;
  }

  body > header.site-header .nav-links a {
    width: 100%;
    padding: 13px 0;
    font-size: 0.95rem;
    box-shadow: none;
  }

  body > header.site-header .phone,
  body > header.site-header .line-btn {
    display: none;
  }

  body > header.site-header .menu-btn {
    display: block;
    position: relative;
    z-index: 31;
  }
}

@media (max-width: 600px) {
  body > header.site-header .language-switch {
    grid-template-columns: repeat(2, 38px);
  }

  body > header.site-header .language-switch a {
    min-height: 36px;
  }

  body > header.site-header .brand {
    width: auto;
  }

  body > header.site-header .brand-sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body > header.site-header .menu-btn span {
    transition: none;
  }
}

/* Shared Thai hero contract: Home and Services must render one image frame. */
body > main > section.hero {
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  grid-template-rows: minmax(0, 1fr);
  height: clamp(590px, 34vw, 653px);
  min-height: 0;
}

body > main > section.hero > .hero-copy {
  min-height: 0;
}

body > main > section.hero > .hero-media {
  height: 100%;
  min-height: 0;
}

body > main > section.hero > .hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1180px) {
  body > main > section.hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }

  body > main > section.hero > .hero-media {
    height: 460px;
    min-height: 460px;
}

@media (max-width: 600px) {
  body > main > section.hero > .hero-media {
    height: 350px;
    min-height: 350px;
  }
}
