/* ==========================================================================
   AUTODE FOOTER — static PHP replica of the "Autobahn" MD3 footer.
   Source of truth: libs/packages/fe-ui-core-autobahn/chrome/Footer.tsx +
   theme/md3.css (design tokens). Scoped under .autode-footer / .md3 so it
   cannot bleed into the rest of the legacy WP theme.

   IMPORTANT: on some WP templates (functions.php $react_all — front page,
   page-finanzieren.php, 404, and per-blog conditions) the fe-wp-widgets React
   bundle is also loaded and injects the FULL canonical md3.css (~300KB,
   style-loader <style> tag) with the same generic .md3/.md-title-sm/.icon-btn/
   .mbtn classes. That tag lands after this stylesheet in the DOM, so at equal
   CSS specificity it wins the cascade. Every selector below that touches a
   class the bundle also styles is therefore anchored on `footer.autode-footer`
   (element + class = higher specificity than the bundle's bare `.md3`/
   `.md3 .foo`) so this file renders correctly whether or not that bundle is
   present on the current page.

   NOT auto-synced with the React component — if Footer.tsx's columns, copy
   or tokens change, this file (and partials/_footer.php) must be updated by
   hand. See project memory: wp-footer-md3-replica.

   Loads Hanken Grotesk to match Footer.tsx's --md-font exactly (fe-main's
   real footer uses it — visual fidelity wins over the small FOUT risk here).
   functions.php adds <link rel=preconnect> to fonts.googleapis.com/
   fonts.gstatic.com ahead of this stylesheet so the font request starts as
   early as possible, shrinking (not eliminating) the swap window.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

footer.autode-footer {
  --autode-blau: #005cff;
  --autode-blau-strong: #0a47ae;
  --md-primary: var(--autode-blau);
  --md-sc-low: #f4f5fa;
  --md-on-surface: #1a1b22;
  --md-on-surface-variant: #44464f;
  --md-outline-variant: #c5c6d2;
  --md-r-full: 999px;
  --md-font: "Hanken Grotesk", system-ui, sans-serif;
  --dur-1: 120ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  background: var(--md-sc-low);
  border-top: 1px solid var(--md-outline-variant);
  font-family: var(--md-font);
  color: var(--md-on-surface);
  -webkit-font-smoothing: antialiased;
}
.autode-footer,
.autode-footer *,
.autode-footer *::before,
.autode-footer *::after {
  box-sizing: border-box;
  /* the legacy theme's base stylesheet sets font-family directly on element selectors like
     `a`/`p`/`button` — a directly-specified value always wins over an inherited one regardless
     of specificity, so relying on inheritance from footer.autode-footer alone was not enough.
     Force every descendant to explicitly re-inherit the footer's font. */
  font-family: inherit;
}
footer.autode-footer a {
  text-decoration: none;
}

footer.autode-footer .md-title-sm {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.1px;
  margin: 0 0 14px;
}
footer.autode-footer .md-body-sm {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--md-on-surface-variant);
}
footer.autode-footer .md-label-sm {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--md-on-surface-variant);
}

.autode-footer__container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Breakpoints match .md3 .footer-grid in theme/md3.css exactly (the real Footer.tsx grid never
   collapses to a single column, even on phone widths). */
.autode-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}
@media (max-width: 980px) {
  .autode-footer__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}
/* Footer.tsx's grid/legal/copyright bars all render inside className="container", which gets
   `padding-left/right: 12px !important` at this same 600px breakpoint in theme/md3.css. */
@media (max-width: 600px) {
  .autode-footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .autode-footer__container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.autode-footer__logo {
  height: 30px;
  display: block;
}

.autode-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
footer.autode-footer .autode-footer__link {
  color: var(--md-on-surface-variant);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.autode-footer__link:hover {
  text-decoration: underline;
}

.autode-footer__contact-heading {
  margin-top: 18px;
}

.autode-footer__socials {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
footer.autode-footer .icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--md-r-full);
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--md-on-surface-variant);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background 0.15s;
}
footer.autode-footer .icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.autode-footer__legal-bar,
.autode-footer__copy-bar {
  border-top: 1px solid var(--md-outline-variant);
}
.autode-footer__legal-bar .autode-footer__container {
  padding-top: 18px;
  padding-bottom: 18px;
}
footer.autode-footer .autode-footer__legal-bar p {
  margin: 0;
  line-height: 1.55;
}
footer.autode-footer .autode-footer__legal-bar b {
  font-weight: 700;
}

.autode-footer__copy-bar .autode-footer__container {
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

footer.autode-footer .mbtn {
  font-family: var(--md-font);
  font-weight: 600;
  letter-spacing: 0.1px;
  border-radius: var(--md-r-full);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease-standard);
}
footer.autode-footer .mbtn--text {
  background: transparent;
  color: var(--md-primary);
  padding: 0 12px;
}
footer.autode-footer .mbtn--text:hover {
  background: rgba(11, 83, 204, 0.06);
}
footer.autode-footer .mbtn--sm {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
}
