/* S6-3 phone and tablet layout for the v10 public pages (index, library,
 * contribute). Additive only: v10 markup and its own <style> rules are not
 * changed; these rules fix the three horizontal overflows measured at
 * 320-900 px (in right-to-left pages, anything past the left edge scrolls).
 * Verified with no horizontal scroll at 320, 360, 390, 701-901, 1024, 1280 px. */

/* The visually hidden search label sat at left:-9999px - in RTL that widens
 * the page. Keep it hidden (and readable by screen readers) without moving it. */
[style*="left:-9999px"] {
  left: auto !important;
  right: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* 701-900 px: v10 has no header rule here and the language switch leaves the
 * page; wrap the navigation onto its own row (as v10 does below 700 px). */
@media (max-width: 900px) {
  header {
    height: auto !important;
    flex-wrap: wrap !important;
    padding: 12px 24px !important;
    gap: 12px 20px !important;
  }
  header nav {
    flex-basis: 100% !important;
    order: 3 !important;
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
  }
}

/* Phones: the footer's seven social buttons and the library filter chips
 * wrap instead of pushing past the edge. */
@media (max-width: 700px) {
  footer {
    flex-wrap: wrap !important;
  }
  footer > div {
    min-width: 0;
    max-width: 100%;
  }
  footer [style*="display:flex;gap:10px"] {
    flex-wrap: wrap !important;
    justify-content: flex-end;
  }
  [style*="display:flex;gap:8px"] {
    flex-wrap: wrap !important;
  }
}
