/* 05.17. WordPress Widgets */

/* Select for all widgets */
.widget {
	select {
		padding: 8px 6px;
		border-radius: 2px;
		width: 100%;
		color: #666666;
		border-color: #dedede;
	}
}

/* Specific Select for Sidebar Widgets */
.sidebar {
	.widget {
		select {
			background: transparent;
		}
	}
}

/* Specific Select for Footer Widgets */
.footer {
	.widget {
		select {
			background: $light-color;
		}
	}
}

/* Custom Sidebar Menu */
.master-container,
.sidebar {
	.widget_nav_menu {
		ul {
			list-style: none;
			padding: 0;

			> li {
				margin: 2px 0;

				> a {
					font-size: 13px;
					transition: $primary-transition;
					display: block;
					background-color: #eeeeee;
					color: $text-color;
					font-family: $secondary-font;
					border-radius: 2px;
					padding: 18px 20px;

					&:hover {
						background-color: $primary-color;
						color: $dark-color;
						text-decoration: none;
					}

					&:active {
						background-color: darken($primary-color, 8);
						border-color: rgba(0,0,0,0.05);
						box-shadow: inset 0 1px 2px rgba(0,0,0,.125);
						color: $dark-color;
					}
				}

				&.current-menu-item > a {
					background-color: darken($primary-color, 5);
					color: $dark-color;
					text-decoration: none;
				}
			}
		}

		.sub-menu a {
			padding-left: 40px;
			font-size: 12px;
		}

		.sub-menu .sub-menu a {
			padding-left: 48px;
		}

		.sub-menu .sub-menu .sub-menu a {
			padding-left: 56px;
		}

		.sub-menu .sub-menu .sub-menu .sub-menu a {
			padding-left: 64px;
		}

		.sub-menu .sub-menu .sub-menu .sub-menu .sub-menu a {
			padding-left: 72px;
		}
	}
}

/* Custom Footer Menu */
.footer {
	.widget_nav_menu {
		ul {
			list-style: none;
			padding: 0;
			font-size: 15px;

			> li {
				> a {
					display: block;
					padding: 6px 0;
					color: $text-color;

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

			.sub-menu {
				padding-left: 10px;
			}
		}
	}
}

/* Widgets With Lists */
.widget_archive,
.widget_categories,
.widget_pages,
.widget_meta,
.widget_recent_comments,
.widget_recent_entries,
.widget_rss {
	ul {
		padding-left: 20px;
	}
}

/* Text Widget */
.widget_text {
	img {
		max-width: 100%;
		height: auto;
	}
}

/* Search Widget */
.widget_search {
	font-family: $primary-font;

	.screen-reader-text {
		display: none;
	}

	/* Default Search Widget */
	label.wp-block-search__label {
		@media (min-width: $screen-md-min) {
			float: none;
		}
	}

	label {
		width: 100%;

		@media (min-width: $screen-md-min) {
			float: left;
			width: 70%;
		}
	}

	.search-field {
		width: 100%;
		border: 1px solid #dddddd;
		background-color: #eeeeee;
		padding: 6px 5px 6px 10px;
		font-weight: normal;
		height: 40px;
		border-radius: 2px;

		@media (min-width: $screen-md-min) {
			border-top-right-radius: 0;
			border-bottom-right-radius: 0;
			border-right: none;
		}

		&:focus {
			background: #ffffff;
		}
	}

	.search-submit {
		width: 100%;
		height: 40px;
		background: $primary-color;
		border: 0;
		color: $dark-color;
		font-weight: bold;
		border-radius: 2px;
		transition: $primary-transition;

		@media (min-width: $screen-md-min) {
			border-top-left-radius: 0;
			border-bottom-left-radius: 0;
			width: 30%;
		}

		&:hover,
		&:focus {
			background: darken($primary-color, 6);
			outline: none;
		}
	}
}

// Widget Search for 404
.error-404 {
	.widget_search {
		width: 100%;
		margin: 0 auto;

		@media (min-width: $screen-md-min) {
			width: 300px;
		}
	}
}

/* Calendar Widget */
.widget_calendar {
	#wp-calendar {
		width: 100%;
	}

	caption {
		font-family: $secondary-font;
		background-color: $primary-color;
		border-radius: 2px;
		color: $dark-color;
		padding: 5px 0;
		font-size: 12px;
		text-align: center;
	}

	thead {
		tr {
			th {
				padding: 5px 0;
				text-align: center;
				background: #dedede;
				color: #666666;
				border: 1px solid $light-color;
			}
		}
	}

	tbody {
		tr {
			td {
				text-align: center;
				border: 1px solid $light-color;
				padding: 3px 0;
			}
		}
	}

	tfoot {
		tr {
			td {
				border-top: 1px solid #dedede;
				padding: 5px 5px;
			}

			#next {
				a {
					float: right;
				}
			}
		}
	}
}

/* Footer Specific Color for Calendar*/
.footer {
	.widget_calendar {
		tbody {
			tr {
				td {
					border: 1px solid #dedede;
				}
			}
		}
	}
}

/* Tag Cloud Widget */
.widget_tag_cloud {
	a {
		display: inline-block;
		background: $primary-color;
		padding: 5px 8px;
		margin: 2px 0;
		border-radius: 2px;
		color: #666666;
		transition: $primary-transition;

		&:hover {
			background: darken($primary-color, 6);
			color: $dark-color;
		}
	}
}
