/*
 * First Light accessibility safeguards.
 *
 * This stylesheet intentionally loads after saved Style Controls. It establishes
 * WCAG 2.2 AA contrast floors without changing Beaver Builder page structure.
 */

:root{
  --fls-a11y-navy:#0B1644;
  --fls-a11y-ink:#243150;
  --fls-a11y-pink:#EF8394;
  --fls-a11y-white:#FFFFFF;
}

/* Homepage journey CTAs use the pink brand button surface. */
body:not(.wp-admin).home .fls104-home-journey-row .fl-module-button .fl-button,
body:not(.wp-admin).home .fls104-home-journey-row .fl-module-button .fl-button .fl-button-text{
  color:var(--fls-a11y-navy)!important;
}

/* Homepage primary-content PowerPack dual buttons use the same pink first-action surface. */
body:not(.wp-admin).home .fl-builder-content-primary .pp-dual-button-1 .pp-button,
body:not(.wp-admin).home .fl-builder-content-primary .pp-dual-button-1 :is(.pp-button-1-text,.pp-button-text){
  color:var(--fls-a11y-navy)!important;
}

/* Homepage light-surface eyebrow follows the accessible blue accent. */
body:not(.wp-admin).home #program .pp-infobox-title-prefix{
  color:var(--fls-brand-blue,#4D67AF)!important;
}

/* Homepage journey dialog triggers must expose a visible keyboard focus state. */
body:not(.wp-admin).home .fls103-home-journey-trigger:focus-visible{
  outline:3px solid var(--fls-a11y-navy)!important;
  outline-offset:3px!important;
}

/* The footer's shared dual-button CTA has two different surfaces:
 * the first action uses the pink brand surface; the second is transparent on navy.
 */
body:not(.wp-admin) :is(.fl-page-footer-wrap,.fl-theme-builder-footer,footer,[role="contentinfo"])
  .pp-dual-button-1 .pp-button,
body:not(.wp-admin) :is(.fl-page-footer-wrap,.fl-theme-builder-footer,footer,[role="contentinfo"])
  .pp-dual-button-1 :is(.pp-button-1-text,.pp-button-text){
  color:var(--fls-a11y-navy)!important;
}

body:not(.wp-admin) :is(.fl-page-footer-wrap,.fl-theme-builder-footer,footer,[role="contentinfo"])
  .pp-dual-button-2 .pp-button,
body:not(.wp-admin) :is(.fl-page-footer-wrap,.fl-theme-builder-footer,footer,[role="contentinfo"])
  .pp-dual-button-2 :is(.pp-button-2-text,.pp-button-text){
  color:var(--fls-a11y-white)!important;
}

/* Footer/legal navigation sits on navy and must not inherit the medium brand blue. */
body:not(.wp-admin) :is(
  .fl-page-footer-wrap,
  .fl-theme-builder-footer,
  .fl-builder-content[data-type="footer"],
  footer,
  [role="contentinfo"]
) .menu-item > a,
body:not(.wp-admin) :is(
  .fl-page-footer-wrap,
  .fl-theme-builder-footer,
  .fl-builder-content[data-type="footer"],
  footer,
  [role="contentinfo"]
) .menu-item > a .menu-item-text,
body:not(.wp-admin) :is(#menu-item-442,#menu-item-443,#menu-item-444) > a,
body:not(.wp-admin) :is(#menu-item-442,#menu-item-443,#menu-item-444) > a .menu-item-text{
  color:rgba(255,255,255,.94)!important;
}

/* Secondary actions on canonical navy surfaces use white, not medium blue.
 * Keep this limited to explicitly secondary controls so pink primary buttons
 * retain their accessible navy text.
 */
body:not(.wp-admin).fls-reference-interior :is(
  .fls-ref-dark,
  .fls-ref-dark--heading,
  .fls-ref-feature-grid
) :is(.fls-stack-action-secondary,.fl-button-secondary){
  color:var(--fls-a11y-white)!important;
  border-color:var(--fls-a11y-white)!important;
}

body:not(.wp-admin).fls-reference-interior :is(
  .fls-ref-dark,
  .fls-ref-dark--heading,
  .fls-ref-feature-grid,
  .fls-ref-copy--dark
) :is(
  .fls-stack-heading,
  .fls-stack-subheading,
  .fls-stack-kicker-heading,
  .fls-stack-copy,
  .fls-stack-copy p,
  .fls-stack-editable,
  .fls-stack-editable p,
  .fls-stack-list,
  .fls-stack-list li
){
  color:rgba(255,255,255,.94)!important;
}

/* Text links on pale canonical bands need a darker accessible foreground. */
body:not(.wp-admin).fls-reference-interior :is(.fls-ref-band-blue,.fls-ref-band-pink) :is(
  .fls-stack-copy,
  .fls-stack-editable,
  .fls-functional-detail
) a:not(.fls-button):not(.fl-button):not(.pp-button):not(.uabb-button){
  color:var(--fls-a11y-navy)!important;
  text-decoration:underline;
  text-underline-offset:3px;
}

/* News & Events light surfaces. */
body:not(.wp-admin) .fls-news-feature-date{
  color:var(--fls-a11y-ink)!important;
}

body:not(.wp-admin) :is(.fls-news-home,.fls-news-feed,.fls-news-feature) .fls-news-text-link{
  color:var(--fls-a11y-navy)!important;
  text-decoration:underline;
  text-underline-offset:3px;
}

/* The retained featured-media card is white even though it sits inside the navy
 * News hero. Keep its metadata and excerpt on the card's own light surface.
 */
body:not(.wp-admin) .fls-news-page .fls-news-hero .fls-v0583-featured-news-card
  .fls-news-card-body > :is(.fls-news-card-meta,.fls-news-card-excerpt){
  color:var(--fls-a11y-ink)!important;
}

body:not(.wp-admin) .fls-news-single-header .fls-news-text-link{
  color:var(--fls-a11y-pink)!important;
}

/* Homepage impact-map metadata was just below AA on its light surfaces. */
body:not(.wp-admin) :is(
  .fls-impact__stat span,
  .fls-impact__detail-label,
  .fls-impact__detail p,
  .fls-impact__hint,
  .fls-impact__source
){
  color:var(--fls-a11y-ink)!important;
}

/* Inactive impact-view toggles are transparent on a white section. Give them an
 * explicit accessible foreground/surface; preserve white-on-dark for active state.
 */
body:not(.wp-admin) .fls-impact__controls button:not(.is-active){
  color:var(--fls-a11y-navy)!important;
  background:#fff!important;
  border-color:var(--fls-a11y-navy)!important;
}

body:not(.wp-admin) .fls-impact__controls button.is-active{
  color:var(--fls-a11y-white)!important;
  background:#313131!important;
  border-color:#313131!important;
}

body:not(.wp-admin) :is(.fls-impact__hint,.fls-impact__source){
  opacity:1!important;
}

body:not(.wp-admin) .fls-impact__source a{
  color:var(--fls-a11y-navy)!important;
  text-decoration:underline;
  text-underline-offset:2px;
}

/* Donation controls must remain compliant even when saved Style Controls exist. */
body:not(.wp-admin) .fls-donation input[type="number"]{
  color:var(--fls-a11y-navy)!important;
  background:#fff!important;
}

body:not(.wp-admin) .fls-donation__submit{
  color:var(--fls-a11y-navy)!important;
}
