/** @define Button */
/*! superfly-css-component-button | MIT License | https://github.com/superfly-css/superfly-css-component-button/blob/master/LICENSE.md */

:root {
  --Button-border-color: transparent;
  --Button-border-width: 1px;
  --Button-text-color: inherit;
  --Button-font: inherit;
  --Button-padding: 0.4em 0.75em;
  --Button_onDisabled-opacity: 0.6;
}

/**
 * The button classes are best applied to links and buttons.
 * These components can be used in forms, as calls to action, or as part of the
 * general UI of the site/app.
 */

/**
 * 0. No outline by default in order to provide full control over styling.
 * 1. Normalize `box-sizing` across all elements that this component could be
 *    applied to.
 * 2. Inherit text color from ancestor.
 * 3. Inherit font styles from ancestor.
 * 4. Prevent button text from being selectable.
 * 5. Turn off pointer events when button is disabled.
 * 6. Border style set to solid to prevent the it from
 *    being set to inset in chrome when active.
 */

.Button {
  display: inline-flex;
  outline: none;
  justify-content: space-around;
  align-items: center;
  background: transparent;
  border-color: var(--Button-border-color);
  border-style: solid;
  border-width: var(--Button-border-width);
  box-sizing: border-box; /* 1 */
  color: var(--Button-text-color); /* 2 */
  font: var(--Button-font); /* 3 */
  margin: 0;
  padding: var(--Button-padding);
  position: relative;
  text-align: center;
  text-decoration: none;
  user-select: none; /* 4 */
  cursor: pointer;
}

/**
 * Remove excess padding and border in Firefox 4+
 */
.Button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/**
 * UI states
 */
.Button:hover,
.Button:focus,
.Button:active {
  text-decoration: none;
  outline: none;
  border-style: solid;
}

.Button:disabled,
.Button.onDisabled {
  cursor: default;
  pointer-events: none; /* 5 */
  opacity: var(--Button_onDisabled-opacity);
}
