/*
 * Site-wide footer normalization.
 * Loaded after page-specific styles so every public footer has the same shell.
 * Internal grids/lists remain page-owned; this file normalizes the outer footer.
 */

:root {
  --global-footer-bg: #10233d;
  --global-footer-ink: #dbe6f2;
  --global-footer-strong: #ffffff;
  --global-footer-accent: #c89b18;
  --global-footer-link-hover: #f3d36a;
  --global-footer-line: rgba(255, 255, 255, 0.16);
}

body > footer,
footer.footer,
footer.site-foot,
footer.essay-footer,
footer.submit-footer,
footer.document-site-footer {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin: 48px 0 0 !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-top: 3px solid var(--global-footer-accent) !important;
  border-radius: 0 !important;
  background: var(--global-footer-bg) !important;
  color: var(--global-footer-ink) !important;
  box-shadow: none !important;
  text-align: left;
}

/* Existing wrapper names used across the site. */
body > footer :where(
  .footer-inner,
  .foot-inner,
  .essay-footer-inner,
  .submit-footer-inner,
  .footer-container,
  .footer-content,
  .wrap
),
footer.footer :where(
  .footer-inner,
  .footer-container,
  .footer-content,
  .wrap
),
footer.site-foot .foot-inner,
footer.essay-footer .essay-footer-inner,
footer.submit-footer .submit-footer-inner {
  box-sizing: border-box !important;
  width: min(100%, 1180px) !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  color: var(--global-footer-ink) !important;
}

/* Give the main inner shell stable vertical rhythm without flattening its grid. */
body > footer > :where(
  .footer-inner,
  .foot-inner,
  .essay-footer-inner,
  .submit-footer-inner,
  .footer-container,
  .footer-content,
  .wrap
),
footer.footer > :where(.footer-inner, .footer-container, .footer-content, .wrap),
footer.site-foot > .foot-inner,
footer.essay-footer > .essay-footer-inner,
footer.submit-footer > .submit-footer-inner {
  padding-top: 30px !important;
  padding-bottom: 34px !important;
}

