/**
 * 
 * 08. Widgets styles
 * 
 */


/** 08.01 Global widget styles **/
.widget {
	margin-bottom: 4em;
	position: relative;
	
	select {
		width: 100%;
	}
	form label {
		width: 100%;
	}

	a {
		@include color-link-inv();

		.dark & {
			@include color-link-dark();
		}
	}

	ul, ol {
		@extend %simple-transition;
		padding: 0;

		li {
			@extend %text-theme;
			@extend %simple-transition;
			list-style: none;
			font-size: 12px;
			padding: 0;
			line-height: 1.9em;
			word-wrap: break-word;

			a {
				padding: 0;
			}

			ul {
				display: block;

				&.sub-menu li, 
				&.children li {
					padding-left: 20px;
				}

			}

			span.count {
				color: $color-light-gray;

				.dark & {
					color: $color-dark-gray;
				}
			}

			&:last-child {
				padding-bottom: 0;
			}
		}

		&.nav li {
			> * {
				display: inline;
				width: 100%; //auto-expanded gets a inline-block display
			}

			> .sub-menu {
				display: block;
			}
		}

		&.media-list li {
			margin-bottom: 1em;
		}

		li {
			&.current-cat {
				> a {
					position: relative;
				}

				> a:after {
					content: "";
					position: absolute;
					bottom: -2px;
					left: 0;
					width: 100%;
					height: 2px;
					background-color: $color-primary; /* redux[background-color: main_theme_color] */
				}
			}

			&:last-child {
				margin-bottom: 0;
				padding-bottom: 0;
			}
		}

		&.sub-menu,
		&.children { // reset dropdown styling
			padding: 0;
			visibility: visible;
			opacity: 1;
			max-width: initial;
			float: none;
			top: auto;
			background-color: transparent;
			box-shadow: none;
			position: relative;

			li {
				@extend %text-theme;
				padding-left: 18px;  
				border: 0;
				@include sub_li_ladder(lighten($color-light-gray, 20%), 2px, 7px);
			}
		}
	}

	input[type="submit"], 
	input[type="button"], 
	button[type="submit"],
	a.button, 
	button.button, 
	a.btn-primary {
		@include button-small();
	}

	&:last-child {
		margin-bottom: 0;
	}
}

// Hide submit buttons
.widget_search .search-form .wrap-submit,
.widget_search .search-form input[type="submit"],
.widget_product_search .woocommerce-product-search input[type="submit"],
.widget_product_search .woocommerce-product-search button[type="submit"] {
	display: none;
}


/** 08.02 Widget titles **/
.widget-title,
.widgettitle {
	@extend %uppercase;
	font-size: 16px;
	font-weight: 700;
	position: relative;
	margin: 0 0 1.5em 0;
	padding: 0 0 2em 0;
	box-sizing: border-box;

	&:after {
		content: '';
		display: block;
		position: absolute;
		bottom: 0;
		left: 0;
		width: 40px; height: 2px;
		background-color: $color-darker-gray;

		.dark & {
			background-color: rgba(255, 255, 255, 0.2);
		}
	}
}


/** 08.03 Horizontal menu in widget **/
.horizontal-menu .widget {
	.nav > li {
		display: inline-block;
		position: static;
		margin-right: 1.5em;
		padding: 0;
		
		&.menu-item-has-children {
			@include transition(padding 0.3s ease-in-out);
			
			&.submenu-open {
				padding-bottom: 2.5em;	
			}
		}

		ul {
			display: block;
		}
		
		&:last-child {
			margin-right: 0;
		}

		.sub-menu {
			position: absolute;
			width: 100%;
			left: 0;
			z-index: 10;
		}

		// hide ladder stuff
		&:before,
		&:after {
			display: none;
		}
	}
}


/** 08.04 Widgets **/
/*  08.04.1 Tag Cloud */
.widget .tagcloud {
	overflow: hidden;
	
	> a {
		@extend %uppercase;
		@extend %text-theme;
		font-size: 90%;
		line-height: 1.5em;
		background-color: $color-darker-gray;
		color: #fff;
		padding: 2px 5px;
		margin: 0 4px 4px 0;
		display: block;
		float: left;

		.tag-count {
			opacity: 0.7;
			margin-left: 2px;
		}

		&.current-tag {
			background-color: $color-primary; /* redux[background-color: main_theme_color] */

			&:hover {
				color: #fff;
			}
		}
	}
}

/*  08.04.2 Calendar */
.widget_calendar {
	.table {
		@extend %text-theme;

		> thead > tr > th {
			border-bottom-width: 2px;
		}

		td {
			color: $color-light-gray;
		}
	}
}

/*  08.04.3 Categories & Archive */
.widget_categories,
.widget_archive {
	ul li {
		color: $color-light-gray; //for counter text, a has diff color

		.dark & {
			color: $color-dark-gray;
		}
	} 
}

.widget_archive {
	ul li > * {
		display: inline-block;
	}
}

/*  08.04.4 RSS Feed */
.widget_rss {
	.widget-title > a.rsswidget:first-child {
		display: none;
	}

	ul li {
		.rssSummary {
			line-height: 1.5em;
			text-transform: initial;
		}

		.rss-date {
			opacity: 0.7;
		}

		cite {
			font-size: 90%;
			opacity: 0.7;
			&:before {
				content: "by ";
			}
		}
	}
}

/*  08.04.5 Recent Posts */
.widget_recent_entries {
	ul.nav li {
		line-height: 1.5em;
		margin-bottom: 1em;
		
		> a {
			display: block;
			clear: right;
		}

		span {
			font-size: 12px;
		}
	}
}

/*  08.04.6 Recent Comments */
.widget_recent_comments {
	ul li {
		line-height: 1.5em;
		margin-bottom: 1em;
	}
}

/*  08.04.7 Product search */
.widget_product_search {
	input[type="submit"] {
		@include button();
		margin-top: 0.5em;

		.no-search-submit & {
			display: none;
		}
	}
}

/*  08.04.8 Product rating */
.widget_rating_filter {
	.wc-layered-nav-rating {
		margin-bottom: 4px;
		
		a {
			opacity: 0.7;
			@extend %simple-transition;
		}

		.star-rating {
			display: inline-block;
			height: 1em;
			@include transform(translateY(1px));
		}

		&.chosen a:after {
			@extend %ion;
			content: $ionicon-var-close;
			margin-left: 8px;
		}

		&.chosen a,
		a:hover {
			opacity: 1;
		}
	}
}

/*  08.04.9 Flickr images */
.flickr_badge_image {
	margin: 0 12px 12px 0px;
	width: 75px;
	height: 75px;
	float: left;
	background: none;
	padding: 0;
	img {
		border-radius: 5px;
	}
}

/* 08.04.10 Text widget (HTML) */
.widget_text {
	ul, ol {
		padding-left: 20px;
		margin-bottom: 16px;
	}

	ul {
		list-style: disc;

		li {
			list-style: disc;
		}
	}

	ol {
		list-style: decimal;

		li {
			list-style: decimal;
		}
	}

	li {
		&:last-child {
			padding-bottom: 0;
		}

		> ul,
		> ol {
			margin-bottom: 0;
		}
	}
}

/* 08.04.11 Image widget */
.widget_media_image {
	.image {
		margin: 0;
	}
}

/* 08.04.12 Video widget */
.widget_media_video {
	.wp-video.external-provider {
		&.youtube {
			.mejs-layers .mejs-overlay-button {
				display: none;
			}
		}

		&.vimeo {
			.mejs-layers .mejs-overlay-button {
				display: none;
			}	

			.mejs-controls {
				visibility: hidden;
			}
		}
	}
}
