/* App title, tagline and the language menu (globe button). */

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
header h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}
header h1 span {
  color: var(--accent);
}
header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 34ch;
}

/* ---- Language menu ---- */

.lang {
  position: relative;
  flex: none;
}
.lang-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text);
  transition:
    border-color 0.15s,
    color 0.15s;
}
.lang-btn:hover,
.lang-btn[aria-expanded='true'] {
  border-color: var(--line-strong);
  color: var(--accent);
}
.lang-btn svg {
  width: 19px;
  height: 19px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 20;
  min-width: 180px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--pop-shadow);
  transform-origin: top right;
  animation: menu-in 0.14s ease-out;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.lang-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: start;
  font-size: 15px;
}
.lang-divider {
  height: 1px;
  margin: 4px 8px;
  background: var(--line);
}
.lang-item:hover,
.lang-item:focus-visible {
  background: var(--soft);
  outline: none;
}
.lang-item .flag {
  font-size: 20px;
}
.lang-item img.flag {
  width: 22px;
  height: 22px;
}
.lang-item .check {
  margin-inline-start: auto;
  width: 16px;
  height: 16px;
  color: var(--accent);
  visibility: hidden;
}
.lang-item[aria-checked='true'] {
  font-weight: 600;
}
.lang-item[aria-checked='true'] .check {
  visibility: visible;
}

@media (max-width: 860px) {
  header h1 {
    font-size: 26px;
  }
}
