/*
	jQuery Touch Optimized Sliders "R"Us
	Core CSS
*/


@import 'variables';


.tos-noanimation
{
	transition-property: none !important;
}
.tos-fastanimation
{
	transition-duration: ( $transitionDuration / 2 ) !important;
	transition-timing-function: ease-out !important;
}

//	Wrapper
.tos-wrapper
{
	opacity: 0;
	transition: opacity $transitionDuration $transitionFunction;

	display: none;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	overflow: hidden;

	&.tos-opened
	{
		display: block;
	}
	&.tos-opening
	{
		opacity: 1;
	}

	&.tos-fixed
	{
		background-color: rgb( 0, 0, 0 );
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9000;
	}
	&.tos-inline
	{
		position: relative;
	}
}

//	Slider
.tos-slider
{
	white-space: nowrap;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	position: relative;
}
.tos-wrapper.tos-fx-slide
{
	.tos-slider
	{
		left: 0;
		transition: left $transitionDuration $transitionFunction;
	}
	&.tos-fixed .tos-slider
	{
		position: absolute;
	}
}
.tos-wrapper.tos-fx-fade .tos-slider
{
	opacity: 1;
	transition: opacity $transitionDuration $transitionFunction;
}


//	UI elements
.tos-uibg
{
	opacity: 0;
	transition: opacity $transitionDuration $transitionFunction;
	
	width: 100%;
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 1;
}
.tos-fill .tos-uibg
{
	background: linear-gradient( to top, rgba( $uiBgColor, $uiBgOpacity ), rgba( $uiBgColor, 0 ) );
}
.tos-desktop .tos-wrapper:hover,
.tos-touch .tos-wrapper.tos-hover
{
	.tos-uibg
	{
		opacity: 1;
	}
}


//	Slides
.tos-slide
{
	-webkit-overflow-scrolling: touch;

	line-height: 1px;
	text-align: center;
	box-sizing: border-box;

	display: inline-block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	position: relative;

	&:before
	{
		content: "";
		display: inline-block;
		height: 50%;
		width: 1px;
		margin-right: -1px;
	}
	
	&.tos-loading > *
	{
		opacity: 0;
	}
	
	> *
	{
		opacity: 1;
		transition: opacity $transitionDuration $transitionFunction;
	}
}


//	Content
.tos-slide
{
	 > *
	{
		vertical-align: middle;
		display: inline-block;
		max-height: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}
	&.tos-html > div
	{
		-webkit-overflow-scrolling: touch;

		white-space: normal;
		text-align: left;
		line-height: 1.5;

		*
		{
			text-size-adjust: none;
		}
	}
}
.tos-wrapper
{
	&.tos-fill .tos-slide.tos-image > img
	{
		max-height: none;
		max-width: none;
		min-height: 100%;
		min-width: 100%;
	}
	&.tos-fixed
	{
		.tos-slide.tos-html > div
		{
			background-color: $htmlBgColor;
			color: $htmlTextColor;

			box-sizing: border-box;
			display: inline-block;
			padding: $uiPadding * 2;
			overflow: auto;
		}
	}
}
.tos-desktop .tos-wrapper.tos-fixed
{
	background-color: rgba( 0, 0, 0, 0.85 );
	
	&.tos-fit .tos-slide
	{
		padding: $uiPadding;
	}
}