/**
 * Responsive layout for the jsn_metro_free template (home page tiles).
 *
 * 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. Selectors that must beat the widths the JSN framework prints
 * in <head> are prefixed with #jsn-master (the body id).
 */

/* =============== DESKTOP (original layout, 820px) =============== */
#jsn-logo-desktop {
	height: 26px;
	left: -100px;
	position: absolute;
}
#jsn-facts-logo {
	width: 430px;
	float: left;
}
#jsn-facts-right-menu {
	float: right;
	width: 200px;
	text-align: right;
	position: relative;
	top: 20px;
}
#jsn-facts-tiles {
	width: 820px;
	margin: 0 auto;
}
.jsn-facts-tile {
	width: 268px;
	height: 130px;
	float: left;
	position: relative;
	margin-left: 8px;
	background-color: #096;
}
#jsn-facts-tile1 {
	margin-left: 0;
	background-color: #209c9c;
}
#jsn-facts-tile2 {
	background-color: transparent;
}
#jsn-facts-tile4,
#jsn-facts-tile5,
#jsn-facts-tile6 {
	margin-top: 8px;
}
#jsn-facts-tile4 {
	width: 544px;
	height: 268px;
	margin-left: 0;
}
#jsn-brand {
	font-size: 11px;
}

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

/* =============== TABLET & PHONE =============== */
@media (max-width: 839px) {
	html {
		-webkit-text-size-adjust: 100%;
	}
	#jsn-master #jsn-page {
		min-width: 0;
	}
	#jsn-master #jsn-header-top,
	#jsn-master #jsn-header-bottom-inner,
	#jsn-master #jsn-pos-content-top,
	#jsn-master #jsn-footer-inner,
	#jsn-master #jsn-body-inner,
	#jsn-master #jsn-content-top {
		width: auto;
	}
	#jsn-header,
	#jsn-body-inner {
		padding-left: 12px;
		padding-right: 12px;
		box-sizing: border-box;
	}
	#jsn-logo {
		height: auto;
	}
	#jsn-logo-desktop {
		position: static;
		display: block;
		margin-left: -38px; /* the image has 38px of transparent space on the left */
	}

	/* Site title and icons */
	#jsn-facts-logo {
		width: auto;
		max-width: 100%;
	}
	#jsn-facts-logo img {
		display: block;
		max-width: 100%;
		height: auto;
	}
	#jsn-facts-right-menu {
		width: auto;
		top: 0;
		padding: 10px 0 8px;
		white-space: nowrap;
	}

	/* Tiles: slideshow first, then two columns */
	#jsn-facts-tiles {
		width: auto;
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-auto-flow: row dense;
		gap: 8px;
	}
	.jsn-facts-tile,
	#jsn-facts-tile1,
	#jsn-facts-tile4,
	#jsn-facts-tile5,
	#jsn-facts-tile6 {
		float: none;
		width: auto;
		margin: 0;
	}
	#jsn-facts-tile4 {
		order: -1;
		grid-column: 1 / -1;
		height: auto;
		overflow: hidden;
		background-color: transparent;
	}
	#jsn-facts-tile4 .camera_wrap {
		margin-bottom: 0 !important; /* set by camera.js for the pagination dots, which sit on the image */
	}
	#jsn-facts-tile6 {
		grid-column: 1 / -1;
	}

	#jsn-brand {
		padding: 12px 0 16px;
		line-height: 1.6;
	}
}

@media (max-width: 559px) {
	#jsn-facts-tiles {
		grid-template-columns: 1fr;
	}
}
