/* Shared 茶与境 language control, scoped to the poetry header. */
.cc-poetry-header .syj-language-switcher {
  --language-gold: #8e6b37;
  --language-gold-deep: #705329;
  position: relative;
  padding-bottom: 8px;
}

.syj-language-switcher > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--language-gold);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .1em;
  transition: color .15s;
}

.syj-language-switcher > summary:hover { color: var(--language-gold-deep); }
.syj-language-switcher .lang-earth { width: 18px; height: 18px; flex: none; fill: currentColor; }
.syj-language-switcher__chevron { width: 12px; height: 12px; flex: none; }
.syj-language-switcher__label { white-space: nowrap; }

.syj-language-switcher__panel {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 50;
  width: 144px;
  max-width: calc(100vw - 32px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(142, 107, 55, .2);
  border-radius: 14px;
  background: #faf8f5;
  color: var(--language-gold);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
}

.syj-language-switcher__panel a {
  display: block;
  padding: .75rem 1rem;
  border-left: 2px solid transparent;
  color: inherit;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: .75rem;
  line-height: 1rem;
  letter-spacing: .05em;
  text-decoration: none;
  transition: color 200ms, background-color 200ms, border-color 200ms;
}

.syj-language-switcher__panel a:is(:hover, :focus-visible) {
  border-left-color: var(--language-gold);
  background-color: rgba(142, 107, 55, .08);
  color: var(--language-gold-deep);
}

.syj-language-switcher__panel a[aria-current="page"] {
  border-left-color: var(--language-gold-deep);
  color: var(--language-gold-deep);
  font-weight: 600;
}

.syj-language-switcher__panel a:focus-visible { outline-offset: -3px; }

:is(html:lang(en), html:lang(es), html:lang(fr)) .syj-language-switcher :is(summary, a) {
  font-family: Optima, "Avenir Next", Candara, "Segoe UI Variable", "Segoe UI", sans-serif;
  letter-spacing: .06em;
}

:is(html:lang(en), html:lang(es), html:lang(fr)) .syj-language-switcher > summary { font-size: 18px; }
:is(html:lang(en), html:lang(es), html:lang(fr)) .syj-language-switcher__panel a { font-size: 14px; }

@media (max-width: 48rem) {
  .cc-poetry-header .syj-language-switcher > summary { gap: 4px; font-size: 12px; }
  .syj-language-switcher__label { max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 30rem) {
  .syj-language-switcher__label { max-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .syj-language-switcher :is(summary, a) { transition: none; }
}
