
/*----general formatting----*/

*, *::before {box-sizing: border-box; transition: all 0.2s ease-in-out; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out;}

body {
	margin: 0;
	font-family: var(--bodyfont);
	color: var(--text);
	background-color: var(--bg);
	font-size: 110%;
	padding: 50px 7.5%;
	background-image: var(--bgimage);
	display: flex;
	flex-flow: row wrap;
	justify-content: space-around;
}

a {
	text-decoration: underline;
	color: inherit;
}

a:hover {
	cursor: pointer;
}

p + ul {margin-top:-1em;}

li {
	margin: 1em 0;
	line-height:1.67em;
}

p {
	line-height:1.67em;
	margin-top: 0.2em;
}

h1, h2, h3, h4, h5, h6, nav a {
	font-family: var(--titlefont);
}

h1 {
	margin: 0 0 0.2em 0;
	font-size: 3em;
	font-weight: bolder;
	width:100%;
	display:flex;
	z-index:3;
	text-shadow: 0px 0px 3px var(--bg);
}

h2 {
	margin-top: 2em;
	font-size: 2em;
}

h3 {
	margin-top: 0.2em;
	font-size: 1.75em;
	font-weight: normal;
}

h1::before {
	content:'';
	flex-grow: 1;
	height: 0.85em;
	border-bottom: double 0.5em var(--text);
	margin-right:0.2em;
}

/*--------*/

/*----index----*/

#profile {
	width: 30%;
	min-width: 250px;
	height: auto;
	min-height: 189px;
	margin: 0;
	background-image: none, var(--mainimage);
	background-position: left top, center center;
	background-size: auto, cover;
	background-repeat: repeat, no-repeat;
	box-shadow: 2px 2px 5px rgba(var(--shadow),0.5);
	margin: 1.67em 0;
}

#main {
	width: 65%;
	min-width: 250px;
}

#main.index {
	width: 55%;
	min-width: 250px;
	padding-left: 5%;
	color: var(--text);
}

/*--------*/

/*----page content----*/

/*--grid--*/

.grid {
	display: flex;
	flex-flow: row wrap;
	justify-content: left;
}

.item {
	position:relative;
	margin: 10px;
	flex-grow: 1;
	min-width: 200px;
}

.item.bg, .item.text {padding: 10px 25px;}

.item.bg {background-color: rgba(var(--shadow), 0.5);}

.item.w1 {width:10%; min-width: 100px;}
.item.w2 {width:20%; min-width: 150px;}
.item.w3 {width:30%;}
.item.w4 {width:40%;}
.item.w5 {width:50%;}
.item.w6 {width:60%;}
.item.w7 {width:70%;}
.item.w8 {width:80%;}
.item.w9 {width:90%;}
.item.w10 {width:100%;}

.bg, .img {
/*------background: var(--grain);-----*/ /*---thanksaru---*/
	color: var(--pagetext);
	position: relative;
}

.bg img, .img img {
	width:100%; height:100%; 
	object-fit: cover;
	z-index:-2;
	position: relative;
}

.bg img {
	position:absolute; top:0; left:0;
}

/*--caption--*/

.caption {
	display: flex;
	flex-flow: row wrap-reverse;
	justify-content: space-evenly;
}

.caption.right {
	flex-flow: row-reverse wrap-reverse;
}

.img {
	width: 40%;
	height: auto;
	min-width: 250px;
	position: relative;
}

.caption .text {
	padding: 0 25px;
	width: 60%;
	flex-grow: 1;
}

/*--------*/

/*----navigation bar----*/

nav {
	display: flex;
	flex-flow: row wrap;
	justify-content: space-between;
	align-items: stretch;
	background-position: left top, center center;
	background-size: auto, cover;
}

nav a {
	display: inline-block;
	text-decoration: none;
	font-size: 1.5em;
	font-weight: bold;
	line-height: 1.67em;
	color: var(--pagetext);
	padding: 0.2em 1em;
	background-color: var(--accent);
	background-image: var(--grain);
	position:relative;
    flex-grow: 1;
}

nav a[href*="research"] { background-color: var(--research); }
nav a[href*="outreach"] { background-color: var(--outreach); }
nav a[href*="teaching"] { background-color: var(--teaching); }
nav a[href*="notes"] { background-color: var(--notes); }
nav a[href*="about-me"] { background-color: var(--aboutme); }

/*--index--*/

nav.index {
	flex-direction: column;
	margin-top: 1.67em;
	width: 80%;
	margin-left: 10%;
}

nav.index a::before {
	content: '';
	display:block;
	height: 1.67em; width: 1.67em;
	position: absolute; top:50%; left:0;
	margin-top:-0.84em;
	background: var(--text);
	border-radius: 100%;
	z-index:-1;
}

nav.index a {
	border-radius: 0; width: 100%;
	margin: 0 0 0 0;
}

nav.index a:first-of-type {border-radius: 1em 0 0 0;}
nav.index a:last-of-type {border-radius: 0 0 1em 0;}

nav.index a:hover {margin-left:2em; width:calc(100% - 2em); border-top-left-radius: 1em; border-bottom-left-radius: 1em;}

nav.index a:hover::before {left:-2em;}

nav.index a:active {margin-top: 1px; margin-bottom:calc(0.2em - 1px);}

/*--pages--*/

nav.page {
	width: 75%;
	margin-bottom:2em;
	text-align: center;
	align-items: flex-end;
}

nav.page a:first-of-type {
	margin-top:-1.67em;
	border-radius: 0 1em 0 0;
	font-size: 3em;
	position:relative; z-index:3;
}

nav.page a:last-of-type {
	border-radius: 0 0 1em 0;
	padding: 0.2em 1.2em 0.2em 0.8em;
}

nav.page a:not(:first-of-type):hover {background-color: var(--accent);}

/*--lite--*/

nav.lite {margin-top:-40px;}

nav.lite a:first-of-type {font-size: 1.5em; border-radius: 1em 0 0 0; margin-top: 0;}

nav.lite a:first-of-type:hover {background-color: var(--accent);}

nav.lite h1 {order: 10; margin: 1em 0 -0.5em 0; justify-content: center; border-bottom: solid 5px rgba(var(--shadow),0.5);}

nav.lite h1::before {content:none;}

/*--------*/


/*----media queries----*/

@media (max-width: 1100px) {
	nav.page a:first-of-type {font-size: 1.5em; border-radius: 1em 0 0 0; margin-top: 0;}
	h1 {margin-bottom: 0.2em;}
}

@media (max-width: 653px) {
	body {padding: 25px 50px;}
	h1 {text-align: center;}
	#main.index {width: 100%}

	nav.index {width:100%; margin-left:0; flex-flow: row wrap;}
	nav.index a {width:auto; flex-grow: 1; margin:0; border-radius: 0;}
	nav.index a:hover {width:auto; margin-left:0; background-color: var(--accent); border-radius:inherit;}
	nav.index a:first-of-type {border-radius: 1em 0 0 0;}
	nav.index a:last-of-type {border-radius: 0 0 1em 0;}
	nav.index a:hover::before {content:none;}

	nav.lite {margin-top:-15px;}
}