/* LingLink Shared UI Repairs 0.1.2.
 * Scope: existing LingLink public components; no copy or URL changes.
 * Load after the current child-theme and showcase-fix stylesheets.
 */

/* The current mobile showcase fix changes every footer link to inline-flex.
 * Keep the existing 44px touch height while restoring one link per row in
 * the three main footer columns. Logo, legal/language/filing controls are
 * outside this selector and retain their existing layout.
 */
@media (max-width: 782px) {
  body.ll-site .ll-footer .ll-footer__grid > div:not(.ll-footer__brand) > a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* The companion has a higher stacking level than the open navigation.
 * Hide it only while the existing menu-open class is present; closing the
 * menu restores its previous position/state without changing provider code.
 */
body.ll-site.ll-nav-open .llqc-companion,
body.ll-site.ll-nav-open #ll-focus-companion-dock {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Existing LingLink cyan token improves the three dark software-card action
 * links without changing the brand palette. Underline retains a non-color
 * indication that these are links. Light-theme appearance stays unchanged.
 */
html[data-ll-theme="dark"] body.ll-site .ll-main .shared-software-catalog .shared-software-button {
  color: var(--ll-cyan, #22d3ee);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

html[data-ll-theme="dark"] body.ll-site .ll-main .shared-software-catalog .shared-software-button:hover,
html[data-ll-theme="dark"] body.ll-site .ll-main .shared-software-catalog .shared-software-button:focus-visible {
  color: var(--ll-white, #ffffff);
}

/* The native mobile toggle also exposes aria-expanded. Cover that actual state
 * when a theme transition has not yet synchronized the body class. Visibility
 * is temporary: hidden/collapsed preferences and inline positions are untouched.
 */
@media (max-width: 1180px) {
  body.ll-site:has(.ll-nav-toggle[aria-expanded="true"]) .llqc-companion,
  body.ll-site:has(.ll-nav-toggle[aria-expanded="true"]) #ll-focus-companion-dock {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Shared header displays the native toggle as flex at its mobile breakpoint.
 * Keep the native three-bar DOM and its +/-6px open-state transforms. A 2px
 * bar plus 4px gap preserves those centers; do not change menu events/state.
 */
@media (max-width: 1180px) {
  body.ll-site .ll-nav-toggle[aria-controls="ll-primary-nav"] {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 !important;
  }
  body.ll-site .ll-nav-toggle[aria-controls="ll-primary-nav"] > span {
    flex: none !important;
    width: 20px !important;
    height: 2px !important;
    margin: 0 !important;
  }
}
