.header-languages {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.language-selector {
  position: relative;
  z-index: 20;
  color: #111;
  font-size: .875rem;
  letter-spacing: .01em;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  line-height: 1.4;
  white-space: nowrap;
}

.language-globe,
.language-chevron {
  display: block;
  flex-shrink: 0;
}

.language-code {
  display: none;
}

.language-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 172px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  border: 1px solid #dedad2;
  border-radius: 2px;
  background: #fdfbf6;
  box-shadow: 0 8px 28px rgb(36 35 31 / 8%), 0 2px 6px rgb(36 35 31 / 3%);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  line-height: 1.5;
  text-align: left;
  white-space: nowrap;
}

.language-check {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.language-option[aria-disabled="true"] {
  color: #777269;
  cursor: default;
}

.language-option:not([aria-disabled="true"]):hover,
.language-option:focus-visible {
  background: #f2eee6;
}

.language-trigger:focus-visible,
.language-option:focus-visible {
  outline: 1px solid #57534c;
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 0;
  }

  .header > .wordmark {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .header > nav {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .header-languages {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .language-name {
    display: none;
  }

  .language-code {
    display: inline;
  }
}

@media (max-width: 600px) {
  .header {
    column-gap: 16px;
  }
}

@media (max-width: 380px) {
  .header {
    row-gap: 10px;
  }

  .header > .wordmark {
    grid-row: 1;
  }

  .header > nav {
    grid-column: 1 / -1;
  }
}

/* Native disclosure keeps the language menu usable in mobile HTML previews. */
.language-trigger{list-style:none;cursor:pointer;font:inherit}
.language-trigger::-webkit-details-marker{display:none}

.language-option[aria-checked="false"] .language-check{visibility:hidden}
