/* Accessibility layer for the static Divi clone (WCAG 2.1 AA).
 * Loaded after Divi's CSS on every page.
 */

/* Skip link: off-screen until focused with the keyboard. */
.mp-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100000;
  padding: 12px 18px;
  background: #0F395E;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: underline;
  border-radius: 4px;
}
.mp-skip-link:focus {
  left: 8px;
}
#main-content:focus {
  outline: none !important;
}

/* Visible keyboard focus. Divi sets :focus{outline:0}; :focus-visible only
 * matches keyboard focus, so mouse and touch users see no change.
 * Navy ring with a white gap reads on white, grey, green and navy alike. */
:focus-visible {
  outline: 3px solid #0F395E !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #fff !important;
}
/* On the navy header bar, footer and dark sections use a white ring. */
.et-l--header .et_pb_menu :focus-visible,
.et-l--footer :focus-visible,
.et_pb_bg_layout_dark :focus-visible,
.mp-skip-link:focus-visible {
  outline-color: #fff !important;
  box-shadow: 0 0 0 2px #0F395E !important;
}

/* Keyboard-opened dropdowns (class set by a11y.js only on keyboard focus),
 * shown exactly as Divi shows them on hover. */
.et-menu-nav li.mp-kb-open > ul.sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Content must not depend on JavaScript: Divi hides scroll-reveal blocks with
 * opacity:0 and only JS fades them in. Divi's inline head script sets
 * html.js, so this only applies when scripts never run. */
html:not(.js) .et-waypoint:not(.et_pb_counters),
html:not(.js) .et_animated {
  opacity: 1 !important;
}

/* Reduced motion: land everything in its final visible state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .et-waypoint:not(.et_pb_counters),
  .et_animated,
  .et_pb_animation_top, .et_pb_animation_bottom,
  .et_pb_animation_left, .et_pb_animation_right,
  .et_pb_animation_fade_in {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Blog post template: the fixed 400px blurb caused sideways scrolling on
 * phones and at 400% zoom. */
.et_pb_blurb_0_tb_body.et_pb_blurb {
  max-width: 100%;
}

/* Links inside running text must not rely on color alone. */
#main-content .et_pb_text_inner p a:not(.et_pb_button),
#main-content .et_pb_text_inner li a:not(.et_pb_button),
#main-content .et_pb_post_content p a:not(.et_pb_button),
#main-content .et_pb_post_content li a:not(.et_pb_button),
#main-content .et_pb_toggle_content p a,
#main-content .et_pb_tab_content p a {
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px;
}

/* Small contrast fixes in plugin defaults (WCAG 1.4.3). */
.wp-block-search__button { color: #4a4a4a !important; }
.tribe-events-notices { color: #24607e !important; }
.page-next, .page-prev { color: #5f5f5f !important; }
.et_pb_countdown_timer .section,
.et_pb_countdown_timer .section p { color: #fff !important; opacity: 1 !important; }
