/* modified from http://philipwalton.github.io/solved-by-flexbox/
which did not work out of the box */
/* Basic grid Styles */

/*
Flex container
    The parent element in which flex items are contained. A flex container is defined using the flex or inline-flex values of the display property. 
*/
.grid {
	/* designate a flex container */
	display: -webkit-flex;
	display: flex;
	/* establishes the main axis */
	-webkit-flex-direction: row;
	flex-direction: row;
}
/*
Flex item
    Each child of a flex container becomes a flex item. Text directly contained in a flex container is wrapped in an anonymous flex item.
*/
#main-grid > article {
	/* The flex property shorthands the flex-basis, flex-grow, and flex-shrink properties to establish the flexibility of the flex items. 
	flex-basis property specifies the flex basis which is the initial main size of a flex item. (unit length)
	flex-grow property specifies the flex grow factor of a flex item. (number)
	flex-shrink property specifies the flex shrink factor of a flex item. (number)
	*/
	-webkit-flex: 60% 1 1;
	flex: 60% 1 1;
	-webkit-order: 1;
	order: 1;
}

#main-grid > aside {
	-webkit-flex: 40% 1 1;
	flex: 40% 1 1;
	-webkit-order: 2;
	order: 2;
}
/*
The CSS -moz-box-flex and -webkit-box-flex properties specify how a -moz-box or -webkit-box grows to fill the box that contains it, in the direction of the containing box's layout.

Applies to: elements that are direct children of an element with a CSS display value of -moz-box or -moz-inline-box or -webkit-box or -webkit-inline-box

*/
.grid-cell {
	-webkit-box-flex:1;
	-webkit-flex:1;
	-moz-box-flex:1;
	-ms-flex:1;
	flex:1;
}

/* adds margins to direct cell children */
.grid--gutters > .grid-cell {
	margin-left: 1em;
	margin-right: 1em;
}

/* Here are the direct children that .grid-cell's -moz-box-flex/-webkit-box-flex properties affect. 
Both article and aside are given .grid-cell class.
Aside has children with grid--flexCells class */
.grid--flexCells > .grid-cell{
	display:-webkit-box;
	display:-webkit-flex;
	display:-moz-box;
	display:-ms-flexbox;
	display:flex;/* designates a flex container */
}

.inner { 
	padding: 0 2%;
	width:96%;
}
/* extra default crap that probably should not be here */
span.required { color:#c00; }
label { display:block; }
aside .inner { margin-bottom:1em; }
#google-ad { padding-top:30px; }
#soy-knee img { display:block;margin:0 auto; }
.extra.last { padding:10px; }
.de-emphasized { font-size:xx-small; }
.flexslider ul, .flexslider li, #main .flexslider ul, #main .flexslider li { margin:0;padding:0;list-style:none;background-image:none; }
.flexslider img { display:block; }
.flexslider br { display:none; }
.flex-caption { display:block;background:#292929; color:#f1f1f1; padding:3px; }
#main .flex-control-paging ol { margin:0;padding:0; }
#main .flex-control-paging li { margin:0 3px; }
/* end extra default crap that probably should not be here */

.clearfix:before,
.clearfix:after {
    content: "";
    display: table;
} 
.clearfix:after {
    clear: both;
}
.clearfix {
    zoom: 1; /* For IE 6/7 (trigger hasLayout) */
}


#main .websites ul.flex-table {
    list-style: none;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-content: space-between;
    align-content: space-between;
}
#main .websites ul.flex-table li {
    list-style: none;
    width: 150px;
}
#main .websites ul.flex-table li .flex-caption {
    color: black;
    background: white;
}

/* medium screens */
@media all and (max-width: 60em) {
	#main-grid > article, #main-grid > aside {
	-webkit-flex: 1 1 50%;
	  flex: 1 1 50%;
	}

}
/* Small to medium screens */
@media all and (max-width: 42em) {
	#main-grid {
		-webkit-flex-direction: column;
		flex-direction: column;
		display:block;
	   }

	#main-grid  > article, #main-grid  > aside {
		/* Return them to document order */
		-webkit-order: 0;
				order: 0;
   }
   
	#main-grid  > aside { margin-top: 1em; }
	#soy-knee img { margin:0; }
}


/* Small screens */
@media all and (max-width: 22em) {
	#main-grid, #main-grid  > article, #main-grid  > aside {
		-webkit-flex-direction: column;
		flex-direction: column;
		display:block;
	}
    #main-grid  > aside { margin-top: 1em; }
	.grid {
		-webkit-flex-direction: column;
		flex-direction: column;
	}
	.grid > .grid-cell {
		/* Return them to document order */
		-webkit-order: 0;
				order: 0;
	}
	#soy-knee img { margin:0; }
}