/* Shared interaction finish. Pointer feedback never moves a label or draws a
   focus frame. Keyboard focus remains a distinct, high-contrast state. */
:where(a) {
  text-underline-offset: .24em;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: auto;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
:where(button, summary) {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
:where(a, button, summary):focus:not(:focus-visible) { outline: none; }
wa-button::part(button) {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
wa-button::part(button):focus:not(:focus-visible) { outline: none; }

/* An explicit icon hook keeps translated labels out of the rotation rule. */
.rail .nav-research > summary {
  gap: 12px;
  border-radius: 6px;
  transition: color 160ms ease, background-color 160ms ease;
}
.nav-disclosure-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  font: 18px/1 var(--display);
  transition: rotate 160ms ease, color 160ms ease;
}
.rail .nav-research > summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -3px;
}

/* Section links use colour and a baseline, rather than a surrounding box. */
.bridge-room .bridge-sections a:hover { box-shadow: none; }
:is(.actions, .event-actions, .reader-actions, .evidence-actions,
  .history-source-actions, .history-image-actions, .bridge-inline-links,
  .bridge-proof-links, .bridge-reference-links, .overview-reading-actions,
  .community-post-actions, .community-research-links) > a:not(.button) {
  text-decoration-line: underline;
  text-decoration-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .rail .nav-research > summary:hover {
    color: var(--text);
    background-color: #ffffff06;
  }
  .rail .nav-research > summary:hover .nav-disclosure-icon { color: var(--lime); }
  .site-header #researchNavigation .nav-item:not(.active):hover::part(button) {
    color: var(--text);
    background-color: #ffffff08;
    border-color: transparent;
    box-shadow: none;
  }
  .site-header #researchNavigation .nav-item:hover .nav-icon { opacity: 1; }
  .bridge-room .bridge-secondary-nav a:not([aria-current]):hover {
    color: var(--text);
    background-color: #ffffff06;
  }
  #main :is(.reading-view-nav, .community-collections, .account-tabs,
    .clue-collection-nav, .bridge-primary-nav) > :is(a, button):not([aria-current="page"]):not([aria-pressed="true"]):not(.active):hover {
    border-bottom-color: color-mix(in srgb, var(--lime) 45%, transparent);
    box-shadow: none;
  }
  #main .page-header + .ui-section-switch wa-button:not(.selected):hover::part(button) {
    border-bottom-color: color-mix(in srgb, var(--lime) 45%, transparent);
  }
  :is(.actions, .event-actions, .reader-actions, .evidence-actions,
    .history-source-actions, .history-image-actions, .bridge-inline-links,
    .bridge-proof-links, .bridge-reference-links, .overview-reading-actions,
    .community-post-actions, .community-research-links) > a:not(.button):hover {
    text-decoration-line: underline;
    text-decoration-color: currentColor;
  }
  :is(.oc-entry, .record-card, .company-research-card):hover {
    border-color: color-mix(in srgb, var(--lime) 28%, var(--line));
  }
  .company-research-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  :where(a, button, summary), .rail .nav-research > summary,
  .nav-disclosure-icon, wa-button::part(button) { transition: none; }
}
