// ============================================================================
//
// Extends Bootstrap classes to native WordPress elements
//
// ============================================================================

// Widgets ====================================================================

.widget {
	font-size: (@font-size-base - 1);
	margin-bottom: 2em;

	a {
		color: @gray-light;

		&:hover {
			color: @gray;
		}
	}
}

.widget-title:extend(h4) {
	margin-top: 0;
}

.widget > ul:extend(.list-unstyled) {}


.widget_categories,
.widget_archive,
.widget_nav_menu,
.widget_recent_entries {

	ul {
		padding: 0;

		li {
			list-style: none;

			a {
				display: block;
				font-size: @font-size-small;
				border: solid 1px @gray-lighter;
				padding: 1rem 2rem;
				margin-bottom: .5rem;

				&:hover {
					background: @gray-lighter;
					border-color: darken(@gray-lighter, 10%);
					text-decoration: none;
					color: @gray;
				}

				span {
					color: @gray-light;
				}
			}

		}

		// If using hierarchy setting
		.children,
		.sub-menu {
			padding-left: 2rem;
			border-left: 3px solid @gray-lighter;;

		}

		.children {
			display: none; /* hides child categories  */
		}
	}
}

.widget_nav_menu,
.widget_recent_entries {

	ul {

		li {

			a {
				border-width: 0 0 1px 0;
				padding: 1rem 3px;
				margin-bottom: 0;



				&:hover {
					background: none;
				}
			}

			&.current-menu-item a {
				font-weight: 700;
				color: @gray;
			}
		}
	}
}


/* calendar widget */
.widget_calendar {float: left;}
#wp-calendar {
	width: 100%;

	caption {
		text-align: right;
		color: #333;
		font-size: 12px;
		margin-top: 10px;
		margin-bottom: 15px;
	}

	thead {
		font-size: 10px;

		th {
			padding-bottom: 10px;
		}
	}

	tbody {
		color: #aaa;

		td {
			background: #f5f5f5;
			border: 1px solid #fff;
			text-align: center;
			padding:8px;

			&:hover {
				background: #fff;
			}
		}

		.pad {
			background: none;
		}
	}

	tfoot  {

		#next {
			font-size: 10px;
			text-transform: uppercase;
			text-align: right;
		}

		#prev {
			font-size: 10px;
			text-transform: uppercase;
			padding-top: 10px;
		}
	}
}


// Content ====================================================================

.masthead + #middle article:first-child > .entry-content .featurette:first-child:extend(.masthead + #middle > .featurette:first-child) {} // closes gap for first featurette and masthead
#middle article > .entry-content .featurette:last-child:extend(#middle > .featurette:last-child) {} // closes gap for last featurette and footer

a.more-link {
	display: inline-block;
	margin: (@line-height-computed / 2) 0;
}

.wp-caption {

	&:extend(.card);
	position: relative;
	margin-bottom: 1rem;
	max-width: 100%;
	padding: 0;
	border: 1px solid rgba(0,0,0,.15);
	background: #fff;
	border-radius: 0;
	width: auto !important;

	&:before {
		// we see this if not a link
		&:extend(.wp-caption a:after); // copying the style from below
	}

	a  {
		position: relative;
		display: block;
		width: 100%;
		height: 100%;

		// we see this if there is a link.
		&:after {
			content: ' ';
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 100%;
			background: none;
			#gradient > .vertical(@start-color: fade(#000, 0%); @end-color: fade(#000, 55%); @start-percent: 75%; @end-percent: 100%);
		}
	}

	img[class*="wp-image-"] {
		display: block;
		margin-top: 0; // 1rem;
		margin-bottom: 0;
	}

	.wp-caption-text {
		display: inline-block;
		color: #fff;
		position: absolute;
		bottom: 0px;
		margin: 0;
		padding: 1rem 2rem;
		font-size: @font-size-small;
		font-weight: bold;
		font-style: italic;
		text-shadow: @text-shadow;
		z-index: 1;
	}
}


// Forms ====================================================================

.ninja-forms-field-description {

	&:extend(.help-block);
}

.ninja-forms-required-items {

	&:extend(.help-block);
	margin: 1em 0;
	color: @brand-info;
}

.ninja-forms-field-error {

	&:extend(.help-block);
	color: @brand-danger;
}

.ninja-forms-error {

	&:extend(.has-error all);
	& input[type='text'],
	& input[type='email'],
	& input[type='password'],
	& textarea,
	& select {
		&:extend(.has-error .form-control);
	}
}

.ninja-forms-response-msg {

	&:extend(.help-block);
	color: @brand-warning;

	&.ninja-forms-error-msg {
		color: @brand-danger;
	}

	&.ninja-forms-success-msg {
		color: @brand-success;
	}
}