/* Concrete layout fallbacks for older browser cores. */
.language-switcher {
  display: inline-flex;
  flex: none;
  margin-left: 20px;
  padding: 2px;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: .78;
}

/* Secondary pages always expose a clear route back to the local homepage. */
.site-back-home {
  position: absolute;
  z-index: 65;
  top: 31px;
  left: 230px;
  display: inline-flex;
  align-items: center;
  grid-gap:8px;gap: 8px;
  padding-left: 18px;
  border-left: 1px solid currentColor;
  color: #fff;
  font-size: 10px;
  letter-spacing: .06em;
  opacity: .78;
  transition: opacity .2s;
}

.site-back-home:hover { opacity: 1; }
.site-back-home span { color: var(--orange, #f05a30); font-size: 15px; }

body:has(.header.scrolled) .site-back-home {
  position: fixed;
  top: 23px;
  color: var(--ink, #222725);
}

.language-switcher button {
  min-width: 27px;
  height: 25px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 8px;
  cursor: pointer;
}

.language-switcher button.active {
  background: var(--navy, #182a38);
  color: #fff;
}

.header:not(.scrolled) .language-switcher button.active {
  background: #fff;
  color: var(--navy, #182a38);
}

.topbar .language-switcher {
  margin-left: 16px;
  color: var(--ink, #22201d);
}

.topbar .language-switcher button.active {
  background: var(--ink, #22201d);
  color: #fff;
}

html[lang="en"] body {
  letter-spacing: 0;
}

html[lang="en"] .hero h1,
html[lang="en"] .sub-hero h1,
html[lang="en"] h2 {
  letter-spacing: -.015em;
}

html[lang="en"] .hero h1 {
  max-width: calc(100vw - 560px);
  font-size:64px;font-size: clamp(44px, 4.2vw, 64px);
  line-height: 1.15;
}

html[lang="en"] .hero .hero-line { white-space: normal; }

@media (max-width: 950px) {
  html[lang="en"] .hero h1 { max-width: 100%; }
}

@media (max-width: 680px) {
  html[lang="en"] .hero h1 {
    font-size:40px;font-size: clamp(32px, 9vw, 40px);
    line-height: 1.12;
  }
}

@media (max-width: 1200px) {
  .header nav { grid-gap:16px;gap: 16px; }
  .language-switcher { margin-left: 12px; }
}

@media (max-width: 950px) {
  .site-back-home,
  body:has(.header.scrolled) .site-back-home {
    position: absolute;
    top: 20px;
    left: auto;
    right: 157px;
    width: 35px;
    height: 35px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    background: rgba(24, 42, 56, .72);
    color: #fff;
    font-size: 0;
    opacity: 1;
  }

  .site-back-home span { color: #fff; font-size: 17px; }

  .language-switcher {
    margin-left: auto;
    margin-right: 10px;
    color: var(--ink, #222725);
    background: transparent;
  }

  .header .language-switcher button.active {
    background: var(--navy, #182a38);
    color: #fff;
  }

  .topbar .language-switcher {
    margin-left: auto;
    margin-right: 10px;
  }
}

@media (max-width: 520px) {
  .language-switcher button {
    min-width: 24px;
    padding: 0 3px;
  }
}

/* Compact dropdown language control */
.language-switcher {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  opacity: 1;
}

.language-switcher .language-current {
  width: 54px;
  min-width: 54px;
  height: 34px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-gap:0;gap: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
}

.language-current i {
  flex: none;
  margin-left: 8px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .2s;
}

.language-switcher.open .language-current i { transform: rotate(180deg); }

.language-options {
  position: absolute;
  z-index: 140;
  top: calc(100% + 7px);
  right: 0;
  width: 62px;
  min-width: 62px;
  padding: 0;
  display: none;
  background: transparent;
  color: inherit;
  border: 0;
  box-shadow: none;
}

.language-switcher.open .language-options { display: grid; }

.language-options button {
  position: relative;
  width: 100%;
  height: 31px;
  padding: 0 7px;
  text-align: center;
  color: inherit;
  text-shadow: 0 1px 4px rgba(0,0,0,.28);
}

.language-options button::after { display: none; }

.language-current-label { font-size: 0; }
html[lang="zh-Hans"] .language-current-label::after { content: "简"; font-size: 9px; }
html[lang="zh-Hant"] .language-current-label::after { content: "繁"; font-size: 9px; }
html[lang="en"] .language-current-label::after { content: "EN"; font-size: 9px; }

.language-options button.active,
.header:not(.scrolled) .language-options button.active,
.topbar .language-options button.active {
  background: transparent;
  color: inherit;
}

@media (max-width: 950px) {
  .language-switcher .language-current {
    min-width: 54px;
    width: 54px;
    height: 34px;
    padding: 0 9px;
    background: transparent;
    color: inherit;
  }

  .language-options { right: 0; }
}

@media (max-width: 430px) {
  .language-switcher .language-current {
    min-width: 43px;
    width: 43px;
    justify-content: center;
    grid-gap:0;gap: 0;
    padding: 0 6px;
  }

  .language-current i { margin-left: 3px; }

}
/* Grid children must be allowed to shrink when English fonts fall back. */
html[lang="en"] .miao-copy { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .miao { grid-template-columns: minmax(0, 1fr); }
}
