@import url("normalize.css");

/*** Base Element Styles ***/

* { 
	box-sizing: border-box;
}

body {
	background: white;
	color: black;
	font-family: sans-serif;
/* 	background: linear-gradient(lightgrey 0, white 128px); */
/* 	background-repeat: no-repeat; */
}

ul {
	margin: 0;
}

a {
	color: #808080;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/*** Base Layout Styles ***/

/* Navigation */

nav a {
	display: block;
	padding: 8px;
	margin: 4px;
	background-color: #eee;
	color: #444;
	font-size: 1.1em;
}

nav a:hover {
	color: #888;
	text-decoration: none;
}

nav ul {
	display: flex;
	flex-direction: column;
	list-style: none;
	padding: 0;
}

.help-nav ul {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
}

.help-nav li {
	white-space: nowrap;
	font-size: 0.85em;
}

.help-nav a {
	border-radius: 0.5em;
}

/* Layout Containers */

header {
	text-align: center;
	padding-top: 1em;
}

main {
	margin: 0 8px;
}

footer {
	font-size: 0.75rem;
	text-align: center;
	margin: 32px 0;
}

.centered {
	text-align: center;
	margin: 0 auto;
}

/* Apps */

.app {
	display: flex;
	margin-bottom: 2em;
}

.app-icon {
	margin-right: 0.75em;	
	margin-bottom: 0;
}

.app-header {
	margin: 0;	
}

.app-header a {
	color: black;
}

.app-header a:hover {
	color: #606060;
	text-decoration: none;
}

.app-desc {
 	margin-top: 0.25em;
}

.app-store-buttons {
	display: flex;
	flex-wrap: wrap;
}

.app-store-button {
	margin: 0 0.25em 0 0;
}

.app-store-button img {
	height: 4em;
}

.text-align-left {
	text-align: left;
}

.text-align-center {
	text-align: center;
}

.align-center {
	align-items: center;
}

.justify-center {
	justify-content: center;
}

.support-app {
	display: flex;
	margin-right: 2em;
	margin-bottom: 1em;
}

.app-icon-small {
	margin-right: 0.75em;	
	margin-bottom: 0;
	max-width: 37.5px;	/* half of the 75px image size */
}

/* App Page */

.app-summary {
	margin-bottom: 3em;
}

.app-summary-desc {
	width: 100%;
	text-align: center;
}

.app-summary-desc p {
	display: inline-block;
	margin-top: 0;
}

.app-title {
	display: flex;
	text-align: left;
	justify-content: center;
	align-items: center;
	margin: 1em;
}

.app-title h1 {
	margin: 0;
}

.slideshow {
	max-width: 100%;
	margin-bottom: 1em;
}

/* Support */

.support {
	text-align: center;
}

.support-item {
	width: 100%;
	display: inline-block;
	text-align: left;
	margin-bottom: 2em;
}

.support-item:last-child {
	margin-bottom: 1em;
}

.support-item p:last-child {
	margin-bottom: 0;
}

.support-item h2 {
	margin: 0;
}

.support-item ul {
	margin-top: 1em;
}

.support-item .ip {
	color: blue;
}

.support-item .port {
	color: red;
}

.support-item-img {
	display: block;
	margin: 1em auto;
	max-width: 100%;
}

/* FAQ */

.faq {
	margin-bottom: 1.5em;	
}

.faq:last-child {
	margin-bottom: 0;
}

.question {
	font-weight: bold;
	margin-bottom: 0.5em;
}

.question a {
	font-weight: normal;
}

.question:before {
	content: "» ";
}

.answer {
	margin-top: 0;
}

.ispy-buttons div {
	display: flex;
	align-items: center;
}

.ispy-buttons div p {
	margin: 0.5em;
}

/* Downloads */

.download-links {
	display: flex;
	flex-wrap: wrap;
}

.download-links div {
	margin-right: 2em;
}

.download-links div p {
	white-space: nowrap; 
}

/* Video  */
/* derived from https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php */
	
.you-tube-wrapper {
	max-width: 560px;
	margin: 0 auto;
}
	
.you-tube {
	margin-top: 1em;
	position: relative;
	padding-bottom: 66.67%;	/* width / height */
	height: 0;
}

.you-tube iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Help */

.help-item h4 {
	margin-bottom: 0.5em;
}

.help-item-img {
	display: block;
	margin: 1em auto;
	max-width: 100%;
}

.help-item-figures {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

figure {
	text-align: center;
}

figcaption {
	font-size: 0.75em;
	text-align: center;
	margin-top: 0.5em;
}

figure .help-item-img {
	margin-bottom: 0.5em;
}

.help-item table {
	border-collapse: collapse;
	margin: 0 auto;
}

.help-item th {
	background-color: #eee;
	padding: 0.75em;
}

.help-item td {
	text-align: center;
	border: 1px solid #eee;
	padding: 0.75em;
}

.help-item td p {
	margin: 0;
}

.feature-comparison {
	margin-top: 2em;
}

.no-bottom-margin {
	margin-bottom: 0;
}

.apple-watch-images {
	margin: 0 auto;
	text-align: center;
}

.apple-watch-images img {
	max-width: 32%;
}

/* ul */
.spaced li {
	margin-bottom: 1em;
}

.separated div:not(:last-child) {
	border-bottom: 1px solid lightgrey;
}

/* Contact */

.contact h3 {
	margin-bottom: 0.5em;
}

/* Front Page */

.fp-apps {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
}

.fp-apps div {
	width: 75px;
	margin: 0 0.5em;
}

.fp-apps p {
	margin-top: 0;
}

#fp-apps-break {
	flex-basis: 100%;
	width: 0;
	height: 0;
}

/* MJPEG URLs */

.urls form {
	border-top: 1px solid lightgrey;
	border-bottom: 1px solid lightgrey;
}

.urls form .baseUrl {
	width: 100%;
}

.urls form em {
	font-size: 0.8em;
}

.urls table {
	width: 100%;
	margin-bottom: 1em;
}

.urls table input {
	width: 100%;
}

.urls table .type {
	width: 1%;
	white-space: nowrap;
}

.smaller {
	font-size: 0.8em;
}

.red {
	color: red;
}

/* MJPEG Test URLs */

.url {
	margin-bottom: 2em;
}

.url img {
	min-width: 100px;
	max-width: 100px;
	min-height: 100px;
	max-height: 100px;
	border: 1px dashed lightgrey;
	margin-right: 0.5em;
}

.url iframe {
	width: 100px;
	height: 100px;
	border: 1px dashed lightgrey;
}


/* News */

.news em {
	white-space: nowrap;
}

.news em:before {
	content: "» ";
}

/* Page Elements */

/*** Media Queries ***/

@media (min-width: 481px) {
	header,
	main {
		width: 90%;
		margin: 0 auto;
	}
	
	nav ul {
		flex-direction: row;
		justify-content: center;
	}
	
	nav a {
		border-radius: 0.5em;
	}
	
/*
	.app-title h1 {
		flex-basis: auto;
	}
*/
	
	.app-summary-desc p {
		width: 90%;
	}
	
	.support-item {
 		width: 90%; 
	}
	
	.urls form .baseUrl {
		width: 432px;
	}
	
	.urls form table {
		width: 432px;		
	}
}

@media (min-width: 769px) {
	header {
		text-align: left;
	}
	
	nav ul {
		justify-content: start;
	}
	
	nav li {
		flex-grow: 1;
		text-align: center;
	}
	
	.help-nav ul li {
		flex-grow: 0;
	}
	
	.app-summary-desc p {
		width: 80%;
	}
	
	.slideshow {
		max-width: 80%;
	}
	
	.support-item {
 		width: 80%; 
	}
	
	#fp-apps-break {
		display: none;
	}
}

