///
/// Atmosphere by Pixelarity
/// pixelarity.com | hello@pixelarity.com
/// License: pixelarity.com/license
///

/* Button */

	input[type="submit"],
	input[type="reset"],
	input[type="button"],
	button,
	.button {
		@include vendor('appearance', 'none');
		@include vendor('transition', 'background-color #{_duration(transition)} ease-in-out, color #{_duration(transition)} ease-in-out');
		border-radius: _size(border-radius);
		border: 0;
		cursor: pointer;
		display: inline-block;
		font-size: 0.8em;
		font-weight: _font(weight-bold);
		height: 3.5em;
		line-height: 3.5em;
		padding: 0 2.25em;
		text-align: center;
		text-decoration: none;
		text-transform: uppercase;
		white-space: nowrap;

		&.icon {
			padding-left: 1.35em;

			&:before {
				font-size: 0.95em;
				margin-right: 0.5em;
			}
		}

		&.fit {
			width: 100%;
		}

		&.small {
			font-size: 0.6em;
		}

		&.large {
			font-size: 0.95em;
		}

		&.disabled,
		&:disabled {
			@include vendor('pointer-events', 'none');
			opacity: 0.25;
		}

		@include breakpoint('<=xsmall') {
			padding: 0;
		}
	}

	@mixin color-button($p: null) {
		$highlight: _palette($p, highlight);

		input[type="submit"],
		input[type="reset"],
		input[type="button"],
		button,
		.button {
			background-color: transparent;
			box-shadow: inset 0 0 0 _size(border-width) _palette($p, border);
			color: _palette($p, fg-bold) !important;

			&:hover, &:focus {
				background-color: _palette($p, border-bg);
			}

			&:active {
				background-color: opacify(_palette($p, border-bg), 0.1);
			}

			&.icon {
				&:before {
					color: _palette($p, fg-light);
				}
			}

			&.primary {
				box-shadow: none;

				@if $p == $highlight {
					background-color: _palette($p, fg-bold);
					color: _palette($p, bg) !important;

					&.icon {
						&:before {
							color: _palette($p, bg) !important;
						}
					}
				}
				@else {
					background-color: _palette($highlight, bg);
					color: _palette($highlight, fg-bold) !important;

					&.icon {
						&:before {
							color: _palette($highlight, fg-bold) !important;
						}
					}

					&:hover, &:focus {
						background-color: lighten(_palette($highlight, bg), 5);
					}

					&:active {
						background-color: darken(_palette($highlight, bg), 5);
					}
				}
			}
		}
	}

	@include color-button;