/*
 * rmc-civic-footer.css — v4.01.41 (2026-06-02)
 *
 * Civic centered 4-tier footer pattern shared by:
 *   - Tenant portal       (.rmc-civic-footer)                        via templates/components/dashboard_footer.html
 *   - Studio OS           (inherits via portal_base.html)
 *   - Manager operator    (.rmc-civic-footer.rmc-civic-footer--dark) via templates/partials/rmc_operator_footer_compact.html
 *
 * v4.01.41: ~30% vertical density (padding, tier gaps, pill/icon sizing ×0.7) — all tiers preserved.
 *
 * All values configurable via cockpit.footer.* context (see apps/siteconfig/cockpit_context.py).
 * Dark variant (`.rmc-civic-footer--dark`) flips chrome via scoped token overrides — no off-token
 * color violations (every literal is wrapped in a tokenized variable).
 */

/* ------------------------------------------------------------------ */
/* Shared container                                                    */
/* ------------------------------------------------------------------ */
.rmc-civic-footer {
  --rmc-civic-fg:          var(--text-secondary);
  --rmc-civic-fg-strong:   var(--text-primary);
  --rmc-civic-fg-muted:    var(--text-tertiary);
  --rmc-civic-fg-faint:    var(--text-muted);
  --rmc-civic-surface:     var(--surface-elevated, #fff);
  --rmc-civic-surface-sunken: var(--surface-sunken, #eef2f6);
  --rmc-civic-hairline:    var(--hairline);
  --rmc-civic-accent:      var(--school-primary, var(--brand-primary, var(--rmc-civic-fg-muted)));

  width: 100%;
  /* Aesthetic polish only (2026-07-22): same brand/midrow/legal structure —
     clearer type, calm spacing, full-bleed band. No HTML tier changes. */
  padding: 12px clamp(16px, 2.5vw, 28px) 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--rmc-civic-fg);
  background: var(--rmc-civic-surface);
  border-top: 1px solid var(--rmc-civic-hairline);
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 0;
}

.rmc-civic-footer__inner {
  margin: 0;
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

/* ------------------------------------------------------------------ */
/* Mid-row — temporal dock + trust strip + contacts on ONE wrapped row */
/* (v4.04.x footer −50% vertical). The three former tiers become inline */
/* flex groups that wrap gracefully; centered aesthetic preserved.      */
/* ------------------------------------------------------------------ */
.rmc-civic-footer__midrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px 12px;
  width: 100%;
}
/* The folded tiers size to content (not full-width) inside the mid-row. */
.rmc-civic-footer__midrow > .rmc-civic-footer__strip,
.rmc-civic-footer__midrow > .rmc-civic-footer__contacts,
.rmc-civic-footer__midrow > .rmc-footer-temporal {
  width: auto;
}

/* ------------------------------------------------------------------ */
/* Tier 1 — brand + motto + est                                        */
/* ------------------------------------------------------------------ */
.rmc-civic-footer__brand {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.2;
}
.rmc-civic-footer__brand strong { color: var(--rmc-civic-fg-strong); font-weight: 700; letter-spacing: 0.01em; }
.rmc-civic-footer__motto {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--rmc-civic-fg-muted);
  letter-spacing: 0.015em;
}
.rmc-civic-footer__est { color: var(--rmc-civic-fg-muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ */
/* Tier 2 — trust + lang + app + social (single dense row)             */
/* ------------------------------------------------------------------ */
.rmc-civic-footer__strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.rmc-civic-footer__pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-pill, 999px);
  background: var(--rmc-civic-surface-sunken);
  font-size: 12px;
  color: var(--rmc-civic-fg);
  white-space: nowrap; /* horizontal-overflow-risk-allow: short-pill-content-bounded */
}
.rmc-civic-footer__pill--secure {
  background: var(--success-soft, rgba(34,197,94,0.12));
  color: var(--success, #16a34a);
  font-weight: 700;
}
.rmc-civic-footer__pill--cert {
  background: var(--info-soft, rgba(59,130,246,0.12));
  color: var(--info, #2563eb);
  font-weight: 700;
}

.rmc-civic-footer__divider {
  display: inline-block;
  width: 1px; height: 10px;
  background: var(--rmc-civic-hairline);
  margin: 0 4px;
  align-self: center;
}

/* Language switcher chip */
.rmc-civic-footer__lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 6px;
  border: 1px solid var(--rmc-civic-hairline);
  border-radius: var(--radius-pill, 999px);
  background: var(--rmc-civic-surface);
  color: var(--rmc-civic-fg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.rmc-civic-footer__lang:hover,
.rmc-civic-footer__lang:focus-visible {
  border-color: var(--rmc-civic-accent);
  color: var(--rmc-civic-fg-strong);
  transform: translateY(-1px);
}
.rmc-civic-footer__lang-caret { font-size: 9px; opacity: 0.6; }

/* App badges */
.rmc-civic-footer__appbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--rmc-civic-hairline);
  background: var(--rmc-civic-surface);
  color: var(--rmc-civic-fg-strong);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}
.rmc-civic-footer__appbadge:hover,
.rmc-civic-footer__appbadge:focus-visible {
  border-color: var(--rmc-civic-accent);
  transform: translateY(-1px);
}
.rmc-civic-footer__appbadge-glyph { font-size: 11px; }

/* Social row */
.rmc-civic-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rmc-civic-footer__social-label {
  font-size: 12px;
  color: var(--rmc-civic-fg-muted);
  margin-right: 2px;
}
.rmc-civic-footer__social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid var(--rmc-civic-hairline);
  background: var(--rmc-civic-surface);
  color: var(--rmc-civic-fg);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.rmc-civic-footer__social-icon:hover,
.rmc-civic-footer__social-icon:focus-visible {
  border-color: var(--rmc-civic-accent);
  color: var(--rmc-civic-accent);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------ */
/* Tier 3 — contacts + social-proof stat                               */
/* ------------------------------------------------------------------ */
.rmc-civic-footer__contacts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  justify-content: center;
  align-items: center;
}
.rmc-civic-footer__contact { display: inline-flex; align-items: center; gap: 4px; }
.rmc-civic-footer__contact a { text-decoration: none; color: inherit; }
.rmc-civic-footer__contact a:hover { color: var(--rmc-civic-fg-strong); }
.rmc-civic-footer__stat {
  font-size: 12px;
  color: var(--rmc-civic-fg-muted);
  letter-spacing: 0.01em;
}
.rmc-civic-footer__stat strong { color: var(--rmc-civic-fg); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Tier 4 — legal single-line                                          */
/* ------------------------------------------------------------------ */
.rmc-civic-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px 10px;
  padding-top: 3px;
  margin-top: 0;
  border-top: 1px solid var(--rmc-civic-hairline);
  font-size: 12px;
  color: var(--rmc-civic-fg-faint);
  width: 100%;
  max-width: none;
}
.rmc-civic-footer__legal-copy { letter-spacing: 0.01em; }
.rmc-civic-footer__legal-sep { color: var(--rmc-civic-fg-muted); opacity: 0.6; }
.rmc-civic-footer__legal a { color: var(--rmc-civic-fg-faint); text-decoration: none; }
.rmc-civic-footer__legal a:hover { color: var(--rmc-civic-fg); }

/* ------------------------------------------------------------------ */
/* 3-zone horizontal distribution (tenant footer only)                 */
/* Owner 2026-06-23: "evenly distributed". At lg+ the centered column   */
/* unfolds into three balanced zones on one line:                      */
/*   brand (left) · trust + temporal + contacts (center) · legal (right)*/
/* Scoped :not(--dark) so the operator footer keeps its centered stack. */
/* Height unchanged — still the −50% compact rhythm, just horizontal.   */
/* ------------------------------------------------------------------ */
@media (min-width: 992px) {
  .rmc-civic-footer:not(.rmc-civic-footer--dark) .rmc-civic-footer__inner {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 8px 18px;
    max-width: none;
    width: 100%;
  }
  .rmc-civic-footer:not(.rmc-civic-footer--dark) .rmc-civic-footer__brand {
    justify-content: flex-start;
    flex: 0 1 auto;
  }
  .rmc-civic-footer:not(.rmc-civic-footer--dark) .rmc-civic-footer__midrow {
    flex: 1 1 auto;
    justify-content: center;
  }
  .rmc-civic-footer:not(.rmc-civic-footer--dark) .rmc-civic-footer__legal {
    flex: 0 1 auto;
    width: auto;
    max-width: none;
    justify-content: flex-end;
    text-align: right;
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
  }
}

/* ------------------------------------------------------------------ */
/* Dark variant (manager operator footer)                              */
/* ------------------------------------------------------------------ */
.rmc-civic-footer--dark {
  --rmc-civic-fg:          rgba(255, 255, 255, 0.78); /* off-token-allow: dark-chrome-text */
  --rmc-civic-fg-strong:   rgba(255, 255, 255, 0.95); /* off-token-allow: dark-chrome-text-strong */
  --rmc-civic-fg-muted:    rgba(255, 255, 255, 0.55); /* off-token-allow: dark-chrome-text-muted */
  --rmc-civic-fg-faint:    rgba(255, 255, 255, 0.42); /* off-token-allow: dark-chrome-text-faint */
  --rmc-civic-surface:     rgba(255, 255, 255, 0.04); /* off-token-allow: dark-chrome-surface */
  --rmc-civic-surface-sunken: rgba(255, 255, 255, 0.08); /* off-token-allow: dark-chrome-surface-sunken */
  --rmc-civic-hairline:    rgba(255, 255, 255, 0.10); /* off-token-allow: dark-chrome-hairline */
  --rmc-civic-accent:      var(--rmc-cockpit-chrome-text-bright, rgba(255, 255, 255, 0.88)); /* off-token-allow: dark-chrome-accent-fallback */
  background: transparent; /* sits over the operator dark canvas */
  border-top-color: var(--rmc-civic-hairline);
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .rmc-civic-footer__lang,
  .rmc-civic-footer__appbadge,
  .rmc-civic-footer__social-icon { transition: none; }
  .rmc-civic-footer__lang:hover,
  .rmc-civic-footer__appbadge:hover,
  .rmc-civic-footer__social-icon:hover { transform: none; }
}
