/* ==========================================================================
   FUNDER — Site footer
   --------------------------------------------------------------------------
   Requires fn/01-tokens.css.
   Scoped under `.fn-ui` — same kill-switch as the header.

   Light: clean white sheet that bookends the page like the header — brand
   spent on marks and the top hairline, not on a black fill.
   Dark: deep raised surface, same architecture.

   Structure:
     §1  shell
     §2  brand column
     §3  link columns
     §4  meta + disclaimer strip
     §5  footer ad strip
     §6  responsive
     §7  focus, motion, print
   ========================================================================== */


/* ============================================================== §1  SHELL */

.fn-ui .fn-footer {
  --fn-footer-ink:       var(--fn-text-1);
  --fn-footer-ink-soft:  var(--fn-text-2);
  --fn-footer-ink-mute:  var(--fn-text-3);
  --fn-footer-line:      var(--fn-border);
  --fn-footer-chip:      var(--fn-bg-sunken);
  --fn-footer-chip-h:    var(--fn-brand-soft);
  --fn-footer-accent:    var(--fn-brand);
  --fn-footer-surface:   var(--fn-bg-surface);

  background-color: var(--fn-footer-surface);
  background-image: none;
  color: var(--fn-footer-ink);
  font-family: var(--fn-font-ui);
  margin: var(--fn-space-10) 0 0;
  padding: 0;
  position: relative;
  isolation: isolate;
  clear: both;
  width: 100%;
  float: none;
  border-top: 0;
  box-shadow: 0 -1px 0 rgba(14, 20, 16, 0.04);
}

:root[data-fn-theme="dark"] .fn-ui .fn-footer {
  --fn-footer-ink:       #F4F6F3;
  --fn-footer-ink-soft:  rgba(244, 246, 243, 0.68);
  --fn-footer-ink-mute:  rgba(244, 246, 243, 0.48);
  --fn-footer-line:      rgba(244, 246, 243, 0.10);
  --fn-footer-chip:      rgba(244, 246, 243, 0.06);
  --fn-footer-chip-h:    rgba(103, 203, 53, 0.18);
  --fn-footer-accent:    var(--fn-green-400);
  --fn-footer-surface:   #0B0F0C;
  box-shadow: none;
}

/* Brand hairline — same quiet signature as the header rule, and now the
   same construction: one flat green line, not a swatch fading out at both
   ends. Dark keeps it dimmer so it does not fight chart ink. */
.fn-ui .fn-footer::before {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: var(--fn-interactive);
  opacity: 1;
}

:root[data-fn-theme="dark"] .fn-ui .fn-footer::before {
  height: 1px;
  opacity: 0.55;
}

.fn-ui .fn-footer .container {
  float: none;
  width: auto;
  max-width: 1170px;
  margin-left: auto;
  margin-right: auto;
  padding: var(--fn-space-8) 15px var(--fn-space-6);
}

.fn-ui .fn-footer__grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(3, minmax(0, 1fr));
  gap: var(--fn-space-6) var(--fn-space-10);
  align-items: start;
  padding-bottom: var(--fn-space-6);
}


/* ====================================================== §2  BRAND COLUMN */

.fn-ui .fn-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.fn-ui .fn-footer__logo {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

/* Light footer → dark lockup. Dark footer → white lockup. */
.fn-ui .fn-footer__logo .fn-logo--light {
  display: block !important;
  float: none;
  width: auto;
  height: 44px;
  max-width: 100%;
}

.fn-ui .fn-footer__logo .fn-logo--dark {
  display: none !important;
}

:root[data-fn-theme="dark"] .fn-ui .fn-footer__logo .fn-logo--light {
  display: none !important;
}

:root[data-fn-theme="dark"] .fn-ui .fn-footer__logo .fn-logo--dark {
  display: block !important;
  float: none;
  width: auto;
  height: 44px;
  max-width: 100%;
}

.fn-ui .fn-footer__tagline {
  margin: 0;
  max-width: 32ch;
  color: var(--fn-footer-ink-soft);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-regular);
  line-height: var(--fn-leading-loose);
}

