//
// Layout
// --------------------------------------------------

// General
// -------------------------

.innerLR { padding: 0 @spacing; position: relative; }
.innerTB { padding: @spacing 0; position: relative; }
.innerAll { padding: @spacing; position: relative; }
.innerL { padding-left: @spacing; position: relative; }
.innerR { padding-right: @spacing; position: relative; }
.innerT { padding-top: @spacing; position: relative; }
.innerB { padding-bottom: @spacing; position: relative; }

// Other Utilities
// -------------------------

.center { text-align: center !important; }
.margin-bottom-none { margin-bottom: 0 !important; }
.margin-none { margin: 0 !important; }
.padding-none { padding: 0 !important; }
.border-none { border: none !important; }
.box-shadow-none { #reset .boxShadow(); }
.padding-none-TB { padding-bottom: 0 !important; padding-top: 0 !important; }
.relativeWrap { position: relative; }
.text-primary { color: @primaryColor; }
.text-uppercase { text-transform: uppercase; }
.text-faded { color: #d7d7d7 !important; }
.text-large { font-size: 35px; line-height: 40px; }
.text-xlarge { font-size: 50px; line-height: 50px; }
.text-xxlarge { font-size: 70px; line-height: 70px; }
.text-underline { text-decoration: underline; }
.text-right { text-align: right !important; }
.containerBg { background: @containerBg; }
.whiteBg { background: #fff; }

// Grid
// -------------------------

.row-merge {
	position: relative;
	> [class*="span"] ~ [class*="span"] {
		margin-left: 0;
		&:after { position: absolute; top: 0; bottom: 0; width: 1px; background: @contentBorder; content: ""; }
	}
	> [class*="span"] ~ [class*="span3"] { width: 25.26315789473684%; }
	> [class*="span"] ~ [class*="span4"] { width: 33.68421052631579%; }
	> [class*="span"] ~ [class*="span5"] { width: 42.10526315789473%; }
	> [class*="span"] ~ [class*="span6"] { width: 50.74626865671642%; }
	> [class*="span"] ~ [class*="span8"] { width: 67.66169154228855%; }
	> [class*="span"] ~ [class*="span9"] { width: 75.78947368421052%; }
	&.border-top, & ~ & { border-top: 1px solid @contentBorder; }
	&.border-bottom { border-bottom: 1px solid @contentBorder; }
}

// Main Wrapper
// -------------------------

#wrapper {
	overflow: hidden; 
	overflow-y: auto;
	float: left;
	width: 100%;
}

// Content
// -------------------------

body > .container-fluid { 
	padding: 0;
	background: @containerBg;
	&.fixed { 
		margin: 30px auto 30px;
		border-left: 1px solid @containerBorder;
		border-right: 1px solid @containerBorder;
		width: 94%;
	}
	&.documentation {
		background: #fff;
	}
}

body > .container-fluid.fixed { 
	.rounded(5px, 5px, 5px, 5px);
	#wrapper { .rounded(5px, 5px, 0, 0); }
	#content { .rounded(0, 5px, 0, 0); }
	#footer { .rounded(0,0,5px,5px); }
	.navbar.main, .navbar.main .wrapper { .rounded(5px, 5px, 0, 0); }
}

#content { 
	position: relative;
	overflow: hidden;
	margin: 0;
	min-width: 320px;
	min-height: 500px;
	padding: 0 0 @spacing;
	background: @containerBg;
	> .menubar { border-left: none; border-right: none; }
	> p { padding: 0 @spacing 5px; }
	> h1, > h2, > h3, > h4, > h5, > h6 { margin: @spacing+3 @spacing @spacing; }
	> .filter-bar {
		border-right: none;
		border-left: none;
	}
	.heading-buttons { margin-top: @spacing; }
	.heading-arrow {
		text-transform: uppercase;
		border-bottom: 1px solid @contentBorder;
		margin: 0 0 @spacing;
		padding: 0 @spacing;
		font-size: 11pt;
		height: 35px;
		line-height: 30px;
		position: relative;
		&:after {
			content: "";
			display: inline-block;
			width: 0;
			height: 0;
			border-bottom: 8px solid @contentBorder;
			border-right: 8px solid transparent;
			border-left: 8px solid transparent;
			position: absolute;
			bottom: 0;
			left: 15px;
		}
		&.glyphicons { padding: 0 10px 0 40px; i:before { font-size: 17px; left: 15px; } }
		&.margin-bottom-none { margin-bottom: 0; }
	}
	
	> .widget { 
		border-left: 0; 
		border-right: 0;
		.widget-head,
		.widget-body {
			border-left: 0; 
			border-right: 0;
		}
		&:last-child { margin: 0; }
	}
	
	> .table { 
		border-left: none; border-right: none;
		tr td:first-child { border-left: none; }
	}
}

// Footer
// -------------------------
 
#footer {
	font-weight: 600;
	position: relative;
	overflow: hidden;
	z-index: 10000;
	a:not(.btn) { color: @bodyText; }
	border-bottom: 1px solid @contentBorder;
	border-top: 1px solid @contentBorder;
	.copy {
		background: @widgetBgGray;
		text-align: center;
		padding: 5px 10px;
		font-size: 12px;
		a { color: @bodyText; text-decoration: underline; }
		height: 20px;
	}
}

html.sidebar {
	#content { margin: 0 0 0 65px; }
	.menu-right { 
		#content { margin: 0 65px 0 0; } 
	}
}

// Sticky Sidebar & Footer always bottom
// -------------------------
@media (min-width: 768px)
{
	html.sticky-sidebar.sidebar:not(.fixed) {
		body { overflow: hidden; }
		&, body, 
		body > .container-fluid,
		#wrapper {
			min-height: 100%;
			height: 100%; 
		}
		#wrapper { margin-bottom: -32px; }
		#menu { 
			position: fixed;
			bottom: 0;
		}
		#content { padding-bottom: 47px; }
	}
}

// Sticky Top Menu
// -------------------------

@media (min-width: 768px)
{
	html.sticky-top:not(.fixed) {
		#content { padding-top: 50px; }
		.navbar.main {
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			z-index: 10000;
		}
		&.sidebar {
			.navbar.main { left: 65px; }
			.menu-right {
				.navbar.main { left: 0; right: 65px; }
			}
		}
		.menu-hidden {
			.navbar.main { left: 0 !important; right: 0 !important; }
		}
		&.front {
			#content { padding-top: 100px; margin: 0 !important; }
		}
	}
}

html.fixed {
	&, body {
		min-height: auto; 
		height: auto;
		overflow: visible;
	}
}
body > .container-fluid.fixed {
	min-height: auto;
	height: auto;
	#wrapper {
		position: relative;
		overflow: hidden;
		min-height: auto;
		height: auto;
		margin: 0;
	}
	#menu {
		position: absolute;
		height: 100%;
		min-height: 100%;
		bottom: auto;
	}
}