@media (min-width: 1025px) {
	header,
	main {
		width: 80%;
		max-width: 1150px;
	}
	
	.app-summary-desc p {
		width: 75%;
	}
	
	.support-item {
		width: 75%;	/* creates 12.5% margins on each side */
	}
	
	/* derived from https://css-tricks.com/full-width-containers-limited-width-parents/ */
	.help-nav {
		/* 12.5% / 75% = 16.67% of 75% = the 12.5% margin on each side */
		margin-left: -16%;
		margin-right: -16%;
	}
}

/*** Ads ***/

.logo {
	clear: left;
}

.ad-right {
	float: right;
	display: none;
	width: 320px;
	height: 50px;
}

.ad-center {
	display: block;
	margin: 12px auto;
	width: 320px;
	height: 50px;
}

/* Clearfix */

.group:after {
     content: "";
     display: table;
     clear: both; /* this is the key to clearing the floats */
}

/* Ad Media Queries */

/* 468 + 4px left & right margins, to match the nav bar */
@media(min-width: 476px) {
	.ad-center { width: 468px; height: 60px; }
}

@media(min-width: 769px) {
	.logo { float: left; }
	.ad-center { display: none; }
	.ad-right { display: block; 
		width: 320px; 
		height: 50px; 
		margin-top: 10px;	/* (logo.height(70) - ad.height(50)) / 2 */
	}	
}

@media(min-width: 800px) {
	.ad-right { 
		width: 468px; 
		height: 60px; 
		margin-top: 5px; 	/* ((logo.height(70) - ad.height(60)) / 2 */
	}
}

@media(min-width: 1225px) {
	.ad-right { 
		width: 728px;
		height: 90px;
		margin-top: 0px; 
		margin-bottom: 5px; 
	}
	
	.logo { 
		margin-top: 10px;	/* (ad.height(90) - logo.height(70) / 2 */
	}	
}
