/* ============================================================
   Curiosity Current — Site Footer (shared module)
   ------------------------------------------------------------
   Visual contract per spec 12_portal_architecture.md v0.4.5,
   "Site footer (shared across all portal home surfaces)".

   Rules:
     - Class names are namespaced `sf-*` so they cannot collide
       with per-surface chrome.
     - All Why home surfaces wear this footer identically.
       No surface-local overrides; if a surface needs to adjust
       spacing above the footer it does so via margin on its own
       last section.
     - Tokens align with the CC dark-glass aesthetic:
       Montserrat, subtle top border, muted palette.
   ============================================================ */

/* ---------------- Root container ---------------- */
.sf-root {
  width: 100%;
  padding: 24px 40px;
  /* Liquid-glass recipe — matches portal-nav (.pn-row-entries) exactly:
     same base fill, same blur radius, same hairline border, same shadow. */
  background: rgba(10, 11, 16, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);

  /* 3-track grid: equal 1fr gutters on both sides guarantee the center
     platform column is dead-center in the footer regardless of how wide
     the left wordmark or right copyright text is. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;

  font-family: 'Merriweather Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;

  /* Sit above the page backdrop but below the portal nav */
  position: relative;
  z-index: 10;
}

/* ---------------- Columns ---------------- */
.sf-col {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sf-col--left {
  /* grid child — occupies the left 1fr track; content aligns to the start */
  justify-self: start;
}

.sf-col--center {
  /* grid child — occupies the auto track, which is centered by the 1fr/1fr gutters */
  justify-content: center;
}

.sf-col--right {
  /* grid child — occupies the right 1fr track; content aligns to the end */
  justify-self: end;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------------- Brand link (left) ---------------- */
.sf-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(154, 160, 173, 0.55);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.sf-brand:hover {
  color: rgba(230, 232, 238, 0.80);
}

.sf-brand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- Platform links (center) ---------------- */
.sf-platforms {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sf-platform-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(154, 160, 173, 0.45);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
  padding: 4px 0;
}

.sf-platform-link:hover {
  color: rgba(230, 232, 238, 0.80);
}

.sf-platform-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Icon-link variant — removes text layout assumptions, adds block sizing. */
.sf-platform-link.sf-platform-icon-link {
  /* Override text-based padding/sizing inherited from .sf-platform-link */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  line-height: 0;
}

/* Sized icon wrapper — enforces 18×18px regardless of SVG viewBox. */
.sf-platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  line-height: 0;
}

.sf-platform-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ---------------- Right column: credit + copyright ---------------- */
.sf-credit {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(154, 160, 173, 0.40);
  white-space: nowrap;
}

.sf-aytm-link {
  font-weight: 600;
  color: rgba(154, 160, 173, 0.55);
  text-decoration: none;
  transition: color 0.18s ease;
}

.sf-aytm-link:hover {
  color: rgba(230, 232, 238, 0.80);
}

.sf-aytm-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
  border-radius: 2px;
}

.sf-sep {
  font-size: 11px;
  color: rgba(154, 160, 173, 0.25);
  user-select: none;
  flex-shrink: 0;
}

.sf-copyright {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(154, 160, 173, 0.35);
  white-space: nowrap;
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .sf-brand,
  .sf-platform-link,
  .sf-aytm-link {
    transition: none;
  }
}

/* ---------------- Narrow viewports ---------------- */
@media (max-width: 640px) {
  /* Collapse the 3-column grid to a single vertical flex stack */
  .sf-root {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px;
    gap: 14px;
  }

  /* Reset grid-specific alignment so columns stack naturally */
  .sf-col--left,
  .sf-col--center,
  .sf-col--right {
    justify-self: auto;
    align-self: auto;
  }

  .sf-col--center {
    justify-content: flex-start;
  }

  .sf-col--right {
    justify-content: flex-start;
  }
}
