// Rem output with px fallback
@mixin font-size($sizeValue: 1) {
	font-size: ($sizeValue * 16) * 1px;
	font-size: $sizeValue * 1rem;
}

// Box shadow
@mixin box-shadow {
	box-shadow: $box__shadow_mobile;

	@include media-breakpoint-up(lg) {
		box-shadow: $box__shadow;
	}
}

// Center block
@mixin center-block {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

// Clearfix
@mixin clearfix {
	content: "";
	display: table;
	table-layout: fixed;
}

// Clear after (not all clearfix need this also)
@mixin clearfix-after {
	clear: both;
}

@mixin reset-container {
	max-width: inherit;
	padding-left: 0;
	padding-right: 0;
}

@mixin reset-list {
	padding: 0;
	margin: 0;
	list-style: none;
}

@mixin font-awesome-icon {
	@extend %font-awesome-icon;
}

%font-awesome-icon {
	display: inline-block;
	font: normal normal normal 14px/1 FontAwesome;
	font-size: inherit;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale
}

@mixin btn {
	line-height: 1;
	display: inline-block;
	max-width: 100%;
	padding: $button__indents;
	cursor: pointer;
	text-align: center;
	overflow: hidden;
	vertical-align: top;
	white-space: nowrap;
	text-overflow: ellipsis;
	border: $button__border;
	box-shadow: $button__box-shadow;
	transition: .3s;
	text-transform: uppercase;
	@include font-size(.75);
	font-weight: 600;
	letter-spacing: 0.72px;
	@include border-radius();
}

@mixin material-icon {
	@extend %material-icon;
}

%material-icon {
	font-family: 'Material Icons';
	font-weight: normal;
	font-style: normal;
	display: inline-block;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	word-wrap: normal;
	white-space: nowrap;
	direction: ltr;

	/* Support for all WebKit browsers. */
	-webkit-font-smoothing: antialiased;
	/* Support for Safari and Chrome. */
	text-rendering: optimizeLegibility;

	/* Support for Firefox. */
	-moz-osx-font-smoothing: grayscale;

	/* Support for IE. */
	font-feature-settings: 'liga';
}

@mixin linear-icon {
	@extend %linear-icon;
}

%linear-icon {
	font-family: 'Linearicon';
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;

	/* Enable Ligatures */
	-webkit-font-feature-settings: "liga";
	-moz-font-feature-settings: "liga=1";
	-moz-font-feature-settings: "liga";
	-ms-font-feature-settings: "liga" 1;
	-o-font-feature-settings: "liga";
	font-feature-settings: "liga";

	/* Better Font Rendering */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

// Optional hyphenation
@mixin hyphens($mode: auto) {
	word-wrap: break-word;
	-webkit-hyphens: $mode;
	-moz-hyphens: $mode;
	-ms-hyphens: $mode; // IE10+
	-o-hyphens: $mode;
	hyphens: $mode;
}

@mixin word-wrap {
	overflow-wrap: break-word;
	word-wrap: break-word;
	-ms-word-break: break-all;
	word-break: break-all;
}

// .hentry, .widget
@mixin card {
	@include border-radius;
}

// Resize anything
@mixin resizable($direction) {
	resize: $direction; // Options: horizontal, vertical, both
	overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible`
}

// tiles class
@mixin tiles( $class_name, $property, $ratio: 1, $breakpoints: $grid-breakpoints, $gutter: $grid-gutter-width, $columns: $grid-columns ) {
	.#{$class_name}{
		@each $breakpoint, $size in $breakpoints{
			@if $breakpoint!='xs' and $breakpoint!='sm' {
				@include media-breakpoint-up( $breakpoint ) {
					@if $property=='width' {
						width: percentage($ratio/$columns);
					} @else {
						$padding:($size - map-get($container-max-widths, $breakpoint))/2;
						#{$property}: #{($size - $padding)/$columns*$ratio};
					}
				}
			} @else {
				@include media-breakpoint-up( $breakpoint ) {
					@if $property=='width' {
						#{$property}: 100%;
					} @else {
						#{$property}: 300px;
					}
				}
			}
		}
	}
}



// Triangle
@mixin triangle($dir, $w, $h, $clr) {
	width: 0;
	height: 0;
	border-style: solid;

	@if $dir == top {
		border-width: 0 $w/2 $h $w/2;
		border-color: transparent transparent $clr transparent;
	} @else if $dir == bottom {
		border-width: $h $w/2 0 $w/2;
		border-color: $clr transparent transparent transparent;
	} @else if $dir == left {
		border-width: $h/2 $w $h/2 0;
		border-color: transparent $clr transparent transparent;
	} @else if $dir == right {
		border-width: $h/2 0 $h/2 $w;
		border-color: transparent transparent transparent $clr;
	} @else if $dir == top_left {
		border-width: $w $w 0 0;
		border-color: $clr transparent transparent transparent;
	} @else if $dir == top_right {
		border-width: 0 $w $w 0;
		border-color: transparent $clr transparent transparent;
	} @else if $dir == bottom_right {
		border-width: 0 0 $w $w;
		border-color: transparent transparent $clr transparent;
	} @else if $dir == bottom_left {
		border-width: $w 0 0 $w;
		border-color: transparent transparent transparent $clr;
	}
}


// Opacity
@mixin opacity($opacity) {
	opacity: $opacity;
	// IE8 filter
	$opacity-ie: ($opacity * 100);
	filter: #{alpha(opacity=$opacity-ie)};
}


// Widgets area selectors
@mixin contents-area( $parent-symbol:true ) {
	@if $parent-symbol {
		.before-content-area &,
		.after-content-area &,
		.footer-area--fullwidth &,
		.tm_pb_column_4_4 & {
			@content;
		}
	} @else {
		.before-content-area,
		.after-content-area,
		.footer-area--fullwidth,
		.tm_pb_column_4_4 {
			@content;
		}
	}
}

@mixin loop-area( $parent-symbol:true ) {
	@if $parent-symbol {
		.before-loop-area &,
		.after-loop-area &,
		.tm_pb_column_2_3 &,
		.tm_pb_column_3_4 &,
		.tm_pb_column_1_2 & {
			@content;
		}
	} @else {
		.before-loop-area,
		.after-loop-area,
		.tm_pb_column_2_3,
		.tm_pb_column_3_4,
		.tm_pb_column_1_2 {
			@content;
		}
	}
}

@mixin sidebars-area( $parent-symbol:true ) {
	@if $parent-symbol {
		.sidebar &,
		.tm_pb_column_1_4 &,
		.tm_pb_column_1_3 &,
		.footer-area:not(.footer-area--fullwidth) & {
			@content;
		}
	} @else {
		.sidebar,
		.tm_pb_column_1_4,
		.tm_pb_column_1_3,
		.footer-area:not(.footer-area--fullwidth) {
			@content;
		}
	}
}

/* 3d mixins */
@mixin preserve-3d(){
	transform-style: preserve-3d;
	-webkit-transform-style: preserve-3d;
	-moz-transform-style: preserve-3d;
	-o-transform-style: preserve-3d;
}

@mixin backface(){
	backface-visibility:hidden;
	-webkit-backface-visibility:hidden;
	-moz-backface-visibility:hidden;
	-ms-backface-visibility:hidden;
}
/* end 3d mixins */

// Transformations
@mixin scale($ratio...) {
	-webkit-transform: scale($ratio);
	-ms-transform: scale($ratio); // IE9 only
	-o-transform: scale($ratio);
	transform: scale($ratio);
}

@mixin scaleX($ratio) {
	-webkit-transform: scaleX($ratio);
	-ms-transform: scaleX($ratio); // IE9 only
	-o-transform: scaleX($ratio);
	transform: scaleX($ratio);
}
@mixin scaleY($ratio) {
	-webkit-transform: scaleY($ratio);
	-ms-transform: scaleY($ratio); // IE9 only
	-o-transform: scaleY($ratio);
	transform: scaleY($ratio);
}
@mixin skew($x, $y) {
	-webkit-transform: skewX($x) skewY($y);
	-ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
	-o-transform: skewX($x) skewY($y);
	transform: skewX($x) skewY($y);
}
@mixin translate($x, $y) {
	-webkit-transform: translate($x, $y);
	-ms-transform: translate($x, $y); // IE9 only
	-o-transform: translate($x, $y);
	transform: translate($x, $y);
}

@mixin multiTranslate($arg) {
	-webkit-transform: $arg;
	-ms-transform: $arg; // IE9 only
	-o-transform: $arg;
	transform: $arg;
}

@mixin translate3d($x, $y, $z) {
	-webkit-transform: translate3d($x, $y, $z);
	transform: translate3d($x, $y, $z);
}
@mixin rotate($degrees) {
	-webkit-transform: rotate($degrees);
	-ms-transform: rotate($degrees); // IE9 only
	-o-transform: rotate($degrees);
	transform: rotate($degrees);
}
@mixin rotateX($degrees) {
	-webkit-transform: rotateX($degrees);
	-ms-transform: rotateX($degrees); // IE9 only
	-o-transform: rotateX($degrees);
	transform: rotateX($degrees);
}
@mixin rotateY($degrees) {
	-webkit-transform: rotateY($degrees);
	-ms-transform: rotateY($degrees); // IE9 only
	-o-transform: rotateY($degrees);
	transform: rotateY($degrees);
}
@mixin perspective($perspective) {
	-webkit-perspective: $perspective;
	-moz-perspective: $perspective;
	perspective: $perspective;
}
@mixin perspective-origin($perspective) {
	-webkit-perspective-origin: $perspective;
	-moz-perspective-origin: $perspective;
	perspective-origin: $perspective;
}
@mixin transform-origin($origin) {
	-webkit-transform-origin: $origin;
	-moz-transform-origin: $origin;
	-ms-transform-origin: $origin; // IE9 only
	transform-origin: $origin;
}


// Transitions
@mixin transition($transition...) {
	-webkit-transition: $transition;
	-o-transition: $transition;
	transition: $transition;
}
@mixin transition-property($transition-property...) {
	-webkit-transition-property: $transition-property;
	transition-property: $transition-property;
}
@mixin transition-delay($transition-delay) {
	-webkit-transition-delay: $transition-delay;
	transition-delay: $transition-delay;
}
@mixin transition-duration($transition-duration...) {
	-webkit-transition-duration: $transition-duration;
	transition-duration: $transition-duration;
}
@mixin transition-timing-function($timing-function) {
	-webkit-transition-timing-function: $timing-function;
	transition-timing-function: $timing-function;
}
@mixin transition-transform($transition...) {
	-webkit-transition: -webkit-transform $transition;
	-moz-transition: -moz-transform $transition;
	-o-transition: -o-transform $transition;
	transition: transform $transition;
}

// Opacity

@mixin opacity($opacity) {
	opacity: $opacity;
	// IE8 filter
	$opacity-ie: ($opacity * 100);
	filter: #{alpha(opacity=$opacity-ie)};
}



// Custom grid indent
@mixin grid-indent( $indent: $grid-gutter-width/2, $child-indent-type: 'padding', $child-selector: '> *' ) {
	margin-left: - $indent;
	margin-right: - $indent;

	@if $child-indent-type=='padding' or $child-indent-type=='margin' {
		#{$child-selector} {
			#{$child-indent-type}-left: $indent;
			#{$child-indent-type}-right: $indent;
		}
	} @else {
		#{$child-selector} {
			padding-left: $indent;
			padding-right: $indent;
		}
	}
}

@import "transform";
@import "border-radius";
@import "flex";
