/* A common interaction floor, after component and legacy theme styles. */
:is(button, input[type="button"], input[type="submit"], input[type="reset"], input[type="image"], [role="button"], summary):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) {
  cursor: pointer;
}

:root { --gh-link-hover: #78451f; }

a[href] {
  transition: color 150ms ease-out, text-decoration-color 150ms ease-out;
}
a[href] img { transition: opacity 150ms ease-out; }
a[href]:hover {
  /* Legacy color utilities use !important, so the interactive tone must win. */
  color: var(--gh-link-hover) !important;
  text-decoration-line: underline;
  text-decoration-color: var(--gh-border);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
/* Image-only links need visible feedback as well as a text color change. */
a[href]:hover img { opacity: .96; }

/* Cards and hero routes respond through their title, without underlining
   the whole linked surface or washing out the illustration. */
:is(.article-card, .article-byline, .archive-hero, .gh-author-card__name) a[href]:hover,
a.card-container[href]:hover,
.home a.main-block__tile[href]:hover {
  text-decoration: none;
}
.home .main-block__tile:hover { background: transparent; }
.home .main-block__tile:hover .main-block__heading { text-decoration: none; }
.article-card :is(h2, h3) a:hover { text-decoration: none; }

/* Override the archived theme's orange inversion, including icon colors. */
:is(button, input[type="button"], input[type="submit"], input[type="reset"], .btn, .btn-lg, [role="button"]) {
  transition: color 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out;
}
:is(button, input[type="button"], input[type="submit"], input[type="reset"], .btn, .btn-lg, [role="button"]):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):is(:hover, :active) {
  color: var(--gh-link) !important;
  background-color: var(--gh-paper) !important;
  border-color: var(--gh-border) !important;
  box-shadow: none !important;
  text-decoration: none;
}
:is(button, .btn, .btn-lg, [role="button"]):is(:hover, :active) :is(.fa, span) { color: inherit !important; }

/* Keyboard focus remains explicit and separate from the quiet pointer state. */
body :is(a[href], button, input, summary, [role="button"]):focus-visible {
  outline: 3px solid var(--gh-link);
  outline-offset: 4px;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  a[href], a[href] img, .home .main-block__tile::before,
  :is(button, input, .btn, .btn-lg, [role="button"]) { transition: none; }
}