.fn-ui .fn-footer__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fn-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fn-ui .fn-footer__social li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fn-ui .fn-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  text-decoration: none;
  transition: opacity 180ms var(--fn-ease);
  cursor: pointer;
}

.fn-ui .fn-footer__social a:hover,
.fn-ui .fn-footer__social a:focus {
  opacity: 0.85;
  text-decoration: none;
  transform: none;
}

.fn-ui .fn-footer__social a:active {
  transform: none;
}

.fn-ui .fn-footer__social img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

:root[data-fn-theme="dark"] .fn-ui .fn-footer__social a[aria-label="X"] img {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}


/* ====================================================== §3  LINK COLUMNS */

.fn-ui .fn-footer__col {
  min-width: 0;
}

.fn-ui .fn-footer__heading {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--fn-footer-ink-mute);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-bold);
  letter-spacing: 0;
  line-height: var(--fn-leading-tight);
}

.fn-ui .fn-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fn-ui .fn-footer__list li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fn-ui .fn-footer__list a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  color: var(--fn-footer-ink-soft);
  font-size: 13px;
  font-weight: var(--fn-fw-regular);
  line-height: var(--fn-leading-base);
  text-decoration: none;
  transition:
    color 180ms var(--fn-ease),
    background-color 180ms var(--fn-ease);
  cursor: pointer;
}

.fn-ui .fn-footer__list a:hover,
.fn-ui .fn-footer__list a:focus {
  color: var(--fn-footer-accent);
  text-decoration: none;
}


/* ============================================ §4  META + DISCLAIMER */

.fn-ui .fn-footer__bottom {
  border-top: 1px solid var(--fn-footer-line);
  padding: var(--fn-space-4) 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.fn-ui .fn-footer .ftr_botm_text,
.fn-ui .fn-footer .footer_text {
  position: static !important;
  margin: 0 !important;
  width: auto !important;
  float: none;
  display: block;
}

.fn-ui .fn-footer .ftr_botm_text hr,
.fn-ui .fn-footer .footer_text hr {
  display: none;
}

.fn-ui .fn-footer__updated {
  margin: 0;
  color: var(--fn-footer-ink-soft);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  line-height: var(--fn-leading-base);
  flex: 0 0 auto;
}

.fn-ui .fn-footer__updated #UpdateFSection,
.fn-ui .fn-footer__updated .UpdateFSection {
  color: var(--fn-footer-accent);
  font-weight: var(--fn-fw-bold);
  font-variant-numeric: tabular-nums;
}

.fn-ui .fn-footer__disc {
  margin: 0;
  max-width: 68em;
  color: var(--fn-footer-ink-mute);
  font-size: var(--fn-fs-xs);
  font-weight: var(--fn-fw-regular);
  line-height: 1.5;
  text-align: right;
}


/* ============================================ §5  FOOTER AD STRIP
   Continues the footer surface full-bleed. Kill legacy .bg-grey cream
   (#f3e9d4) and Bootstrap .container fixed widths that left old sides. */

.fn-ui .fn-footer-ad,
.fn-ui .container.fn-footer-ad {
  float: none !important;
  display: block;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: var(--fn-space-5) 15px var(--fn-space-8);
  text-align: center;
  clear: both;
  background: var(--fn-bg-surface) !important;
  background-color: var(--fn-bg-surface) !important;
  border-top: 1px solid var(--fn-border);
  box-sizing: border-box;
}

:root[data-fn-theme="dark"] .fn-ui .fn-footer-ad,
:root[data-fn-theme="dark"] .fn-ui .container.fn-footer-ad {
  background: #0B0F0C !important;
  background-color: #0B0F0C !important;
  border-top-color: rgba(244, 246, 243, 0.10);
}

.fn-ui .fn-footer-ad > [class*="col-"],
.fn-ui .fn-footer-ad .bg-grey,
.fn-ui .fn-footer-ad .bg-grey1,
.fn-ui .fn-footer-ad .bg-grey2,
.fn-ui .fn-footer-ad .bg-grey3,
.fn-ui .fn-footer-ad .index_bnrid2,
.fn-ui .fn-footer-ad__inner {
  float: none !important;
  width: 100% !important;
  max-width: 1170px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.fn-ui .fn-footer-ad img,
.fn-ui .fn-footer-ad iframe {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}


/* ========================================================== §6  RESPONSIVE */

/* Tablet: the brand becomes a bar, the three link groups stay side by side. */
@media (max-width: 991px) {
  .fn-ui .fn-footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--fn-space-5) var(--fn-space-6);
  }

  .fn-ui .fn-footer__brand {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--fn-space-2) var(--fn-space-4);
    padding: 0;
    border: 0;
  }

  .fn-ui .fn-footer__tagline {
    flex: 1 1 200px;
    max-width: 46ch;
  }

  .fn-ui .fn-footer__social {
    margin-inline-start: auto;
  }
}

