/*
  KinoCampus — seletor de idioma (docs/architecture/i18n.md)
  Botão do cabeçalho (.kc-locale-toggle, ao lado do tema), lista que abre
  nele (.kc-locale-menu) e cartão de Configurações (.kc-locale-options).
  Só cores do tema (var(--kc-*)); o styles.css não muda.
*/

.kc-locale {
  position: relative;
  display: inline-flex;
  flex: none;
}

.kc-header .kc-user-actions .kc-locale-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 18px;
  border: 1px solid var(--kc-border-dark);
  background-color: var(--kc-background-dark);
  color: var(--kc-text-dark-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-speed, 0.2s) ease, border-color var(--transition-speed, 0.2s) ease;
}

/**/
.kc-header .kc-user-actions .kc-locale-toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
}

.kc-header .kc-user-actions .kc-locale-toggle:hover,
.kc-header .kc-user-actions .kc-locale-toggle[aria-expanded="true"] {
  color: var(--kc-primary-brand-bright);
  border-color: var(--kc-primary-brand);
}

/* Laranja como texto/ícone pequeno: claro (#FF8000) no tema escuro e forte
   (#C44A00, 4,85:1 no branco) no claro. #FF6B00 no branco dá 2,86:1 (Estética, 29/10). */
html[data-theme="light"] .kc-header .kc-user-actions .kc-locale-toggle:hover,
html[data-theme="light"] .kc-header .kc-user-actions .kc-locale-toggle[aria-expanded="true"],
html[data-theme="light"] .kc-locale-check {
  color: var(--kc-primary-brand-strong);
}

.kc-header .kc-user-actions .kc-locale-toggle:focus-visible,
.kc-locale-option:focus-visible {
  outline: 2px solid var(--kc-primary-brand);
  outline-offset: 2px;
}

/**/
.kc-locale-flag {
  display: block;
  flex: none;
  width: 21px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--kc-border-dark);
}

.kc-locale-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  padding: 6px;
  background: var(--kc-surface-dark);
  border: 1px solid var(--kc-border-dark);
  border-radius: 14px;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.4);
}

.kc-locale-menu[hidden] {
  display: none;
}

.kc-locale-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--kc-text-dark-primary);
  font: inherit;
  font-size: 0.93em;
  text-align: left;
  cursor: pointer;
}

.kc-locale-option:hover,
.kc-locale-option:focus-visible {
  background: var(--kc-surface-dark-hover);
}

.kc-locale-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.kc-locale-check {
  visibility: hidden;
  color: var(--kc-primary-brand-bright);
}

.kc-locale-option.is-current {
  font-weight: 600;
}

.kc-locale-option.is-current .kc-locale-check {
  visibility: visible;
}

/**/
.kc-locale-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.kc-locale-options .kc-locale-option {
  border: 1px solid var(--kc-border-dark);
}

.kc-locale-options .kc-locale-option.is-current {
  border-color: var(--kc-primary-brand);
}

/**/
.kc-translation-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--kc-text-dark-secondary);
}

.kc-translation-notice__toggle {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--kc-primary-brand-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

html[data-theme="light"] .kc-translation-notice__toggle {
  color: var(--kc-primary-brand-strong);
}

.kc-translation-notice__toggle:focus-visible {
  outline: 2px solid var(--kc-primary-brand);
  outline-offset: 2px;
}

.kc-card__translated {
  margin-left: 4px;
  font-size: 12px;
  color: var(--kc-text-dark-secondary);
}

/**/
html:lang(zh) body,
html:lang(zh) button,
html:lang(zh) input,
html:lang(zh) select,
html:lang(zh) textarea,
.kc-locale-option:lang(zh) {
  font-family: system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

/**/
.kc-mobile-menu-locale {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--kc-border-dark);
}

.kc-mobile-menu-locale__label {
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--kc-text-dark-secondary);
}

.kc-locale-options--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kc-locale-options--compact .kc-locale-option {
  width: auto;
  min-width: 64px;
  min-height: 44px;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
}

/**/
@media (max-width: 768px) {
  .kc-header .kc-user-actions .kc-locale {
    display: none;
  }
}
