/* Shared press and keyboard feedback for the public Vote in Five interface. */
@media (any-pointer: coarse) {
  :where(a[href], button, summary, select, input[type="button"], input[type="submit"],
    input[type="reset"], [role="button"], [role="link"], [role="tab"], [role="option"],
    #canadaMap [tabindex]) {
    -webkit-tap-highlight-color: transparent;
  }

  :where(a[href], button, summary, select, input[type="button"], input[type="submit"],
    input[type="reset"], [role="button"], [role="link"], [role="tab"], [role="option"]):not(svg *):not(:disabled):not([aria-disabled="true"]):active {
    opacity: .84;
  }

  #canadaMap :where([tabindex], [role="button"], [role="link"]):active {
    filter: brightness(.88);
  }
}

/* Results had a blanket outline reset; keep keyboard navigation visible. */
html :is(a[href], button, summary, select, input[type="button"], input[type="submit"], input[type="reset"], [role="button"], [role="link"], [role="tab"],
  [role="option"]):not(svg *):focus-visible {
  outline: 2px solid #784a32 !important;
  outline-offset: 3px;
}

#canadaMap :is(path, circle)[tabindex]:focus-visible {
  stroke: #784a32 !important;
  stroke-width: 2.5px !important;
  vector-effect: non-scaling-stroke;
}

#canadaMap :is(g, a)[tabindex]:focus-visible :is(rect, circle) {
  stroke: #784a32 !important;
  stroke-width: 2.5px !important;
}

@media (forced-colors: active) {
  html :is(a[href], button, summary, select, input[type="button"], input[type="submit"], input[type="reset"], [role="button"], [role="link"], [role="tab"],
    [role="option"]):not(svg *):focus-visible { outline-color: Highlight !important; }
  #canadaMap :is(path, circle)[tabindex]:focus-visible,
  #canadaMap :is(g, a)[tabindex]:focus-visible :is(rect, circle) { stroke: Highlight !important; }
}
