/* One footer for every public page: one row of sections and official links,
   then the colophon. Telegram and Discord sit in that row as named links —
   a lone glyph said nothing about where it went. Both shells load this file. */
.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  box-sizing: border-box;
  width: 100%;
  margin: var(--space-9) auto var(--space-8);
  /* Full-width divider; content keeps the shared page container alignment. */
  padding: var(--space-7) max(var(--page-gutter), calc((100% - var(--page-content-max)) / 2)) 0;
  border-top: var(--border-width) solid var(--line);
  color: var(--muted);
  text-align: center;
}

/* Once there is room the footer stops being a stack of centred rows and
   becomes what it is: the sections on one side, the signature on the other. */
@media (min-width: 800px) {
  .app-footer {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-5) var(--space-8);
    text-align: left;
  }

  .footer-legal {
    justify-content: flex-start;
    gap: 0 var(--space-6);
  }

  .footer-colophon {
    justify-content: flex-end;
  }
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.footer-legal {
  gap: 0 var(--space-7);
  font: var(--text-meta);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-body);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* The official links sit in the same row as the sections and read in the same
   grey: brand colour on two of five items pulled the eye off everything else. */
.footer-social {
  gap: var(--space-3);
}

.footer-legal a:focus-visible {
  outline: var(--border-width-strong) solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.footer-social-icon {
  display: block;
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  fill: currentColor;
}

@media (max-width: 560px) {
  .footer-legal {
    gap: 0 var(--space-6);
  }
}

/* The colophon and its language switch. These lived in dashboard.css, which the
   product shell does not load, so there the colophon fell back to block layout
   — five stacked lines where the app shell had one wrapped row. The colophon
   reads in the same type as the sections opposite it: one row, one size. */
.lang-switch {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  min-width: 4.15rem;
  min-height: 1.3rem;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  background: var(--raised);
  border: var(--border-width) solid var(--raised);
}

.lang-switch-btn {
  font: var(--text-meta);
  font-weight: var(--weight-bold);
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.lang-switch-btn:hover {
  color: var(--text);
}

.lang-switch-btn.is-active,
html[lang="en"] .hero .lang-switch-btn[data-set-language="en"],
html[lang="ru"] .hero .lang-switch-btn[data-set-language="ru"] {
  color: var(--text);
  background: var(--raised);
}

.footer-colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-4);
  margin: 0;
  color: var(--muted);
  font: var(--text-meta);
  line-height: var(--leading-body);
}

.footer-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
}

.footer-dot {
  color: var(--muted);
}

.footer-credit {
  color: inherit;
  text-decoration: none;
}

.footer-credit:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.footer-credit:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-xs);
}

.footer-version {
  text-decoration: none;
  appearance: none;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: var(--text-meta);
  cursor: pointer;
}

.footer-version:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.footer-version:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-xs);
}

.app-footer .lang-switch {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.app-footer .lang-switch-btn {
  padding: var(--space-1) var(--space-2);
  font: var(--text-meta);
}

.app-footer .lang-switch-btn.is-active,
html[lang="en"] .app-footer .lang-switch-btn[data-set-language="en"],
html[lang="ru"] .app-footer .lang-switch-btn[data-set-language="ru"] {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) calc(var(--opacity-tint) * 100%), transparent);
}
