/* Ethan Oracle · i18n switcher styles
 * Loads as a separate CSS file injected via <link rel="stylesheet"> on each
 * page that needs it, OR inlined into existing styles.css. The switcher is
 * built into .nav-links by /assets/i18n.js.
 */

.i18n-switcher {
  position: relative;
  margin-left: 8px;
  list-style: none;
}

.i18n-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: #C9A84C;
  font-family: sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  border-radius: 0;
}

.i18n-trigger:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: #C9A84C;
}

.i18n-switcher.i18n-open .i18n-trigger {
  background: rgba(201, 168, 76, 0.12);
  border-color: #C9A84C;
}

.i18n-current-label {
  font-weight: 600;
  letter-spacing: 0.12em;
}

.i18n-caret {
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.i18n-switcher.i18n-open .i18n-caret {
  transform: rotate(180deg);
}

.i18n-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: rgba(14, 4, 6, 0.96);
  border: 1px solid rgba(201, 168, 76, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(201, 168, 76, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  z-index: 1000;
}

.i18n-switcher.i18n-open .i18n-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.i18n-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: #9098B4;
  transition: background 0.18s ease, color 0.18s ease;
  font-family: Georgia, 'Songti SC', serif;
  font-size: 14px;
}

.i18n-option:hover {
  background: rgba(201, 168, 76, 0.08);
  color: #EEEEFF;
}

.i18n-option .i18n-dot {
  font-size: 8px;
  color: rgba(201, 168, 76, 0.3);
  transition: color 0.18s ease, transform 0.18s ease;
}

.i18n-option.i18n-active {
  color: #C9A84C;
}

.i18n-option.i18n-active .i18n-dot {
  color: #C9A84C;
}

.i18n-option .i18n-name {
  flex: 1;
}

.i18n-option .i18n-code {
  font-family: sans-serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #6c6c8a;
  font-weight: 600;
}

.i18n-option.i18n-active .i18n-code {
  color: #C9A84C;
}

/* Mobile — make the menu open right-aligned with tighter padding */
@media (max-width: 760px) {
  .i18n-switcher {
    margin-left: 4px;
  }
  .i18n-trigger {
    padding: 5px 10px;
    font-size: 10px;
  }
  .i18n-menu {
    right: 0;
    min-width: 160px;
  }
  .i18n-option {
    padding: 9px 14px;
    font-size: 13px;
  }
}

/* === langfix 2026-05-17 ============================================
 * (1) Light-theme override: the menu/options had hard-coded dark
 *     colours with no [data-theme="light"] branch.  Tokens use a
 *     layered fallback —— lab token → global theme token → literal —
 *     because i18n-switcher.css也加载在不含 lab.css 的营销页。
 * (2) Non-zh-CN "Coming Soon" disabled state + badge.
 * Dark mode is untouched (base rules above unchanged).
 * ================================================================= */
:root[data-theme="light"] .i18n-menu {
  background: var(--lab-bg-card, var(--bg-card, #ffffff));
  border-color: var(--lab-border, var(--border-color, #e8d5b0));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .i18n-option {
  color: var(--lab-text-dim, var(--text-secondary, #6b4c2a));
}
:root[data-theme="light"] .i18n-option:hover {
  background: rgba(184, 134, 11, 0.10);
  color: var(--lab-ivory, var(--text-primary, #2c1a0e));
}
:root[data-theme="light"] .i18n-option .i18n-dot {
  color: rgba(184, 134, 11, 0.35);
}
:root[data-theme="light"] .i18n-option .i18n-code {
  color: var(--lab-text-mute, var(--text-muted, #a08060));
}
:root[data-theme="light"] .i18n-option.i18n-active,
:root[data-theme="light"] .i18n-option.i18n-active .i18n-dot,
:root[data-theme="light"] .i18n-option.i18n-active .i18n-code {
  color: var(--lab-gold, var(--accent-gold, #b8860b));
}

/* (2) 非 zh-CN 语言：开发中，不可点 */
.i18n-option.i18n-soon {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.i18n-soon-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--lab-gold, var(--accent-gold, #C9A84C));
  border: 1px solid rgba(212, 175, 55, 0.3);
  margin-left: auto;
  white-space: nowrap;
  flex: none;
}
