/*
 * Additive resource archive corrections.
 * Kept separate so the existing site.css and live-css/site.css remain intact.
 */
.msc-resources-archive .msc-resources-shell {
  align-items: flex-start;
}

.msc-resources-archive .msc-resources-content {
  flex: 1 1 auto;
  min-width: 0;
}

.msc-resources-archive .msc-live-sidebar {
  flex: 0 0 276px;
  min-width: 0;
}

.msc-resources-archive .msc-resource-pagination {
  clear: both;
  display: block;
  width: 100%;
}

@media (max-width: 1024px) {
  .msc-resources-archive .msc-live-sidebar {
    flex-basis: 180px;
  }
}

@media (max-width: 992px) {
  .msc-resources-archive .msc-live-sidebar {
    position: static;
    width: 100%;
  }
}

/* Slow, synchronized color cycle keeps the menu trigger visible over artwork. */
.msc-global-menu:not([open]) > summary::after {
  content: none;
}

.msc-global-menu:not([open]) > summary {
  text-decoration: none;
}

.msc-global-menu:not([open]) > summary > span,
.msc-global-menu:not([open]) > summary > span::before,
.msc-global-menu:not([open]) > summary > span::after {
  background-color: currentColor;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  display: block;
  height: 3px;
  text-decoration: none;
  width: 25px;
}
.msc-global-menu:not([open]) > summary > span, .msc-global-menu:not([open]) > summary > span::before, .msc-global-menu:not([open]) > summary > span::after {
  background: linear-gradient(41deg, #125ce1, #55ad65, #f2f2f2);
  background-size: 600% 600%;
  -webkit-animation: AnimationName 6s ease infinite;
  -moz-animation: AnimationName 6s ease infinite;
  animation: AnimationName 6s ease infinite;
}
@-webkit-keyframes AnimationName {
    0%{background-position:90% 0%}
    50%{background-position:11% 100%}
    100%{background-position:90% 0%}
}
@-moz-keyframes AnimationName {
    0%{background-position:90% 0%}
    50%{background-position:11% 100%}
    100%{background-position:90% 0%}
}
@keyframes AnimationName {
    0%{background-position:90% 0%}
    50%{background-position:11% 100%}
    100%{background-position:90% 0%}
}

.msc-global-menu:not([open]) > summary > span {
  color: #125ce1;
  position: relative;
}

.msc-global-menu:not([open]) > summary > span::before,
.msc-global-menu:not([open]) > summary > span::after {
  content: "";
  left: 0;
  position: absolute;
}

.msc-global-menu:not([open]) > summary > span::before {
  top: -7px;
}

.msc-global-menu:not([open]) > summary > span::after {
  top: 7px;
}

.msc-global-menu[open] > summary > span {
  display: none;
}

@keyframes msc-menu-line-color {
  0%, 28% { color: #ffffff; }
  34%, 61% { color: #125ce1; }
  67%, 94% { color: #55ad65; }
  100% { color: #ffffff; }
}

@media (prefers-reduced-motion: reduce) {
  .msc-global-menu:not([open]) > summary > span,
  .msc-global-menu:not([open]) > summary > span::before,
  .msc-global-menu:not([open]) > summary > span::after {
    animation: none;
    color: #125ce1;
  }
}

/* Keep all embedded video slides available to the carousel animation.
 * The base stylesheet otherwise hides every slide after the first. */
.msc-custom-type-video_carousel .msc-video-carousel:has(iframe) > .msc-video-slide {
  display: block;
}

/* Use the live site's social logo shapes with consistent alignment. */
.msc-footer-social,
.msc-menu-social {
  align-items: center;
}

:is(.msc-footer-social, .msc-menu-social) a {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
}

:is(.msc-footer-social, .msc-menu-social) .msc-social-icon {
  display: block;
  fill: currentColor;
  height: 27px;
  width: 27px;
}

.msc-menu-social .msc-social-icon {
  height: 23px;
  width: 23px;
}

/* Overlay menu: distinguish submenu links and expanded main sections. */
.msc-menu-primary details > div > a,
.msc-menu-primary .msc-managed-menu .sub-menu a {
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
}

.msc-menu-primary details > div {
  gap: 10px;
  margin-block: 18px 26px;
}

.msc-menu-primary details[open] > summary,
.msc-menu-primary details[open] > summary:hover,
.msc-menu-primary details[open] > summary:focus-visible,
.msc-menu-primary .msc-managed-menu > :is(.current-menu-item, .current-menu-ancestor) > a {
  color: #fff;
  opacity: 1;
  text-decoration: underline !important;
  text-decoration-color: #ffca80 !important;
  text-decoration-thickness: 3px !important;
  text-underline-offset: 8px;
}

.msc-menu-primary :is(a, summary):focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}

@media (max-width: 767px) {
  .msc-menu-primary details > div > a,
  .msc-menu-primary .msc-managed-menu .sub-menu a {
    font-size: 21px;
  }
}

/* Blog category archives: live uses one image/text row and the Blog sidebar. */
.msc-move-category-archive {
  background: #fff;
  min-height: 100vh;
  padding-top: 238px !important;
}

.msc-move-category-header {
  margin: 0 auto;
  max-width: 1420px;
  width: calc(100% - 72px);
}

.msc-move-category-header h1 {
  color: #181d27;
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  font-size: clamp(38px, 3.2vw, 52px);
  line-height: 1.05;
  margin: 0;
}

.msc-move-category-description {
  margin-top: 22px;
  max-width: 760px;
}

.msc-move-category-archive .msc-move-shell {
  column-gap: 90px;
  grid-template-columns: minmax(0, 850px) 276px;
  justify-content: start;
  max-width: 1420px;
  padding-bottom: 165px;
  padding-top: 198px;
}

.msc-move-category-archive .msc-move-posts {
  padding-left: 47px;
}

.msc-move-category-archive .msc-move-grid {
  gap: 188px;
  grid-template-columns: minmax(0, 1fr);
}

.msc-move-category-archive .msc-move-row {
  gap: 44px;
  margin: 0;
}

.msc-move-category-archive .msc-move-shell > .msc-blog-sidebar {
  left: -220px;
  margin-left: 0;
  position: relative;
}

.msc-move-category-archive .msc-move-pagination {
  margin-top: 95px;
}

@media (max-width: 1250px) {
  .msc-move-category-archive .msc-move-shell {
    column-gap: 62px;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 276px);
  }

  .msc-move-category-archive .msc-move-shell > .msc-blog-sidebar {
    left: 0;
  }
}

@media (max-width: 767px) {
  .msc-move-category-header {
    padding: 0 24px;
    width: 100%;
  }

  .msc-move-category-archive .msc-move-shell {
    display: block;
    padding-bottom: 90px;
    padding-top: 70px;
  }


  .msc-move-category-archive .msc-move-posts {
    padding-left: 0;
  }

  .msc-move-category-archive .msc-move-grid {
    gap: 75px;
  }
}

/* Linked homepage tiles inherit Kadence's anchor hover underline otherwise. */
.msc-custom-home-top,
.msc-custom-mosaic-row {
  gap: var(--msc-home-tile-gap, 0px);
}

.msc-program-detail-grid {
  gap: var(--msc-program-column-gap, 70px) !important;
  grid-template-columns: var(--msc-program-sidebar-width, 330px) minmax(0, 1fr) !important;
}

.home .msc-custom-tile-link:is(:hover, :focus, :focus-visible),
.home .msc-custom-tile-link:is(:hover, :focus, :focus-visible) :is(h1, h2, h3, h4, p, span),
.home .msc-custom-primary-panel:is(:hover, :focus, :focus-visible),
.home .msc-custom-primary-panel:is(:hover, :focus, :focus-visible) span {
  text-decoration: none !important;
}

/* Production-style search results; intentionally isolated from archive cards. */
.msc-search-results {
  box-sizing: border-box;
  min-height: calc(100vh - 260px);
  padding: clamp(90px, 12vw, 210px) var(--msc-gutter-desktop, 40px) 120px;
}

.msc-search-results-inner {
  margin-inline: auto;
  max-width: var(--msc-wide-width, 1420px);
}

.msc-search-results h1 {
  font-size: clamp(42px, 4vw, 68px);
  line-height: 1.08;
  margin: 0 0 clamp(100px, 12vw, 190px);
}

.msc-search-result + .msc-search-result {
  margin-top: 54px;
}

.msc-search-result h2 {
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.2;
  margin: 0 0 14px;
}

.msc-search-result h2 a {
  color: #2863dc;
}

.msc-search-result-excerpt,
.msc-search-result-excerpt p {
  font-size: 18px;
  line-height: 1.45;
  margin: 0;
}

.msc-search-pagination {
  margin-top: 70px;
}

@media (max-width: 767px) {
	.msc-custom-home-top {
		margin-bottom: var(--msc-home-mobile-section-gap, 0px);
	}

	.msc-custom-mosaic-row + .msc-custom-mosaic-row {
		margin-top: var(--msc-home-mobile-section-gap, 0px);
	}

	.msc-program-detail-grid {
		display: block !important;
	}

  .msc-search-results {
    padding: 70px var(--msc-gutter-mobile, 20px) 80px;
  }

  .msc-search-results h1 {
    margin-bottom: 70px;
  }
}

/* Ways to Give: allow the donation column to shrink on narrow phones. */
@media (max-width: 767px) {
  /* Staging uses a Kadence row with 30px gutters, leaving only 330px
     on iPhone 12. Give BetterUnite's 360px form room to fit. */
  .entry-content .wp-block-kadence-rowlayout:has(.msc-form-widget) > .kt-row-column-wrap {
    padding-inline: clamp(0px, calc((100vw - 370px) / 2), 10px);
  }

  /* BetterUnite needs 350px for its form plus 10px of internal padding. */
  .msc-give-now-live {
    padding-inline: clamp(0px, calc((100% - 370px) / 2), 24px);
  }

  .msc-give-now-live .msc-give-now-inner {
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .msc-give-now-inner > *,
  .msc-live-donation-widget,
  .msc-chariot-slot {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .msc-give-now-inner .msc-live-donation-widget {
    width: 100%;
    margin-inline: auto;
  }

  .msc-live-donation-widget iframe,
  .msc-chariot-slot chariot-button {
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* Move Blog: keep linked cards visually identical to production. */
.msc-move-archive :is(.msc-move-art, .msc-move-copy h2 a),
.msc-move-archive :is(.msc-move-art, .msc-move-copy h2 a):is(:link, :visited, :hover, :active, :focus, :focus-visible) {
  background-image: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  color: #181d27 !important;
  text-decoration: none !important;
}

.msc-move-archive :is(.msc-move-art, .msc-move-copy h2 a)::before,
.msc-move-archive :is(.msc-move-art, .msc-move-copy h2 a)::after {
  background: none !important;
  border: 0 !important;
  content: none !important;
  text-decoration: none !important;
}

.msc-move-copy h2 a:focus-visible,
.msc-move-art:focus-visible {
  outline: 3px solid #2863dc;
  outline-offset: 5px;
}

/* Live uses a 200ms-delayed bottom-to-top reveal for every blog row. */
.msc-blog-reveal-ready .msc-move-grid .msc-move-row {
  opacity: 0;
  transform: translate3d(0, 54px, 0);
  transition: opacity 650ms ease 200ms, transform 650ms cubic-bezier(.22, .61, .36, 1) 200ms;
  will-change: opacity, transform;
}

.msc-blog-reveal-ready .msc-move-grid .msc-move-row.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .msc-blog-reveal-ready .msc-move-grid .msc-move-row {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Keep each program section's image and content together. */
.msc-managed-program .msc-program-service-rows {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  margin-top: 32px;
}
.msc-managed-program .msc-program-service-row {
  grid-template-columns: minmax(0, 30%) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  margin: 0 !important;
}
.msc-managed-program .msc-program-service-row--text-only {
  grid-template-columns: minmax(0, 1fr);
}
.msc-managed-program .msc-program-service-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.msc-managed-program .msc-program-service-copy > :first-child {
  margin-top: 0;
}
.msc-managed-program .msc-program-service-copy h2:not(:first-child) {
  margin-top: 28px;
}
.msc-managed-program .msc-program-service-copy > :last-child {
  margin-bottom: 0 !important;
}
@media (max-width: 767px) {
  .msc-managed-program .msc-program-service-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Resource content must retain its column even when the entry is short. */
.msc-single-resource .msc-single-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 4vw, 54px);
  padding-inline: 24px;
  box-sizing: border-box;
}
.msc-single-resource .msc-single-shell > .msc-resource-body,
.msc-single-resource .msc-single-shell > .msc-live-sidebar {
  min-width: 0;
  width: 100%;
}
.msc-resource-default-content > :first-child { margin-top: 0; }
.msc-resource-default-content figure { margin: 24px 0; }
.msc-resource-default-content img { max-width: 100%; height: auto; }
@media (max-width: 767px) {
  .msc-single-resource .msc-single-shell {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 20px;
  }
  .msc-single-resource .msc-single-shell > .msc-live-sidebar {
    position: static;
  }
}

/* Resource byline and publication year follow the title in its column. */
.msc-single-resource .msc-resource-meta {
  display: block;
  grid-column: 2;
  margin: 0 0 24px;
  font-size: inherit;
  line-height: 1.6;
  color: inherit;
}
.msc-single-resource .msc-resource-meta p {
  margin: 0 0 20px;
}
.msc-single-resource .msc-resource-meta p:last-child {
  margin-bottom: 0;
}
.msc-resource-body.msc-resource-has-embed .msc-editorial-content > .msc-resource-meta {
  grid-column: 1 / -1;
}


/* Client-approved resource button color, including migrated WP buttons. */
.msc-single-resource .msc-resource-body .msc-managed-button,
.msc-single-resource .msc-resource-body .wp-block-button__link {
  background-color: var(--msc-button-bg, #1947A4) !important;
  border-color: var(--msc-button-bg, #1947A4) !important;
  color: var(--msc-button-text, #fff) !important;
}
.msc-single-resource .msc-resource-body .msc-managed-button:focus-visible,
.msc-single-resource .msc-resource-body .wp-block-button__link:focus-visible {
  outline: 2px solid #1947A4;
  outline-offset: 3px;
}

/* Financials: support the current Kadence page and original editorial wrapper. */
body.page-id-85729 #primary.content-area {
  margin-block: 0;
}
body.page-id-85729 #primary > .content-container {
  max-width: 1200px;
  padding-inline: 36px;
  margin-inline: auto;
}
body.page-id-85729 .entry-content-wrap {
  padding: 0;
}
body.page-id-85729 .entry-content > .wp-block-kadence-rowlayout > .kt-row-column-wrap {
  padding: 140px 0 100px;
  max-width: 1128px;
  margin-inline: auto;
}
body.page-id-85729 .entry-content .kt-inside-inner-col > h1 {
  font-size: 29px;
  line-height: 1.25;
  margin: 0 0 64px;
}
body.page-id-85729 .entry-content .kt-inside-inner-col > h1::after {
  content: "";
  display: block;
  width: 100px;
  border-top: 4px solid #1947a4;
  margin-top: 20px;
}
body.page-id-85729 .entry-content .kt-inside-inner-col > h2 {
  font-size: 29px;
  line-height: 1.3;
  margin: 0 0 20px;
}
body.page-id-85729 .entry-content .kt-inside-inner-col > p {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 24px;
}
body.page-id-85729 .entry-content .kt-inside-inner-col > p + h2 {
  margin-top: 40px;
}
@media (max-width: 767px) {
  body.page-id-85729 #primary > .content-container {
    padding-inline: 24px;
  }
  body.page-id-85729 .entry-content > .wp-block-kadence-rowlayout > .kt-row-column-wrap {
    padding-block: 100px 64px;
  }
  body.page-id-85729 .entry-content .kt-inside-inner-col > h1,
  body.page-id-85729 .entry-content .kt-inside-inner-col > h2 {
    font-size: 26px;
  }
}

/* Override the legacy mobile rule that separated all images from their text. */
@media (max-width: 767px) {
  .msc-managed-program .msc-program-service-rows {
    display: grid !important;
    margin-top: 32px !important;
  }
  .msc-managed-program .msc-program-service-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
  }
  .msc-managed-program .msc-program-service-row .msc-program-service-image,
  .msc-managed-program .msc-program-service-row .msc-program-service-copy {
    order: initial;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
}

/* WordPress-managed overlay menus retain the existing accordion layout. */
.msc-menu-primary .msc-managed-menu .sub-menu {
  list-style: none;
  margin: 18px 0 26px;
  padding: 0;
}
.msc-menu-primary .msc-managed-menu .sub-menu > li {
  margin: 10px 0;
}
.msc-menu-primary .msc-managed-menu details > a {
  display: block;
  margin-top: 18px;
  font-size: 27px;
  font-weight: 500;
}
@media (max-width: 767px) {
  .msc-menu-primary .msc-managed-menu details > a { font-size: 21px; }
}

/* Per-button editor colors; legacy buttons retain the brand defaults. */
.msc-managed-buttons .msc-managed-button {
  background-color: var(--msc-button-bg, #1947A4);
  border-color: var(--msc-button-bg, #1947A4);
  color: var(--msc-button-text, #ffffff);
}

.msc-single-resource .msc-resource-action { margin: 24px 0; }

/* Homepage video thumbnails open an accessible YouTube gallery. */
[data-msc-video-gallery]::after { pointer-events: none; }
[data-msc-video-gallery] .msc-video-slide { display: block !important; }
[data-msc-video-gallery] .msc-video-slide a { position: relative; display: block; }
.msc-video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #e62117; color: #fff; border-radius: 12px; padding: 10px 24px; font-size: 32px; line-height: 1.2; pointer-events: none; }
.msc-video-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 60px 64px 110px; border: 0; background: rgb(0 0 0 / 85%); color: #fff; box-sizing: border-box; }
.msc-video-dialog[open] { display: flex; align-items: center; justify-content: center; }
.msc-video-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.msc-video-player { width: min(100%, 1000px, calc((100dvh - 190px) * 16 / 9)); aspect-ratio: 16 / 9; }
.msc-video-player iframe { width: 100%; height: 100%; display: block; border: 0; }
.msc-video-dialog button { background: transparent; color: #fff; border: 0; cursor: pointer; padding: 8px; min-width: 44px; min-height: 44px; }
.msc-video-dialog button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.msc-video-close { position: absolute; right: 12px; top: 10px; font-size: 32px; }
.msc-video-prev, .msc-video-next { position: absolute; top: 45%; font-size: 40px; }
.msc-video-prev { left: 4px; } .msc-video-next { right: 4px; }
.msc-video-thumbnails { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; max-width: 90%; overflow-x: auto; }
.msc-video-thumbnails button { padding: 2px; opacity: .55; flex: 0 0 100px; }
.msc-video-thumbnails button[aria-pressed="true"] { opacity: 1; box-shadow: inset 0 0 0 2px #fff; }
.msc-video-thumbnails img { width: 96px; height: 54px; object-fit: cover; display: block; }
.msc-video-status { position: absolute; bottom: 2px; margin: 0; font-size: 13px; }
@media (max-width: 600px) { .msc-video-dialog { padding: 60px 40px 110px; } .msc-video-thumbnails button { flex-basis: 80px; } .msc-video-thumbnails img { width: 76px; height: 43px; } }

[data-msc-video-gallery]::after { display: none; }
[data-msc-video-gallery] .msc-video-slide { animation: none !important; opacity: 1; }
[data-msc-video-gallery] .msc-video-slide[hidden] { display: none !important; }

[data-msc-video-gallery] .msc-image-slide img { object-fit: var(--msc-image-fit, contain); }

/* Image carousel scrolls horizontally, independently of the video dialog. */
[data-msc-video-gallery].msc-image-carousel { overflow: hidden; position: relative; }
.msc-image-carousel .msc-image-track { display: flex; height: 100%; width: 100%; }
[data-msc-video-gallery].msc-image-carousel .msc-image-slide { position: relative; inset: auto; flex: 0 0 100%; min-width: 0; height: 100%; margin: 0; }
.msc-image-controls { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; z-index: 6; }
.msc-image-controls button { width: 32px; height: 32px; min-width: 32px; padding: 10px; border: 0; background: transparent; cursor: pointer; }
.msc-image-controls button::before { content: ''; display: block; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #1947a4; }
.msc-image-controls button[aria-pressed="true"]::before { background: #1947a4; }
.msc-image-controls button:focus-visible { outline: 2px solid #1947a4; }
@media (prefers-reduced-motion: reduce) { .msc-image-track { transition: none !important; } }

/* Override legacy brand-carousel stacking and opacity on every frame. */
.msc-custom-mosaic-row .msc-custom-type-video_carousel [data-msc-video-gallery].msc-image-carousel .msc-image-slide {
  position: relative !important;
  inset: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  animation: none !important;
  flex: 0 0 100%;
}
.msc-image-carousel .msc-image-controls { display: none !important; }

/* Leave room below the floating mobile logo on Resources and Our Partners. */
@media (max-width: 767px) {
  body:is(.page-id-91427, .page-id-83255, .page-id-82660) .entry-content-wrap {
    padding-top: 40px !important;
  }
}
