/**
 * Phase 8B.5 — Shared public page layout (footer, container alignment).
 * No business logic. Layout stabilization only.
 */

/* —— Sticky footer: content grows, footer stays after content —— */
body.ex-public-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.ex-public-layout > main,
body.ex-public-layout > .shell,
body.ex-public-layout > main.shell {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
}

body.ex-public-layout > .ex-env-footer,
body.ex-public-layout > footer.ex-env-footer {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
}

/* Override institutional shell footer offset — flex column handles vertical spacing */
body.ex-public-layout > footer.ex-env-footer {
  margin-top: auto;
}

/* Authority / workflow consoles — no public footer */
body.ex-authority-surface > footer.ex-env-footer,
body.ex-authority-surface > [data-ex-env-footer],
body.ex-authority-surface .shell > footer.ex-env-footer,
body.ex-authority-surface main.shell > footer.ex-env-footer {
  display: none !important;
}

body.ex-authority-surface > main,
body.ex-authority-surface > .shell,
body.ex-authority-surface > main.shell {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
}

body.ex-authority-surface .ex-env-chrome-band .ex-env-header,
body.ex-authority-surface .ex-inst-shell,
body.ex-authority-surface main.shell,
body.ex-authority-surface > .shell {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ex-ds-s24, 24px);
  padding-right: var(--ex-ds-s24, 24px);
  width: 100%;
  box-sizing: border-box;
}

/* —— Shared horizontal container — header / main / footer —— */
.ex-public-page-container,
body.ex-public-layout .ex-env-chrome-band .ex-env-header,
body.ex-public-layout .ex-inst-shell,
body.ex-public-layout main.shell,
body.ex-public-layout > .shell,
body.ex-public-layout .ex-env-footer--canonical,
body.ex-public-layout > .ex-env-footer {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ex-ds-s24, 24px);
  padding-right: var(--ex-ds-s24, 24px);
  width: 100%;
  box-sizing: border-box;
}

body.ex-public-layout .ex-env-chrome-band {
  width: 100%;
  flex-shrink: 0;
}

body.ex-public-layout .ex-inst-shell {
  padding-top: var(--ex-ds-s24, 24px);
  padding-bottom: var(--ex-ds-s48, 48px);
}

body.ex-public-layout > .shell {
  padding-top: var(--ex-ds-s24, 24px);
  padding-bottom: var(--ex-ds-s48, 48px);
}

/* —— Reduce excessive empty vertical space on short publication pages —— */
body.ex-public-layout.ex-customer-acquisition-page .ex-inst-shell,
body.ex-public-layout.ex-institutional-targets-page .ex-inst-shell {
  padding-bottom: var(--ex-ds-s32, 32px);
}

body.ex-public-layout .ex-standard-publication-document {
  display: grid;
  gap: var(--ex-ds-s24, 24px);
}

/* —— Institutional product sections (governance / pilot) —— */
.ex-ca-institutional-sections {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

.ex-ca-content-section {
  padding: 20px 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fff;
}

.ex-ca-content-section h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.ex-ca-content-section p,
.ex-ca-content-section li {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.ex-ca-content-section ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.ex-ca-content-section + .ex-ca-content-section {
  margin-top: 0;
}

.ex-ca-final-cta {
  padding: 20px 22px;
  border: 1px solid #0f172a;
  border-radius: 12px;
  background: #f8fafc;
  display: grid;
  gap: 12px;
}

.ex-ca-final-cta h3 {
  margin: 0;
  font-size: 1.05rem;
}

.ex-ca-final-cta p {
  margin: 0;
  color: #475569;
}

.ex-ca-final-cta a.ex-ca-btn-primary {
  justify-self: start;
  display: inline-block;
  text-decoration: none;
}

/* —— Form submit CTA — visible, above footer —— */
.ex-ca-form-cta {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.ex-ca-btn-primary.ex-ca-submit-cta {
  width: 100%;
  max-width: 420px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* —— Public outreach overview (not admin panel) —— */
body.ex-institutional-targets-page .ex-it-public-overview {
  display: grid;
  gap: 20px;
}

body.ex-institutional-targets-page .ex-it-public-intro {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  max-width: 52rem;
}

body.ex-institutional-targets-page .ex-it-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

body.ex-institutional-targets-page .ex-it-public-note {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

body.ex-institutional-targets-page .ex-it-public-summary-table .ex-it-table th:last-child,
body.ex-institutional-targets-page .ex-it-public-summary-table .ex-it-table td:last-child {
  white-space: nowrap;
}

/* Proof / execution: align shell with institutional container when layout class present */
body.ex-public-layout[data-ex-env-page="proof"] > main.shell,
body.ex-public-layout[data-ex-env-page="execution"] > .shell {
  max-width: 1180px;
}
