/* footer.css · editorial site footer.

   Composition (top → bottom):
     1. Collaboration block — eyebrow + headline + lede, then a row of 4
        partner stamps (logo + name + sub). The stamps are bare (no card
        background) and separated by vertical hairlines so the row reads
        as one editorial credit line, not four buttons.
     2. Three-column lower strip — Carbon identity (logo + name + path)
        on the left, then "Resources" (external) and "Sections" (in-page
        tabs) link columns on the right.
     3. Legal hairline strip — copyright + license on the left, model
        spec recap on the right, all mono caps.

   Sits on the same --paper as the rest of the page; a soft top hairline
   plus a subtle radial-dot texture (echoing the banner) makes the footer
   feel like the bottom trim of the editorial sheet rather than a
   detached UI block. */

.site-footer {
  position: relative;
  /* Tight against the preceding section: the panels above already carry
     their own bottom padding (.container's 96px), so we don't add any
     extra outer margin — just a hairline + a comfortable inner top pad. */
  margin-top: 0;
  background:
    radial-gradient(circle at 18% 26%, rgba(0, 0, 0, 0.05), transparent 1px),
    radial-gradient(circle at 82% 74%, rgba(0, 0, 0, 0.045), transparent 1px),
    linear-gradient(180deg, transparent 0%, rgba(49, 127, 63, 0.02) 100%),
    var(--paper, #f7f5ee);
  background-size: 9px 9px, 13px 13px, auto, auto;
  border-top: 1px solid var(--hairline, #d6d3c4);
  color: var(--ink, #1f1f1d);
  font-family: "Inter", "Helvetica Neue", sans-serif;
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 24px;
}

/* ---------------------------------------------------------------------
   1) COLLABORATION BLOCK
--------------------------------------------------------------------- */
.cb-collab {
  padding-bottom: 56px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--hairline, #d6d3c4);
}
.cb-collab__head {
  max-width: 760px;
  margin-bottom: 40px;
}
.cb-collab__eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green, #317f3f);
}
.cb-collab__title {
  margin: 0 0 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink, #1f1f1d);
}
.cb-collab__lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #5b5b56;
}
.cb-collab__lede em {
  font-style: normal;
  color: var(--ink, #1f1f1d);
  font-weight: 500;
}

/* Partner stamps row.
   Four equal columns, no card chrome, separated by vertical hairlines
   so the strip reads as a single editorial credit line. The hairlines
   are drawn as 1px backgrounds on the left edge of each item, with the
   first item suppressed. */
.cb-partners {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.cb-partner {
  position: relative;
}
.cb-partner + .cb-partner::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 1px;
  background: var(--hairline, #d6d3c4);
}
.cb-partner__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink, #1f1f1d);
  border-radius: 4px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.cb-partner__link:hover,
.cb-partner__link:focus-visible {
  color: var(--green, #317f3f);
  background: rgba(49, 127, 63, 0.04);
  outline: none;
  transform: translateY(-1px);
}
/* Mark is sized by HEIGHT only so each partner's official logo can render
   at its natural aspect ratio. HF and Zhongguancun are wide landscape
   wordmarks (~3.8:1), TIGEM is gently landscape (~1.4:1), Federico II is
   square. A fixed 56×56 box (the old behaviour) would either crop the
   wordmarks or shrink them to illegibility. */
.cb-partner__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  max-width: 100%;
  color: inherit;
}
.cb-partner__mark img,
.cb-partner__mark svg {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  /* Calm the colorful logos at rest so the row reads as one credit line,
     not four competing brand stamps; hover restores full saturation. */
  filter: saturate(0.9);
  transition: filter 0.18s ease, transform 0.18s ease;
}
.cb-partner__link:hover .cb-partner__mark img,
.cb-partner__link:hover .cb-partner__mark svg,
.cb-partner__link:focus-visible .cb-partner__mark img,
.cb-partner__link:focus-visible .cb-partner__mark svg {
  filter: saturate(1);
  transform: scale(1.04);
}
.cb-partner__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
/* Both text labels (name + sub) are visually hidden: each partner is
   already named in the .cb-collab__lede paragraph just above this
   strip, and each logo carries its own wordmark. We keep both spans in
   the DOM as sr-only so screen readers still get the explicit label
   for every partner link. */
.cb-partner__name,
.cb-partner__sub {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------
   2) LOWER STRIP — IDENTITY + LINK COLUMNS
--------------------------------------------------------------------- */
.site-footer__cols {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 1fr 1fr;
  gap: 56px;
  padding-bottom: 40px;
}
.site-footer__brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
}
.site-footer__brand .logo-card {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}
.site-footer__brand .logo-img { width: 100%; height: 100%; display: block; }
.site-footer__brand-meta { display: flex; flex-direction: column; }
.site-footer__brand-name {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink, #1f1f1d);
  line-height: 1.2;
}
.site-footer__brand-path {
  margin-top: 2px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a85;
  line-height: 1.2;
}
.site-footer__brand-lede {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: #5b5b56;
  max-width: 320px;
}

.site-footer__col-title {
  margin: 0 0 14px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green, #317f3f);
}
.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer__list a {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink, #1f1f1d);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 31, 29, 0.18);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-footer__list a:hover,
.site-footer__list a:focus-visible {
  color: var(--green, #317f3f);
  border-bottom-color: var(--green, #317f3f);
  outline: none;
}
.site-footer__list .arrow {
  margin-left: 4px;
  display: inline-block;
  font-size: 10px;
  transform: translateY(-1px);
  letter-spacing: 0;
}

/* ---------------------------------------------------------------------
   3) LEGAL STRIP
--------------------------------------------------------------------- */
.site-footer__legal {
  border-top: 1px solid var(--hairline, #d6d3c4);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a85;
}
.site-footer__legal .dot {
  display: inline-block;
  margin: 0 8px;
  color: #c2bfaf;
}
.site-footer__legal a {
  color: #6f6c63;
  text-decoration: none;
  border-bottom: 1px solid rgba(111, 108, 99, 0.3);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-footer__legal a:hover,
.site-footer__legal a:focus-visible {
  color: var(--green, #317f3f);
  border-bottom-color: var(--green, #317f3f);
  outline: none;
}

/* ---------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------- */
@media (max-width: 960px) {
  .site-footer__inner { padding: 36px 24px 22px; }
  .cb-partners { grid-template-columns: repeat(2, 1fr); }
  .cb-partner:nth-child(3)::before { display: none; }
  .cb-partner:nth-child(2n + 1)::before { display: none; }
  .cb-partner:nth-child(n + 3) {
    border-top: 1px solid var(--hairline, #d6d3c4);
    padding-top: 12px;
    margin-top: 12px;
  }
  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
    gap: 36px 40px;
  }
  .site-footer__brand { grid-column: 1 / -1; }
  .cb-collab__title { font-size: 20px; }
}

/* ---------------------------------------------------------------------
   Mobile (<= 540px)
   Goals:
   - Keep the partner strip as a 2×2 grid: a single-column stack with
     row-flex looks unbalanced because the name/sub spans are sr-only,
     so the row would render as "logo + empty space".
   - Tighter vertical rhythm on the collaboration block.
   - Keep Resources / Sections columns side-by-side so the footer
     doesn't grow into a tall vertical scroll on phones.
   - Stack the legal hairline with proper spacing.
--------------------------------------------------------------------- */
@media (max-width: 540px) {
  .site-footer__inner { padding: 36px 20px 24px; }

  /* Collaboration block — compressed editorial rhythm. */
  .cb-collab {
    padding-bottom: 32px;
    margin-bottom: 28px;
  }
  .cb-collab__head { margin-bottom: 24px; }
  .cb-collab__title {
    font-size: 19px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .cb-collab__lede {
    font-size: 13px;
    line-height: 1.6;
  }

  /* Partner stamps: 2×2 grid with both vertical and horizontal hairlines.
     Each cell stays a centered logo block (labels remain sr-only). */
  .cb-partners { grid-template-columns: repeat(2, 1fr); }
  .cb-partner::before { display: none !important; }
  .cb-partner {
    position: relative;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
  }
  /* Vertical hairline between the two columns (drawn on the right cell). */
  .cb-partner:nth-child(2n) {
    border-left: 1px solid var(--hairline, #d6d3c4);
  }
  /* Horizontal hairline between rows (drawn on the top two cells). */
  .cb-partner:nth-child(-n + 2) {
    border-bottom: 1px solid var(--hairline, #d6d3c4);
  }
  .cb-partner__link {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 16px 10px;
  }
  .cb-partner__mark { height: 40px; flex-shrink: 0; }
  .cb-partner__body { align-items: center; }

  /* Lower strip: brand spans full width, link columns stay side-by-side
     to keep the footer compact vertically. */
  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
    padding-bottom: 28px;
  }
  .site-footer__brand {
    grid-column: 1 / -1;
    grid-template-columns: 40px 1fr;
    gap: 12px;
  }
  .site-footer__brand-lede {
    margin-top: 12px;
    max-width: none;
    font-size: 12.5px;
  }
  .site-footer__col-title { margin-bottom: 12px; }
  .site-footer__list { gap: 10px; }

  /* Legal strip: stack with breathing room; tighten the dot separators
     so the line wraps gracefully on very narrow screens. */
  .site-footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 18px;
    letter-spacing: 0.14em;
    font-size: 10px;
  }
  .site-footer__legal .dot { margin: 0 6px; }
}

/* Very narrow screens — drop the partner row to a single column, since
   four logos compressed into 2×2 start to crowd one another below this
   width. The cell still centers the logo so the strip stays editorial. */
@media (max-width: 380px) {
  .cb-partners { grid-template-columns: 1fr; }
  .cb-partner:nth-child(2n) { border-left: none; }
  .cb-partner:nth-child(-n + 2) { border-bottom: none; }
  .cb-partner + .cb-partner {
    border-top: 1px solid var(--hairline, #d6d3c4);
  }
  .cb-partner__link { padding: 14px 8px; }
  .cb-partner__mark { height: 36px; }
}
