/* Link and button transitions: colours only.
  ACSS's default animates every property, so sizes animate during page load in Chrome. */
html:root {
  --link-transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out, border-color 0.3s ease-in-out, text-decoration-color 0.3s ease-in-out;
  --btn-transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
   }

/* Smaller headings use the site's navy. */
h3,
h4 {
  color: #1c1930;
}
.contact-link {
  display: inline-block;
  padding-block: 0.5rem;
  font-weight: 600;
}
/* Scrolling: instant on mobile and for reduced-motion users.
   ACSS turns on smooth scrolling site-wide, which makes long, dizzying slides to anchors on phones. */
html:root {
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  html:root {
    scroll-behavior: smooth;
  }
}

/* External links: show ↗, and tell screen readers the link opens a new tab. */
a[target="_blank"]::after {
  content: "↗";
  content: "↗" / " (opens in new tab)";
  margin-inline-start: 0.2em;
}

/* Leave space above anchor targets so headings aren't tight to the top. */
[id] {
  scroll-margin-top: 1rem;
}
/* Teaching links: an underline and a sliding arrow appear on hover/focus. */
.teaching__links a {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.teaching__links a::after {
  content: "→";
  content: "→" / ""; /* keeps screen readers from announcing the arrow */
  display: inline-block;
  margin-inline-start: 0.3em;
  opacity: 0;
  transform: translateX(-0.3em);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.teaching__links a:hover,
.teaching__links a:focus-visible {
  text-decoration-color: currentColor;
}

.teaching__links a:hover::after,
.teaching__links a:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .teaching__links a::after {
    transform: none;
  }
}