/* Final responsive safeguards shared by every public page. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
}

main,
.site-header,
.fund-ticker,
.footer {
  min-width: 0;
}

:where(.shell, .container, .unified-nav) {
  max-width: 100%;
}

:where(
  .unified-nav,
  .unified-navigation,
  .unified-actions,
  .contact-grid,
  .contact-card,
  .contact-form,
  .footer-grid,
  .footer-bottom__inner,
  .downloads-library__grid,
  .downloads-help,
  .download-card,
  .page-intro,
  .trustee-grid,
  .provider-grid,
  .providers-network__intro,
  .strategy-purpose-grid,
  .strategy-download__grid,
  .news-article-layout
) > * {
  min-width: 0;
}

video,
canvas,
iframe {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
}

input,
select,
textarea {
  font-size: 1rem;
}

a[href^="mailto:"],
.contact-card dd,
.form-hint,
.downloads-help,
.help-chat__message,
.help-chat__notice,
.footer-contact a span,
.footer-bottom__inner,
.news-article-copy {
  overflow-wrap: anywhere;
}

.contact-form :is(input, select, textarea) {
  width: 100%;
}

.site-header .unified-navigation > a,
.site-header .unified-dropdown > summary,
.site-header .unified-dropdown__menu a {
  font-size: 1rem !important;
}

.site-header .unified-staff-login {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .55rem .15rem;
  color: #172033;
  font-size: 1rem !important;
  font-weight: 700;
  line-height: 1.2 !important;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .24em;
  white-space: nowrap;
}

.site-header .unified-portal {
  font-size: 1rem !important;
}

.unified-brand,
.unified-actions {
  min-width: 0;
}

.unified-actions {
  flex: 0 0 auto;
}

.strategy-glance-pillars,
.who-we-serve__grid {
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

dialog,
.dialog,
.agm-gallery-viewer {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.help-chat__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 7rem);
  overflow-y: auto;
}

.help-chat__panel[hidden] {
  display: none;
}

.help-chat__messages {
  flex: 0 1 auto;
  min-height: 4rem;
  max-height: min(280px, 35dvh);
}

@media (max-width: 1080px) {
  .site-header .unified-staff-login {
    display: none;
  }

  .unified-nav {
    gap: clamp(.65rem, 2vw, 1rem);
    justify-content: space-between;
  }

  .unified-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .unified-actions {
    gap: .6rem;
  }

  .unified-navigation {
    max-height: calc(100dvh - var(--navigation-top, 104px));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .site-header .unified-navigation > a,
  .site-header .unified-dropdown > summary,
  .site-header .unified-dropdown__menu a {
    font-size: 1rem !important;
  }

  .unified-navigation__contact {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  .utility,
  .utility-bar {
    display: none;
  }

  .unified-nav {
    width: calc(100% - 24px) !important;
    min-height: 64px;
    gap: .5rem;
  }

  .unified-brand {
    max-width: clamp(120px, 43vw, 145px);
  }

  .unified-actions {
    gap: .4rem;
  }

  .unified-menu-button,
  .unified-portal {
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .site-header .unified-portal {
    width: auto;
    padding: .5rem .65rem;
    justify-content: center;
    gap: .35rem;
    font-size: 1rem !important;
  }

  .site-header .unified-portal__label {
    display: none;
  }

  .site-header .unified-portal__compact {
    display: inline;
  }

  .unified-navigation {
    right: -12px;
    left: -12px;
    padding-right: 16px;
    padding-left: 16px;
  }

  main h1 {
    font-size: clamp(2.1rem, 10vw, 3rem) !important;
    line-height: 1.08 !important;
    text-wrap: balance;
  }

  main h2 {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
    line-height: 1.05;
    text-wrap: balance;
  }

  main :is(h1, h2, h3) {
    overflow-wrap: anywhere;
  }

  .hero-slider-controls button {
    position: relative;
    min-width: 44px;
    height: 44px;
    background: transparent !important;
  }

  .hero-slider-controls button::after {
    position: absolute;
    top: 20px;
    right: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, .45);
    content: "";
  }

  .hero-slider-controls button.is-active::after {
    background: var(--gold-pale);
  }

  .strategy-page .subpage-hero {
    min-height: 0;
    padding-block: clamp(3.5rem, 14vw, 5rem);
  }

  .strategy-page .subpage-hero h1 {
    max-width: 14ch;
    font-size: clamp(2.4rem, 11vw, 3.1rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -.045em;
    text-wrap: balance;
  }

  .downloads-page .downloads-hero {
    min-height: clamp(400px, 70svh, 540px);
    padding-block: clamp(3.5rem, 14vw, 5rem);
  }

  .downloads-page .downloads-hero h1 {
    font-size: clamp(2.5rem, 12vw, 3.5rem) !important;
    line-height: 1 !important;
    text-wrap: balance;
  }

  .contact-grid,
  .footer-grid,
  .downloads-library__grid,
  .downloads-help,
  .page-intro,
  .provider-grid,
  .trustee-grid,
  .values-detail__grid,
  .strategy-purpose-grid,
  .strategy-download__grid,
  .news-article-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .contact-card,
  .contact-form,
  .downloads-help,
  .download-card,
  .report-card,
  .download-page-card {
    max-width: 100%;
    min-width: 0;
  }

  .downloads-help {
    padding: 1.4rem;
  }

  .download-card,
  .report-card,
  .download-page-card {
    gap: .8rem;
    padding: 1rem;
  }

  .download-card > div,
  .report-card > div,
  .download-page-card > div {
    min-width: 0;
  }

  .strategy-page .strategy-download-card {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-download-card > * {
    min-width: 0;
    max-width: 100%;
  }

  .strategy-download-card .button {
    white-space: normal;
    text-align: center;
  }

  .team-tabs,
  .provider-tabs,
  .downloads-tabs {
    max-width: 100%;
  }

  .team-tabs button,
  .provider-tabs button,
  .downloads-tabs button {
    min-width: 0;
    min-height: 44px;
  }

  .footer--home .footer-grid > *,
  .footer-contact,
  .footer-contact a,
  .footer-contact a span {
    min-width: 0;
  }

  .footer--home .footer-brand {
    max-width: 100%;
  }

  .footer--home .footer-brand img {
    width: min(240px, 100%);
    height: auto;
  }

  .footer-bottom__inner nav {
    min-width: 0;
  }

  .help-chat {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: max(1rem, env(safe-area-inset-left));
    width: auto;
  }

  .help-chat__panel {
    max-height: calc(100dvh - 5rem);
  }

  .help-chat__messages {
    max-height: min(245px, 35dvh);
  }

  .help-chat__close,
  .help-chat__suggestions button,
  .help-chat__form button {
    min-height: 44px;
  }

  .help-chat__close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 380px) {
  .shell,
  .container {
    width: calc(100% - 24px);
  }

  .downloads-library > .shell,
  .policy-quicklinks > .shell,
  .strategy-page #strategy-pillars > .container,
  .strategy-launch-gallery > .container {
    width: 100%;
  }

  .downloads-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-card,
  .contact-form {
    padding: 1rem;
  }
}

@media (max-width: 340px) {
  .unified-nav {
    width: calc(100% - 16px) !important;
  }

  .unified-brand {
    max-width: min(118px, 37vw);
  }

  .unified-navigation {
    right: -8px;
    left: -8px;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1080px) {
  .strategy-page .subpage-hero,
  .downloads-page .downloads-hero,
  .hero {
    min-height: auto;
  }
}

@supports (padding: max(0px)) {
  .unified-nav {
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
  }
}
