/**
 * Responsive layout for the yuntecher template.
 *
 * The desktop rules below are the values that used to be inline styles in index.php,
 * so wide screens look exactly as before. The media queries adapt the layout for
 * tablets and phones.
 */

/* =============== DESKTOP (original layout, 820px) =============== */
#jsn-logo {
	margin: 0 auto;
}
#jsn-logo-desktop {
	height: 26px;
	position: relative;
	left: -85px;
}
#yuntecher_logo img {
	margin-left: 20px;
	position: relative;
	margin-top: 36px;
}
#jsn-facts-right-menu {
	float: right;
	width: 200px;
	text-align: right;
	position: relative;
	top: 70px;
	right: 15px;
}
#randomimage {
	width: 820px;
	height: 270px;
	position: relative;
	float: left;
}
#main {
	background-color: #3d3d3d;
	margin-top: 9px;
}
#rwd-menu-toggle {
	display: none;
}
#menu_area {
	width: 202px;
	min-height: 480px;
	position: relative;
	float: left;
	padding: 0 0 10px 5px;
	background-color: #3d3d3d;
}
#main_area {
	width: 589px;
	min-height: 480px;
	float: left;
	position: relative;
	padding: 0 10px 10px 14px;
	background-color: #fff;
}
#featured_spotlight {
	width: 630px;
	height: 255px;
	position: relative;
	float: left;
	padding-left: 14px;
}
#featured_news,
#featured_hotmenu {
	height: 240px;
	float: left;
	position: relative;
}
#featured_news {
	width: 416px;
}
#featured_hotmenu {
	width: 312px;
}
#yuntecher-footer {
	color: #fff;
	font-size: 12px;
	text-align: center;
}
#yuntecher-footer span {
	top: 4px;
	position: relative;
}

/* The YunTech logo sticks out 85px to the left of the 820px page. */
@media (max-width: 999px) {
	#jsn-logo-desktop {
		left: 0;
	}
}

/* =============== TABLET & PHONE =============== */
@media (max-width: 839px) {
	html {
		-webkit-text-size-adjust: 100%;
	}
	#all {
		width: auto;
		padding-top: 12px;
	}
	#jsn-logo {
		padding: 0 12px;
	}
	#jsn-logo-desktop {
		max-width: 100%;
		height: auto;
		margin-left: -38px; /* the image has 38px of transparent space on the left */
	}

	/* Header: site title on the left, icons on the right, wrapping on narrow screens */
	#header {
		display: flex !important;
		flex-wrap: wrap;
		align-items: flex-end;
		justify-content: space-between;
		padding: 12px 12px 10px;
	}
	#yuntecher_logo {
		float: none;
		width: auto;
		height: auto;
		max-width: 100%;
	}
	#yuntecher_logo img {
		display: block;
		margin: 0;
		max-width: 100%;
		height: auto;
	}
	#jsn-facts-right-menu {
		float: none;
		width: auto;
		position: static;
		margin-left: auto;
		padding-top: 8px;
		white-space: nowrap;
	}
	[class^="Belt_"] {
		display: none;
	}

	#randomimage {
		float: none;
		width: auto;
		height: auto;
	}
	#randomimage img {
		display: block;
		width: 100%;
		height: auto;
	}

	#main {
		float: none;
		width: auto;
		margin-top: 0;
	}

	/* Side menu becomes a collapsible panel */
	#rwd-menu-toggle {
		display: block;
		width: 100%;
		margin: 0;
		padding: 12px 16px;
		border: 0;
		background: #2b2b2b;
		color: #fff;
		font: inherit;
		font-size: 16px;
		text-align: left;
		cursor: pointer;
	}
	#rwd-menu-toggle::after {
		content: "";
		float: right;
		margin-top: 7px;
		border: 6px solid transparent;
		border-top-color: #fff;
	}
	.rwd-menu-open #rwd-menu-toggle::after {
		margin-top: 1px;
		border-top-color: transparent;
		border-bottom-color: #fff;
	}
	#menu_area {
		display: none;
		float: none;
		width: auto;
		min-height: 0 !important; /* overrides auto_full_height.js */
		padding: 8px 12px 4px;
	}
	.rwd-menu-open #menu_area {
		display: block;
	}
	#menu_area ul#je_accmenu a {
		padding-top: 10px;
		padding-bottom: 10px;
	}

	#main_area {
		float: none;
		width: auto;
		min-height: 300px;
		padding: 4px 12px 16px;
		overflow-wrap: break-word;
	}
	#featured_spotlight,
	#featured_news,
	#featured_hotmenu {
		float: none;
		width: auto;
		height: auto;
		min-height: 240px;
		padding: 0;
		background-size: cover;
	}

	/* Article content */
	#main_area img {
		max-width: 100%;
		height: auto;
	}
	#main_area iframe,
	#main_area video,
	#main_area embed,
	#main_area object {
		max-width: 100%;
	}
	/* Wide tables scroll sideways inside a wrapper added by rwd.js */
	#main_area .rwd-table-scroll {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	#main_area .rwd-table-scroll > table {
		height: auto !important;
	}
	#main_area .rwd-table-scroll td,
	#main_area .rwd-table-scroll th {
		min-width: 3.5em;
	}

	#yuntecher-footer {
		width: auto;
		height: auto;
		padding: 10px 12px;
		line-height: 1.5;
	}
	#yuntecher-footer span {
		top: 0;
	}
}
