/* Grammar Captive Template */
/* Credit:  This page is an adaption of the three-column responsive design posted at http://codepen.io/Cheesetoast/pen/KFAaq */

@import url(https://fonts.googleapis.com/css?family=Open+Sans);
/* @charset "UTF-8"; */

body { 
  font-family: 'Open Sans', sans-serif;
  color: #666;
}

/************************************************************************************
STRUCTURE
*************************************************************************************/

#pagewrap {
	padding: 5px;
	width: 980px;
	margin: 20px auto;
}
header {
	height: 100px;
	padding: 0 15px;
}

header h1 {
	font-size: 3em;
}

#content {
	width: 200px;
	float: left;
	padding: 5px 15px;
}

#middle {
	width: 513px; /* Account for margins + border values. Originally 504px */
	float: left;
	padding: 5px 15px;
	margin: 0px 5px;
}

#sidebar {
	width: 160px;
	padding: 5px 15px;
	float: left;
}

footer {
	clear: both;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 5px 15px;
}

.footer_item_right {
	text-align: right;
	text-align: -moz-right;
	text-align: -webkit-right;
}

/************************************************************************************
MEDIA QUERIES
*************************************************************************************/
/* for 980px or less */
@media screen and (max-width: 980px) {
	
	#pagewrap {
		width: 750px;
		padding: 5px;
	}
	#content {
		width: 200px;
		padding: 5px 15px;
		float:left;
	}
	#middle {
		padding: 5px 15px;
		margin-left: 5px;
		margin-right: 0px;
		width: 480px;
		float: right;
	}
	
	#sidebar {
		clear: both;
		padding: 5px 15px;
		width: auto;
		float: none;
	}

	header, footer {
		padding: 5px 15px;
	}
}

/* for 700px or less.  Note: It was previously set to 600px. */
@media screen and (max-width: 700px) {

	#pagewrap {
		width: auto;
		padding: 5px;
	}

	#content {
		width: auto;
		float: none;
	}
	
	#middle {
		width: auto;
		width: -moz-auto;
		margin-left: 0px;
		float: none;
	}

	#sidebar {
		width: auto;
		width: -moz-auto;
		float: none;
	}
}

/* for 480px or less */
@media screen and (max-width: 480px) {

	header {
		height: auto;
	}
	
	header h1 {
		font-size: 2.0em;
	}
	
	#middle {
		width: auto;
		float: none;
	}
	
	#sidebar {
		width: auto;
	}

	footer {
		clear: both;
		display: -webkit-flex;
		display: flex;
		-webkit-flex-direction: column;
		flex-direction: column;
		padding: 5px 15px;
	}

	.footer_item_right {
		text-align: left;
		text-align: -moz-left;
		text-align: -webkit-left;
	}		
}

/************************************************************************************
STYLE FORMATTING
*************************************************************************************/
header {
	background: #999999;
	color: #ffffff;
}

#content {
	background: #5a4149;
	color: #fff;
}

#sidebar {
	background: #f0efef;
}

header, #content, #middle, #sidebar {
	margin-bottom: 5px;
}

#pagewrap, header, #content, #middle, #sidebar, footer {
	border: solid 1px #ccc;
}

footer {
	background: #5a4149;
	color: #ffffff;
	font-size: 0.8em;
}

/************************************************************************************
LINKAGE
*************************************************************************************/

#content a:link {color:#fff; text-decoration: none;}
#content a:visited {color:#fadb9d;}
#content a:hover {font-weight: 800;text-decoration: none;color:#fff;}
#content a:active {color:#5a4149;}

footer a:link {color:#fff; text-decoration: none;}
footer a:visited {color:#fadb9d;}
footer a:hover {font-weight: 800;text-decoration: none;color:#fff;}
footer a:active {color:#5a4149;}