/* Phone: no section titles, links as a short run of chips.
   The headings stay in the DOM so each group keeps its name for
   assistive tech; they just stop occupying a line and a rule. */
@media (max-width: 767px) {
  .fn-ui .fn-footer {
    margin-top: var(--fn-space-4) !important;
  }

  .fn-ui .fn-footer .container {
    padding: var(--fn-space-4) 15px var(--fn-space-3);
  }

  .fn-ui .fn-footer__grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: var(--fn-space-2);
  }

  .fn-ui .fn-footer__brand {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--fn-space-2) var(--fn-space-3);
    grid-column: auto;
    margin: 0;
    padding: 0 0 var(--fn-space-3);
    border: 0;
  }

  .fn-ui .fn-footer__logo {
    order: 1;
  }

  .fn-ui .fn-footer__logo .fn-logo--light,
  :root[data-fn-theme="dark"] .fn-ui .fn-footer__logo .fn-logo--dark {
    height: 32px;
  }

  /* Social sits on the logo's row. The tagline follows, full width, so it
     does not push the icons onto a line of their own. */
  .fn-ui .fn-footer__social {
    order: 2;
    margin: 0;
    margin-inline-start: auto;
  }

  .fn-ui .fn-footer__tagline {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    font-size: var(--fn-fs-xs);
    line-height: 1.45;
  }

  .fn-ui .fn-footer__social a {
    width: 26px;
    height: 26px;
  }

  .fn-ui .fn-footer__heading {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
  }

  .fn-ui .fn-footer__col + .fn-footer__col {
    margin-top: 2px;
  }

  .fn-ui .fn-footer__list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .fn-ui .fn-footer__list a {
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--fn-radius-pill);
    background: var(--fn-footer-chip);
    font-size: var(--fn-fs-sm);
  }

  .fn-ui .fn-footer__list a:hover,
  .fn-ui .fn-footer__list a:focus {
    padding: 0 10px;
    background: var(--fn-footer-chip-h);
    color: var(--fn-footer-accent);
  }

  .fn-ui .fn-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--fn-space-2);
    padding-top: var(--fn-space-3);
  }

  .fn-ui .fn-footer__updated,
  .fn-ui .fn-footer__disc {
    font-size: var(--fn-fs-xs);
    line-height: 1.45;
  }

  .fn-ui .fn-footer__disc {
    flex-basis: auto;
    text-align: right;
  }

  /* The ad markup is visible-md / visible-lg, so below 992 this box is an
     empty padded band. */
  .fn-ui .fn-footer-ad {
    display: none;
  }
}


/* ============================================== §7  FOCUS / MOTION / PRINT */

.fn-ui .fn-footer a:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-footer-accent);
  outline-offset: var(--fn-focus-offset);
  border-radius: var(--fn-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-footer__social a,
  .fn-ui .fn-footer__list a {
    transition: none;
  }

  .fn-ui .fn-footer__social a:active {
    transform: none;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .fn-ui .fn-footer__list a:hover,
  .fn-ui .fn-footer__list a:focus {
    padding: 0 10px;
  }
}

@media print {
  .fn-ui .fn-footer {
    background: none !important;
    color: #000 !important;
    border-top: 1px solid #ccc;
    margin-top: 24px;
    box-shadow: none;
  }

  .fn-ui .fn-footer::before,
  .fn-ui .fn-footer__social,
  .fn-ui .fn-footer-ad {
    display: none;
  }
}
