/*
 * NV-11 Footer — app/components/ui/footer_component.rb
 *
 * Public layout only. Full-bleed brand blue (--color-accent-strong) with
 * --color-on-accent text, laid out like TradeCraft's site footer: brand,
 * links and credit columns that stack on phones and sit in a row from 640px,
 * over a bottom bar. Every text colour is the full --color-on-accent: white on
 * the brand blue is 4.8:1, and any tint of it would drop below AA. Token vars
 * only — enforced by test/lint/css_token_lint_test.rb.
 */

.ui-footer {
  background: var(--color-accent-strong);
  color: var(--color-on-accent);
}

.ui-footer__inner {
  max-width: var(--shell-landing-col);
  margin-inline: auto;
  padding: var(--space-12) var(--space-4);
}

@media (min-width: 768px) {
  .ui-footer__inner {
    padding-inline: var(--space-6);
  }
}

.ui-footer__top {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

@media (min-width: 640px) {
  .ui-footer__top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.ui-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
  min-width: 0;
}

.ui-footer__logo {
  height: var(--space-8);
  width: auto;
}

.ui-footer__contact {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ui-footer__contact-icon {
  flex-shrink: 0;
}

.ui-footer__contact-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ui-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ui-footer__link,
.ui-footer__bottom-link {
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.ui-footer__link:hover,
.ui-footer__bottom-link:hover,
.ui-footer__contact-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* The default focus outline is a darker blue, which all but vanishes here. */
.ui-footer :focus-visible {
  outline-color: var(--color-on-accent);
}

/* "Built by" credit — the Hyper logo, linked, with no marketing copy. */
.ui-footer__credit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .ui-footer__credit {
    align-items: flex-end;
    text-align: right;
  }
}

.ui-footer__credit-label {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}

.ui-footer__credit-link {
  display: inline-flex;
  border-radius: var(--radius-xs);
}

.ui-footer__credit-link:hover {
  opacity: 0.75;
}

/* The supplied mark is black; render it white to sit on the brand blue. */
.ui-footer__credit-logo {
  height: var(--space-5);
  width: auto;
  filter: brightness(0) invert(1);
}

.ui-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid color-mix(in srgb, var(--color-on-accent) 30%, transparent);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}

@media (min-width: 640px) {
  .ui-footer__bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ui-footer__copyright {
  margin: 0;
}

/* The native apps have their own chrome, and no place for a site footer. */
.turbo-native .ui-footer {
  display: none;
}
