/* Connecting Crossgates links: brand blue, darker green, no underlines. */
:root {
  --crossgates-blue: #0f75bd;
  --crossgates-green: #00a652;
  --crossgates-link-hover: #00783b;
  --crossgates-link-highlight: #f2fbf6;
}

/* Override both text underlines and Olivero's inset-shadow underline. */
:is(.site-header, .main-content, .site-footer) a:any-link,
:is(.site-header, .main-content, .site-footer) a:any-link:is(:hover, :focus, :active) {
  text-decoration: none !important;
}

:is(.site-header, .main-content, .site-footer) a:any-link:not(.button, [role="button"]) {
  box-shadow: none !important;
}

.main-content .text-content a:any-link:not(.button, [role="button"]):not(:has(img, svg)),
.site-footer .text-content a:any-link:not(.button, [role="button"]):not(:has(img, svg)) {
  color: var(--crossgates-blue);
  font-weight: 700;
  background-image: linear-gradient(var(--crossgates-link-highlight), var(--crossgates-link-highlight));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color 180ms ease, background-size 720ms ease;
}

.main-content .text-content a:any-link:not(.button, [role="button"]):not(:has(img, svg)):is(:hover, :focus-visible),
.site-footer .text-content a:any-link:not(.button, [role="button"]):not(:has(img, svg)):is(:hover, :focus-visible) {
  color: var(--crossgates-link-hover);
  background-size: 100% 100%;
}

/* The green footer needs a darker resting link colour than a white page. */
.site-footer .text-content a:any-link:not(.button, [role="button"]):not(:has(img, svg)) {
  color: #102318;
}

:is(.site-header, .main-content, .site-footer) a:any-link:focus-visible {
  outline: 3px solid var(--crossgates-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Navigation remains recognisable by its placement and weight. */
.primary-nav__menu-link-inner::after {
  border-top: 0;
}

.site-header a:any-link:not(.button):hover {
  color: var(--crossgates-link-hover);
}

.button.button--primary {
  color: #fff;
  background-color: var(--crossgates-blue);
  border-color: var(--crossgates-blue);
}

.button.button--primary:is(:hover, :focus-visible) {
  color: #fff;
  background-color: var(--crossgates-link-hover);
  border-color: var(--crossgates-link-hover);
}

@media (prefers-reduced-motion: reduce) {
  :is(.main-content, .site-footer) .text-content a:any-link {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  :is(.site-header, .main-content, .site-footer) a:any-link:not(.button) {
    color: LinkText;
    background-image: none;
    outline: 1px dotted LinkText;
    outline-offset: 2px;
  }
}