/* Wrapper-less document footers. */
footer.document-site-footer {
  padding-top: 28px !important;
  padding-bottom: 32px !important;
}
footer.document-site-footer > * {
  box-sizing: border-box;
  width: min(100%, 1180px);
  max-width: 1180px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Preserve rich footer grids but keep them inside the common reading width. */
body > footer .footer-grid,
footer.footer .footer-grid {
  width: 100% !important;
  max-width: 100% !important;
}

body > footer :where(p, li, span, small, address, div),
footer.footer :where(p, li, span, small, address, div),
footer.site-foot :where(p, li, span, small, address, div),
footer.essay-footer :where(p, li, span, small, address, div),
footer.submit-footer :where(p, li, span, small, address, div),
footer.document-site-footer :where(p, li, span, small, address, div) {
  color: var(--global-footer-ink) !important;
}

body > footer :where(strong, h2, h3, h4, .foot-brand, .submit-footer-title),
footer.footer :where(strong, h2, h3, h4),
footer.site-foot :where(strong, .foot-brand),
footer.essay-footer strong,
footer.submit-footer :where(strong, .submit-footer-title),
footer.document-site-footer strong {
  color: var(--global-footer-strong) !important;
}

body > footer a,
footer.footer a,
footer.site-foot a,
footer.essay-footer a,
footer.submit-footer a,
footer.document-site-footer a {
  color: #ffffff !important;
  text-decoration-color: rgba(255, 255, 255, 0.48) !important;
  text-underline-offset: 3px;
}

body > footer a:hover,
footer.footer a:hover,
footer.site-foot a:hover,
footer.essay-footer a:hover,
footer.submit-footer a:hover,
footer.document-site-footer a:hover {
  color: var(--global-footer-link-hover) !important;
  text-decoration-color: var(--global-footer-link-hover) !important;
}

body > footer :where(.footer-governance, .footer-bottom, .copyright),
footer.footer :where(.footer-governance, .footer-bottom, .copyright) {
  border-color: var(--global-footer-line) !important;
}

/* Avoid the old light-background copyright rule becoming a pale strip. */
body > footer .copyright,
footer.footer .copyright {
  width: 100% !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  color: rgba(255, 255, 255, 0.62) !important;
}

@media (max-width: 760px) {
  body > footer,
  footer.footer,
  footer.site-foot,
  footer.essay-footer,
  footer.submit-footer,
  footer.document-site-footer {
    margin-top: 36px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body > footer > :where(
    .footer-inner,
    .foot-inner,
    .essay-footer-inner,
    .submit-footer-inner,
    .footer-container,
    .footer-content,
    .wrap
  ),
  footer.footer > :where(.footer-inner, .footer-container, .footer-content, .wrap),
  footer.site-foot > .foot-inner,
  footer.essay-footer > .essay-footer-inner,
  footer.submit-footer > .submit-footer-inner {
    padding-top: 24px !important;
    padding-bottom: 28px !important;
  }

  footer.document-site-footer {
    padding-top: 24px !important;
    padding-bottom: 28px !important;
  }
}

@media print {
  body > footer,
  footer.footer,
  footer.site-foot,
  footer.essay-footer,
  footer.submit-footer,
  footer.document-site-footer {
    margin-top: 24px !important;
    padding: 12px 0 !important;
    border-top: 1px solid #777 !important;
    background: #fff !important;
    color: #111 !important;
  }

  body > footer *,
  footer.footer *,
  footer.site-foot *,
  footer.essay-footer *,
  footer.submit-footer *,
  footer.document-site-footer * {
    color: #111 !important;
  }
}

/* Footer support CTA normalization */
body > footer .footer-support,
footer.footer .footer-support {
  box-sizing: border-box !important;
  width: min(100%, 1180px) !important;
  max-width: 1180px !important;
  margin: 0 auto 30px !important;
  padding: 18px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  border: 1px solid rgba(255,255,255,.20) !important;
  border-radius: 14px !important;
  background: linear-gradient(90deg, #f97316 0%, #ea580c 100%) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.14) !important;
}

/* Keep one shared footer markup, but show the support CTA in the footer's top slot. */
body > footer:has(> .footer-support),
footer.footer:has(> .footer-support) {
  display: flex !important;
  flex-direction: column !important;
}

body > footer:has(> .footer-support) > .footer-support,
footer.footer:has(> .footer-support) > .footer-support {
  order: -1 !important;
  margin: 22px auto 0 !important;
}

body > footer .footer-support > div,
footer.footer .footer-support > div {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body > footer .footer-support strong,
footer.footer .footer-support strong {
  display: block !important;
  margin: 0 !important;
  color: #fff !important;
  font-weight: 900 !important;
}

body > footer .footer-support p,
footer.footer .footer-support p {
  margin: 4px 0 0 !important;
  color: rgba(255,255,255,.96) !important;
  line-height: 1.65 !important;
}

body > footer .footer-support > a,
footer.footer .footer-support > a {
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 136px !important;
  min-height: 46px !important;
  padding: 10px 18px !important;
  border: 1px solid rgba(255,255,255,.28) !important;
  border-radius: 999px !important;
  background: #102a43 !important;
  color: #fff !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: 0 5px 14px rgba(0,0,0,.16) !important;
}

body > footer .footer-support > a:hover,
footer.footer .footer-support > a:hover {
  background: #173a5e !important;
  color: #fff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  body > footer .footer-support,
  footer.footer .footer-support {
    margin-bottom: 24px !important;
    padding: 16px !important;
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  body > footer:has(> .footer-support) > .footer-support,
  footer.footer:has(> .footer-support) > .footer-support {
    margin: 18px auto 0 !important;
  }

  body > footer .footer-support > a,
  footer.footer .footer-support > a {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media print {
  body > footer .footer-support,
  footer.footer .footer-support {
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #777 !important;
    box-shadow: none !important;
  }

  body > footer .footer-support > a,
  footer.footer .footer-support > a {
    background: #fff !important;
    color: #111 !important;
    border-color: #777 !important;
    box-shadow: none !important;
  }
}

