/*general html elements*/
body {
	background-color: #001931;
	line-height: 150%;
	padding: 0;
	margin: 0;
	font-family: verdana;
}

h1 {
	text-align: center; /*lower hierarchies retain default alignment*/
	line-height: 150%
}

sup {
	font-size: 0.6em;
}

hr {
	border: none;
	border-top: 2px dotted #0067c6;
	color: #0067c6; /*needed for ::after below*/
	overflow: visible;
	text-align: center;
	height: 0;
	margin: 3em 0;
}

hr::after {
	background: #c0d9f1; /*needs to match background of parent element*/
	content: "L . I .";
	font-style: italic;
	font-weight: bold;
	font-family: serif;
	padding: 0 0.25em;
	position: relative;
	top: calc(2px - 1em); /*border thickness minus font size*/
}

a, a:link {
	text-decoration: none;
	color: #0067c6; /*blue*/
}

a:hover, a:active {
	text-decoration: underline;
	color: #c60067; /*red*/
}

a:hover img {
	outline: 0.5em solid #c60067; /*red*/
}

a:visited {
	color: #6700c6; /*purple*/
}

/*Navigation links*/
.links-head {
	text-align: center;
	list-style-type: none;
	padding: 0.5em 0;
	margin: 0;
}

.links-head li {
	display: inline-block;
	padding: 0.5em 0;
}
.links-head a li:hover {
	text-decoration: underline;
}

.links-head li:before {
	content: "[ ";
}

.links-head li:after {
	content: " ]";
}

.links-contents {
	padding-left: 1em;
}

.links-contents li {
	margin: 0.25em 0;
}

.links-icons {	
	width: 88px;
	margin: 0 0 0 calc(50% - 44px);
	padding: 0 0 0.5em 0;
}

.links-icons li {
	list-style-type: none;
	margin-bottom: 0.5em;
}

.links-icons img {
	width: 88px;
	height: 31px;
	display: block;
}

.links-icons a:hover {
	filter: brightness(120%); /*multiply each color channel in each pixel by this percentage, capping at FF. note that black and white are totally unchanged.*/
}

.pixel-art { /*nearest-neighbor upscaling*/
	image-rendering: -webkit-optimize-contrast; /*Safari (deprecated)*/
	image-rendering: pixelated; /*Chrome*/
	image-rendering: crisp-edges; /*Firefox*/
}

#left {
	width: 21em; /*336px @ default 16pt font*/
	left: 1em;
	position: absolute;
	display: inline-block;
}	

#right {
	width: calc(88px + 2em); /*7.5em or 120px @ default 16pt font*/
	right: 1em; /*shoves sidebar to the right edge*/
	position: absolute;
	display: inline-block;
}

#left h1, #right h1 {
	font-size: 1.25em;
}

#left p, #right p, #left li, #right li {
	font-size: 0.75rem;
}

#middle {
	width: calc(100% - 27em - 88px); /*= 100% - 32.5em or 100% - 520px at default 16pt font*/
	margin-left: 23em; /*#left width plus 2em*/
	position: absolute;
	display: inline-block;
}

.box {
	margin-bottom: 1em;
	padding: 0 1em; /*top and bottom padding rely on child elements*/
	background-color: #c0d9f1;
	border: 1px solid #0067c6;
	border-radius: 1.5em;
}

.box img {
	max-width: 100%;
	height: auto;
}

#header { /*properties mostly the same as for .box*/
	margin-bottom: 1em;
	padding: 0.5em 1em 0; /*bottom padding relies on child elements*/
	background-color: #c0d9f1;
	border-color: #0067c6;
	border-style: solid;
	border-width: 0 1px 1px;
	border-radius: 0 0 1.5em 1.5em; /*clockwise from top-left*/
}

.tooltip { /*add this class to a span tag around some text*/
    position: relative;
    text-decoration: underline dotted;
	cursor: help;
}

.tooltip span { /*nest a second span inside - it doesn't need its own class*/
    min-width: 15em; 
    top: 1em;
    left: 50%;
    padding: 0.5em;
    background-color: #c0d9f1;
	border: 1px solid #0067c6;
	border-radius: 0.75em;
	box-shadow: 0.25em 0.25em 0.5em #001931;
    position: absolute;
    z-index: 255;
    display: none;
}

.tooltip:hover span {
    display: block;
}

figcaption, .tooltip span {
	hyphens: auto;
}

/*For photo galleries. Use with <ul>. First <li> can have header and fig caption if you want*/
.gallery {
	list-style: none;
	display: grid;
	grid-auto-flow: row;
	align-items: start;
	grid-gap: 0.5em;
	gap: 0.5em;
	padding-left: 0; /*<ul> has padding-left but not right set by default*/
}

.gallery {
	grid-template-columns: repeat(auto-fit, minmax(28em, 1fr));
}

.gallery img, .gallery figcaption {
	margin-left: calc(50% - 13.5em);
	width: 27em;
}

.gallery li {
	padding: 0.5em;
	text-align: left;
}

/*Single-column layout*/
@media(max-width: 79em) { /*1264px @ default 16pt font*/
	.box {
		position: relative;
		margin: 1em 0;
	}
	
	#left {
		left: 0;
	}

	#left, #middle {
		width: 90%;
		margin: 0 5%;
		position: relative;
	}
	
	#right {
		right: 0;
		width: 100%;
		margin: 0;
		position: relative;
	}

	#right .box { /*using the #header style flipped vertically*/
		margin-bottom: 0;
		padding: 0.5em 1em 0; /*bottom padding relies on child elements*/
		border-width: 1px 1px 0;
		border-radius: 1.5em 1.5em 0 0; /*clockwise from top-left*/
	}

	#avatar {
		max-width: calc(5.4rem - 3px); /*magic number for three p tags at 0.75rem with associated top and bottom margins subtracting 1px-thick border and then another px for potential rounding issues*/
	}
	.links-icons {
		text-align: center;
		list-style-type: none;
		padding: 0;
		margin: 0;
		width: 100%;
		font-size: 0;
	}
	
	.links-icons li {
		display: inline-block;
		padding: 0;
		margin: 0.5em 0.25em;
		line-height: 100%;
	}
	
	.links-icons a {
		background-color: #ff0000;
		line-height: 100%;
	}
}

/*For phone viewports and NTSC width, remove side margins*/
@media(max-width: 450px), (max-width: 39em) { /*= 624px @ default 16pt font*/
	#left, #middle {
		width: 100%;
		margin: 0;
	}

	.links-contents li { /*phone screens are small so increase the vertical spacing to make the small links easier to hit*/
		margin: 1.25em 0;
	}

	.gallery {
		grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
	}

	.gallery img, .gallery figcaption {
		margin-left: 0;
		width: 100%;
	}

	.gallery li {
		padding: 0;
	}
}

/*cheat sheet for color gradient:

ffffff ====== white
dfecf8
c0d9f1 ==
a0c7ea
81b4e3 ====
61a1dc
428ed5 ==
227bce
0067c6 ====== pantone 300c
0059ac
004c93 ==
00407b
003362 ====
00264a
001931 ==
000d19
000000 ====== black

*/