/* Shared native language navigation. Static and usable before JavaScript. */
.site-language {
  position: relative;
  flex: none;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.35;
}
.site-language summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  white-space: nowrap;
}
.site-language summary::-webkit-details-marker {
  display: none;
}
.site-language svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.site-language .site-language-chevron {
  width: 14px;
  height: 14px;
}
.site-language summary:focus-visible,
.site-language a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.site-language[open] summary {
  background: var(--surface);
  border-color: var(--ink-soft);
}
.site-language ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 12px);
  z-index: 100;
  list-style: none;
  width: max-content;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--nav-h) - 32px);
  overflow: auto;
  padding: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 12px 38px rgba(34, 26, 17, 0.12);
}
.site-language li {
  padding: 0;
  margin: 0;
}
.site-language li a,
.site-language-unavailable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: normal;
}
.site-language li a[aria-current='page'] {
  background: var(--sand);
  font-weight: 600;
}
.site-language li a:hover {
  background: var(--sand);
}
.site-language-unavailable {
  display: block;
  color: var(--ink-soft);
}
.site-language-unavailable small {
  display: block;
  font-family: var(--body);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
  max-width: 30ch;
}
.site-language-fallback {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.7em;
  line-height: 1.3;
  font-weight: 400;
  white-space: nowrap;
  vertical-align: middle;
  opacity: 0.8;
}
@media (forced-colors: active) {
  .site-language summary,
  .site-language ul {
    border: 1px solid CanvasText;
  }
  .site-language li a[aria-current='page'] {
    outline: 1px solid Highlight;
  }
}

/* The shared pill needs room for native language names as well as translated
   navigation. Use the existing burger at tablet widths, rather than shrinking
   or clipping a public action. The class is a progressive fit fallback for
   enlarged text or wider labels above this breakpoint. */
.nav:has(.site-language) .brand,
.nav:has(.site-language) .nav-links,
.nav:has(.site-language) .nav-cta {
  flex-shrink: 0;
}
.nav:has(.site-language) .nav-cta {
  white-space: nowrap;
}
.nav.site-nav-compact .nav-links,
.nav.site-nav-compact .nav-cta {
  display: none;
}
.nav.site-nav-compact .nav-inner {
  padding: 8px 8px 8px 18px;
}
.nav.site-nav-compact .burger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(74, 42, 21, 0.07);
  cursor: pointer;
  position: relative;
  margin-inline-start: auto;
}
.nav.site-nav-compact .burger span {
  position: absolute;
  width: 17px;
  height: 1.6px;
  background: var(--espresso);
  transition: transform var(--dur-3) var(--ease);
}
.nav.site-nav-compact .burger span:nth-child(1) {
  transform: translateY(-4px);
}
.nav.site-nav-compact .burger span:nth-child(2) {
  transform: translateY(4px);
}
.nav.site-nav-compact .burger.x span:nth-child(1) {
  transform: rotate(45deg);
}
.nav.site-nav-compact .burger.x span:nth-child(2) {
  transform: rotate(-45deg);
}
@media (max-width: 1120px) {
  .nav:has(.site-language) .nav-links,
  .nav:has(.site-language) .nav-cta {
    display: none;
  }
  .nav:has(.site-language) .nav-inner {
    padding: 8px 8px 8px 18px;
  }
  .nav:has(.site-language) .burger {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(74, 42, 21, 0.07);
    cursor: pointer;
    position: relative;
    margin-inline-start: auto;
  }
  .nav:has(.site-language) .burger span {
    position: absolute;
    width: 17px;
    height: 1.6px;
    background: var(--espresso);
    transition: transform var(--dur-3) var(--ease);
  }
  .nav:has(.site-language) .burger span:nth-child(1) {
    transform: translateY(-4px);
  }
  .nav:has(.site-language) .burger span:nth-child(2) {
    transform: translateY(4px);
  }
  .nav:has(.site-language) .burger.x span:nth-child(1) {
    transform: rotate(45deg);
  }
  .nav:has(.site-language) .burger.x span:nth-child(2) {
    transform: rotate(-45deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav.site-nav-compact .burger span,
  .nav:has(.site-language) .burger span {
    transition: none;
  }
}

/* The canonical menu must keep its first item reachable when translated or
   enlarged text makes its contents taller than the viewport. */
.nav:has(.site-language) + .menu {
  justify-content: safe center;
  padding-block: calc(var(--nav-h) + 22px) 34px;
}
.nav:has(.site-language) + .menu a {
  min-height: 44px;
}
.nav:has(.site-language) + .menu a {
  flex-shrink: 0;
}
.site-language-confirm {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  margin: auto;
  padding: 34px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  font-family: var(--body);
}
.site-language-confirm::backdrop {
  background: rgba(21, 18, 13, 0.5);
}
.site-language-confirm h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 0.65em;
}
.site-language-confirm p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}
.site-language-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 30px;
}
.site-language-confirm button {
  min-height: 44px;
}
@media (max-width: 420px) {
  .site-language-confirm {
    padding: 26px;
  }
  .site-language-confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Coolvetica's visible descenders need a little more room than the original
   2px menu padding at enlarged text sizes. Keep the ink inside its action. */
.nav:has(.site-language) + .menu a:not(.btn) {
  padding-block: 6px;
}
