//////////////////////////////////////////
// BASE GRID STYLES
//////////////////////////////////////////
 
.grid { 
	margin: 0 auto; 
	width: 94%; 
	max-width: em($grid-width, $em-base);
	@include flex;
	@include flex-wrap(wrap);

	@include break($module-fold){
		width: percentage(280/320); 
		display: block;
	}

	&.grid-extend{
		max-width: rem($grid-extend);
	} 
}

@for $i from 1 through $grid-columns - 1 {
  
	.col-#{$i} { 
		width: percentage($i/$grid-columns); 
	}

	.offset-#{$i} { 
		margin-left: percentage($i/$grid-columns); 
	}
}

[class*='col-'] { 
	padding: 0 $grid-gutter; 
	min-height: 1px;
	
	@include break($module-fold) { 
		width: 100%; 
		margin: 0; 
		padding: 0; 
	}
}

.col-#{$grid-columns}{
	float: none;
	clear: both;
	width: 100%;
	@include clearfix;
}

[class*='offset-'] { 

	@include break($module-fold) { 
		margin-left: 0; 
	} 
}

.layout-full{

	@include break(tl){
		width: 100%;
		float: none;
		margin: 0;
	}
}

.layout-3-4{

	@include break(tl){
		width: percentage(3/4);
		float: none;
		margin: 0;
	}

	@include break(tp){
		width: 100%;
	}
}

//////////////////////////////////////////
// NESTED COLUMNS
//////////////////////////////////////////

.nest{
	margin: 0;
	margin-left: -$grid-gutter;
	margin-right: -$grid-gutter;
	@include flex;
	@include flex-wrap(wrap);

	@include break($module-fold){
		@include flex;
		@include flex-wrap(wrap);

		@for $i from 1 through $grid-columns - 1 {

			.col-#{$i} { 
				width: percentage($i/$grid-columns); 
				padding-left: $grid-gutter; 
				padding-right: $grid-gutter; 
			}
		}

		.layout-full{
			width: 100%;
			margin: 0;
			float: none;
		}
	}

	@include break($nest-fold){
		margin: 0;
		display: block;
	}

	[class*='col-']{

		form & { 
			margin-bottom: $line-height*0.75rem; 
		} 

		@include break($nest-fold){ 
			width: 100%; 
			margin: 0; 
			padding: 0; 
		}
	}

	.col-#{$grid-columns}{

		@include break($module-fold){
			padding: 0 $grid-gutter; 
		}

		@include break($nest-fold){
			padding: 0; 
		}
	}
}

//////////////////////////////////////////
// TAC0 EXAMPLE STYLES -- DO NOT USE
//////////////////////////////////////////

.tac0{

	.nest{

		[class*='col-']{
			margin: 0.75rem 0;

			span{
				height: 50px;
				line-height: 50px;
				display: block;
				background-color: #eee;
				text-align: center;
			}
		}
	}
}