/* Narrow-screen layout fixes.
 *
 * Three problems showed up on a 390px phone:
 *
 *   1. The header row is brand, search, sign in and the menu button. At the
 *      original spacing the row needed 430px, so the menu button fell off the
 *      right edge and the whole page scrolled sideways. The gaps and the
 *      wordmark come down instead.
 *   2. The language bar wrapped onto two rows and pushed the hero off the
 *      first screen. It becomes one scrollable row instead.
 *   3. The search trigger was hidden on small screens, which left no way to
 *      reach the search palette without opening the menu first.
 *
 * The selectors carry an extra element so they win over the site's own rules
 * for the same class, whichever order the two stylesheets are read in.
 */

@media (max-width: 800px) {
  body .header-inner { gap: 14px; }
  body .brand-accent { font-size: 16px; letter-spacing: .12em; }
  body .header-signin { padding: 9px 14px; font-size: 11px; }
}

@media (max-width: 560px) {
  body .header-inner { gap: 10px; padding: 0 14px; }
  body .brand { gap: 8px; }
  body .brand-w { font-size: 26px; }
  body .brand-accent { font-size: 13px; letter-spacing: .1em; }
  body .brand-div { height: 20px; }
  body .brand-reticle { width: 30px; height: 30px; }
  body .header-signin { padding: 8px 11px; font-size: 10px; letter-spacing: .06em; }
  body .menu-toggle { width: 40px; padding: 8px 7px; }
  body .menu-toggle span { width: 24px; }

  /* One scrollable row of languages rather than two stacked rows. */
  body .langbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 6px;
    padding: 7px 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body .langbar::-webkit-scrollbar { display: none; }
  body .langbar > span {
    width: auto;
    text-align: left;
    margin: 0 4px 0 0;
    font-size: 9px;
    letter-spacing: .1em;
    flex: none;
  }
  body .langbar a {
    padding: 5px 10px;
    font-size: 10px;
    white-space: nowrap;
    flex: none;
  }

  /* The palette stays reachable from the header on a phone. */
  body .mw4-search-trigger {
    display: inline-flex;
    margin-right: 0;
    padding: 8px 9px;
  }
  body .mw4-search-trigger span,
  body .mw4-search-trigger kbd { display: none; }
}
