[data-component="language-picker"] {
  width: auto;
}

[data-component="footer"] [data-component="language-picker"] {
  width: 100%;
}

[data-component="footer"] [data-component="language-picker"] [data-component="dropdown"] {
  width: 100%;
}

/* Standard site footer (grid of cells) */
[data-component="footer"] [data-slot="cell"] [data-component="language-picker"] {
  height: 100%;
}

[data-component="footer"] [data-slot="cell"] [data-component="language-picker"] [data-slot="trigger"] {
  width: 100%;
  padding: 2rem 0;
  border-radius: 0;
  justify-content: center;
  gap: var(--space-2);
  color: inherit;
  font: inherit;
}

[data-component="footer"] [data-slot="cell"] [data-component="language-picker"] [data-slot="trigger"] span {
  flex: 0 0 auto;
  text-align: center;
  font-weight: inherit;
}

[data-component="footer"] [data-slot="cell"] [data-component="language-picker"] [data-slot="trigger"]:hover {
  background: var(--color-background-weak);
  text-decoration: underline;
  text-underline-offset: var(--space-1);
  text-decoration-thickness: 1px;
}

/* Footer dropdown should open upward */
[data-component="footer"] [data-component="language-picker"] [data-slot="dropdown"] {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: var(--space-2);
  max-height: min(60vh, 420px);
  overflow: auto;
}

[data-component="legal"] {
  flex-wrap: wrap;
  row-gap: var(--space-2);
}

[data-component="legal"] [data-component="language-picker"] {
  width: auto;
}

[data-component="legal"] [data-component="language-picker"] [data-slot="trigger"] {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: var(--color-text-weak);
  white-space: nowrap;
}

[data-component="legal"] [data-component="language-picker"] [data-slot="trigger"] span {
  font-weight: inherit;
}

[data-component="legal"] [data-component="language-picker"] [data-slot="trigger"]:hover {
  background: transparent;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: var(--space-1);
  text-decoration-thickness: 1px;
}

[data-component="legal"] [data-component="language-picker"] [data-slot="dropdown"] {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: var(--space-2);
  max-height: min(60vh, 420px);
  overflow: auto;
}

/* Black pages footer */
[data-page="black"] [data-component="language-picker"] {
  width: auto;
}

[data-page="black"] [data-component="language-picker"] [data-component="dropdown"] {
  width: auto;
}

[data-page="black"] [data-component="language-picker"] [data-slot="trigger"] {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: rgba(255, 255, 255, 0.39);
}

[data-page="black"] [data-component="language-picker"] [data-slot="trigger"]:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

[data-page="black"] [data-component="language-picker"] [data-slot="dropdown"] {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 12px;
  background-color: #0e0e10;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  max-height: min(60vh, 420px);
  overflow: auto;
}

[data-page="black"] [data-component="language-picker"] [data-slot="item"] {
  color: rgba(255, 255, 255, 0.86);
}

[data-page="black"] [data-component="language-picker"] [data-slot="item"]:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

[data-page="black"] [data-component="language-picker"] [data-slot="item"][data-selected="true"] {
  background-color: rgba(255, 255, 255, 0.1);
}
