/* Accessibility fixes (WCAG 2.2 AA). Loaded after custom.css so it can override older theme rules. */

/* Skip link: off-screen until it receives keyboard focus */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  padding: 0.75em 1em;
  background: #002d64;
  color: #fff;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

/* Keep the skip-link target clear of the fixed header */
#main {
  scroll-margin-top: 9em;
}

/* Closed off-canvas menu: hide it from keyboard and screen readers, not only visually */
.mainnav {
  visibility: hidden;
}

/* Only animate the slide-in: a transitioned visibility would still be "hidden" when the script moves focus */
.navtoggle-open .mainnav {
  visibility: visible;
  transition-property: transform, opacity;
}

/* Visible keyboard focus everywhere; the white ring keeps it visible on dark backgrounds */
:focus-visible {
  outline: 3px solid #0074aa !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #fff !important;
}

/* Back-to-top is a <button> now: drop the browser's button styles */
button.to-top {
  border: 0;
  padding: 0;
}

/* Social icons: at least 24 x 24 px target size (WCAG 2.5.8) */
.footer-social {
  min-width: 24px;
  min-height: 24px;
}

/* The hover dimming would also fade the focus ring */
.footer-social:focus-visible {
  opacity: 1;
}

/* Former div/span controls that are real buttons now: strip the browser's button styles
   with zero specificity so the existing theme rules keep winning */
:where(button.slider-topics-item-more, button.arrow-down, button.contact-badge, button.programitem-favorite-indicator) {
  border: 0;
  background-color: transparent;
  font-family: inherit;
  color: inherit;
  text-align: inherit;
}

:where(button.slider-topics-item-more) {
  display: block;
}

:where(button.arrow-down, button.programitem-favorite-indicator) {
  padding: 0;
}

:where(button.contact-badge) {
  display: block;
  background-color: #0074aa;
}

.contact-badge .contact-images {
  display: block;
}

/* Favourite toggle: also show it to keyboard users, not only on hover */
.programitem:focus-within .programitem-favorite-indicator {
  display: block;
}

/* Owl Carousel prev/next are buttons now */
:where(button.owl-prev, button.owl-next) {
  border: 0;
  background-color: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
}

/* Controls that the theme only reveals on hover must also show up on keyboard focus */
.owl-prev:focus-visible,
.owl-next:focus-visible {
  opacity: 1 !important;
}

/* Carousel dots: 24px between centres so each keeps a 24px target area (WCAG 2.5.8) */
.owl-dot {
  margin-left: 7px;
  margin-right: 7px;
}

.owl-autoplay-toggle {
  display: block;
  margin: 0.5rem auto 0;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: none;
  color: #0074aa;
  text-decoration: underline;
}

.splide__toggle {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: #fff;
  color: #0074aa;
  text-decoration: underline;
}

/* Contact form: the salutation group label is a <legend> now; keep it looking like the old label */
.form-radio-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.form-radio-group legend {
  margin-bottom: 0.5rem;
  font-size: inherit;
  line-height: inherit;
}

/* Brand blue #0074aa only reaches 4.4:1 on the light grey (#eee) footer and subpage backgrounds */
.footer .active > b,
.footer .active > a {
  color: #00689a;
}

/* Respect the user's "reduce motion" setting */
@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;
  }
}
