@import '../libs/vars';
@import '../libs/functions';
@import '../libs/mixins';

///
/// Retrospect by TEMPLATED
/// templated.co @templatedco
/// Released for free under the Creative Commons Attribution 3.0 license (templated.co/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: 2.5em;
		border: 0;
		cursor: pointer;
		display: inline-block;
		font-weight: _font(weight-bold);
		height: 2.85em;
		line-height: 2.95em;
		min-width: 10em;
		padding: 0 1.5em;
		text-align: center;
		text-decoration: none;
		text-transform: uppercase;
		white-space: nowrap;

		&.icon {
			padding-left: 1.35em;

			&:before {
				margin-right: 0.5em;
			}
		}

		&.fit {
			display: block;
			margin: 0 0 (_size(element-margin) * 0.5) 0;
			width: 100%;
		}

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

		&.big {
			font-size: 1.2em;
			height: 3.25em;
			line-height: 3.25em;
			padding: 0 2.5em;
		}

		&.disabled,
		&:disabled {
			cursor: default;
			opacity: 0.25;
		}

		@include breakpoint(medium) {
			&.big {
				font-size: 1em;
			}
		}

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


	@mixin color-button($p: null) {
		input[type="submit"],
		input[type="reset"],
		input[type="button"],
		button,
		.button {
			background-color: _palette($p, fg-bold);
			box-shadow: none;
			color: _palette($p, bg) !important;

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

			&:hover {
				background-color: lighten(_palette($p, fg-bold), 5);
			}

			&:active {
				background-color: darken(_palette($p, fg-bold), 5);
			}

			&.special {
				background-color: _palette($p, highlight);
				box-shadow: none;
				color: #fff !important;

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

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

			&.alt {
				background-color: transparent;
				box-shadow: inset 0 0 0 (_size(border-width) * 2) _palette($p, highlight-alt);
				color: _palette($p, highlight-alt) !important;

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

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

	@include color-button;