/* Mostly Human — the frame: every web app's header and footer (docs/DESIGN.md › The app chrome).
   After base.css, before the app's own CSS; an app never restyles a .mh-* rule. Tokens only
   (tools/check-kit.py). The one literal is the 600 px phone/wide split: a media query can't read a custom property.

   The app sets two values of its own, in its own CSS, for the face its name is set in:
     --mh-app-face          its display family (it falls back to the frame's text face)
     --mh-app-face-weight   that face's weight */

/* The header: the app's name at the start; the language switch and the studio's logo at the end. */
.mh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  padding-inline: var(--space-6);
  border-block-end: var(--hairline) solid var(--sand);
}

.mh-name,
.mh-footer-name {
  margin: 0;
  min-width: 0;
  font-family: var(--mh-app-face, var(--title-family));
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: var(--mh-app-face-weight, var(--title-weight));
  color: var(--ink);
}

.mh-name:lang(ar),
.mh-footer-name:lang(ar) {
  font-family: var(--mh-app-face, var(--ar-title-family));
  font-size: var(--ar-title-size);
  line-height: var(--ar-title-line);
  font-weight: var(--mh-app-face-weight, var(--ar-title-weight));
}

.mh-name a { color: inherit; text-decoration: none; }

.mh-header-end {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

/* The logo: the outlined SVG, ink, 64 px on phones and 72 px from 600 px up (brand/README.md › Logo). */
.mh-logo {
  display: block;
  flex: none;
  width: var(--logo-chrome-compact);
  color: var(--ink);
}

.mh-logo svg { display: block; width: 100%; height: auto; }

/* Text controls: the language switch, the privacy link and the theme button. */
.mh-lang,
.mh-controls a,
.mh-theme {
  display: inline-block;
  padding-block: var(--space-3);
  font-size: var(--small-size);
  line-height: var(--small-line);
  text-decoration: underline;
  text-decoration-thickness: var(--hairline);
  text-underline-offset: var(--space-1);
}

.mh-lang { color: var(--graphite); }
.mh-lang:lang(en) { font-family: var(--font-sans); }

.mh-lang:hover,
.mh-controls a:hover,
.mh-theme:hover { text-decoration-thickness: var(--rule); }

/* The footer: the app's name, its purpose, its legal line, the two text controls, then the icons and the logo. */
.mh-footer {
  margin-block-start: var(--space-16);
  padding-block: var(--space-8) var(--space-12);
  padding-inline: var(--space-6);
  border-block-start: var(--hairline) solid var(--sand);
}

.mh-purpose {
  margin: 0;
  margin-block-start: var(--space-2);
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--graphite);
}

.mh-legal {
  margin: 0;
  margin-block-start: var(--space-2);
  font-size: var(--label-size);
  line-height: var(--label-line);
  color: var(--stone);
}

.mh-controls {
  list-style: none;
  margin: 0;
  margin-block-start: var(--space-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-6);
}

.mh-controls a { color: var(--ink); }

.mh-theme {
  margin: 0;
  border: 0;
  padding-inline: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}

.mh-footer-row {
  margin-block-start: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* The icons: Email, LinkedIn, X — 24 px marks in 48 px targets, the first mark flush with the text above. */
.mh-icons {
  list-style: none;
  margin: 0;
  margin-inline-start: calc(-1 * var(--space-3));
  padding: 0;
  display: flex;
}

.mh-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-12);
  height: var(--space-12);
  color: var(--ink);
}

.mh-icons svg { display: block; width: var(--space-6); height: var(--space-6); }

@media (min-width: 600px) {
  .mh-header {
    padding-block: var(--space-6);
    padding-inline: var(--space-24);
  }

  .mh-logo { width: var(--logo-chrome); }

  .mh-footer {
    padding-block-end: var(--space-16);
    padding-inline: var(--space-24);
  }

  .mh-footer-name,
  .mh-purpose,
  .mh-legal,
  .mh-controls { max-width: calc(var(--space-24) * 6); }
}
