/* Styles relating to the map */

.close-map {
	position: fixed;
	right: 2%;
	top: 2%;
	z-index: 2;
}

.map-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-gap: .5rem;
	width: 100%;
	height: 100%;
	}

.map-grid a, .secondary-grid a {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	text-decoration: none;
	color: inherit;
	border-radius: 2px;
	grid-column: span 2;
	filter: brightness(1.0);
	transition: filter 0.3s;
}

.button-array {
	position: absolute;
	z-index: 99;
	right: 4%;
	top: 50%;
	transform: translateY(-50%);
}

.button-array span {
	transform: rotate(-45deg);
   margin-bottom: 0;
   text-transform: uppercase;
   font-family: var(--secondaryFont);
   letter-spacing: var(--secondaryFont-spacing);
   font-weight: 600;
   opacity: .8;
}

.button-array button {
	height: 75px;
	width: 75px;
	background-color: rgba(255,255,255,.25);
	transform: rotate(45deg);
	display: flex;
	justify-content: center;
	align-items: center;
	box-shadow: inset 0 0 30px var(--sand);
	position: relative;
	transition: background-color .3s linear;
}

.button-array button::after {
	display: block;
	content: '';
	height: 90px;
	width: 90px;
	border: 3px solid var(--earth);
	position: absolute;
	opacity: 0;
	transition: opacity .3s linear;
}

.button-array button:hover {
	background-color: rgba(255,255,255,.5);
}

.button-array button:hover::after {
 	opacity: .25;
}

.button-array .decorative-diamond {
	position: relative;
	height: 50px;
	width: 50px;
	border: 3px solid var(--earth);
	z-index: 1;
	transform: rotate(45deg);
	margin: auto;
	opacity: .15;
	pointer-events: none;
}

.modal::before {
	z-index: -5;
}

.modal::after {
	pointer-events: none;
}

/*==========Individual Grid Basics for Each Level===========*/

#unknown-grid, #scholar-grid, #egderus-grid, #ancients-grid {
	transition: opacity .6s ease-out, transform .6s ease-out;
	width: 80vw;
	height: 80vh;
	left: 5vw;
	top: 12vh;
}

#unknown-grid a::after, #scholar-grid a::after, #egderus-grid a::after, #ancients-grid a::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	box-shadow: inset 0px 0px 99px var(--sand);
	opacity: 0.3;
	z-index: -1;
}

.position-offscreen a::after {
	background-color: var(--white);
	transition: background-color 0.6s;
}

.position-1 a::after {
	background-color: var(--white);
	transition: background-color 0.6s;
}

.position-2 a::after {
	background: var(--sand3);
	transition: background-color 0.6s;
}

.position-3 a::after {
	background: var(--sand4);
	transition: background-color 0.6s;
}

.position-4 a::after {
	background: var(--sand4);
	transition: background-color 0.6s;
}

/*=============Styling for grid in each position*==============*/

/*this position exits the screen (comes toward visitor and disappears)*/
.position-offscreen {
	position: fixed;
	transform: scale(1.5);
	z-index: 2;
	opacity: 0;
	pointer-events: none;
}

/*whatever is directly in view/use by the visitor*/
.position-1 {
	position: fixed;
	transform: none;
	z-index: 1;
	opacity: .9;
}

.position-1 h3 {
	opacity: 1;
	transition: opacity 0.6s;
}

.position-2 {
	position: fixed;
	transform: scale(.8);
	margin: auto;
	z-index: -1;
	opacity: .6;
}

/*fade labels (for legibility)*/
.position-2 h3 {
	opacity: .2;
	transition: opacity 0.6s;
}

.position-3 {
	position: fixed;
	transform: scale(.7);
	opacity: .6;
	margin: auto;
	z-index: -2;
}

/*fade labels*/
.position-3 h3 {
	opacity: .1;
	transition: opacity 0.6s;
}

.position-4 {
	position: fixed;
	transform: scale(.6);
	margin: auto;
	opacity: .6;
	z-index: -3;
}

/*fade labels*/
.position-4 h3 {
	opacity: .1;
	transition: opacity 0.6s;
}

@media (min-width:401px) {

	/*custom mosaic styling for 400-600px*/

	#scholar-grid a:nth-child(3){
		grid-column: span 1;
	}

	#scholar-grid a:nth-child(4){
		grid-column: span 3;
	}

	#scholar-grid a:nth-child(5){
		grid-column: span 3;
	}

	#scholar-grid a:nth-child(6){
		grid-column: span 1;
	}

	#egderus-grid a:nth-child(3){
		grid-column: span 3;
	}

	#egderus-grid a:nth-child(4){
		grid-column: span 1;
	}

	#egderus-grid a:nth-child(7){
		grid-column: span 3;
	}

	#egderus-grid a:nth-child(8){
		grid-column: span 1;
	}

	#ancients-grid a:nth-child(2){
		grid-row: span 2;
	}

}

#map-container {
	display: grid;
	grid-template-columns: 4fr 1fr;
	grid-template-rows: 1fr 1fr 1fr;
	grid-gap: 1rem;
	overflow: hidden;
	padding: .5rem 5%;
	padding-top: .5rem;
}

#map-modal.modal::before {
	opacity: .85;
}

#map-modal.modal.age1::before {
	background-color: var(--sand);
	transition: background-color 0.6s;
}

#map-modal.modal.age2::before {
	background-color: var(--sand2);
	transition: background-color 0.6s;
}

#map-modal.modal.age3::before {
	background-color: var(--sand3);
	transition: background-color 0.6s;
}

#map-modal.modal.age4::before {
	background-color: var(--sand4);
	transition: background-color 0.6s;
}

#map-container main {
	height: 90vh;
	grid-row: span 3;
	font-size: 1.0rem;
	padding: 1.5rem 0 0 0;
}

.map-grid, .secondary-grid {
	grid-gap: 1rem;
}

.map-grid a:hover, .secondary-grid a:hover {
	filter: brightness(1.3);
	transition: filter 0.3s;
}

#map-container aside {
	display: block;
}

#map-container h2 {
	position: absolute;
	top: 2%;
	left: 5vw;
	z-index: 3;
	padding: 0.5rem 0;
	border-bottom: solid 1px black;
	height: 40px;
	font-size: 1.5em;
}

.secondary-grid {
	margin-bottom: 1rem;
}

.secondary-grid:nth-child(2) a:nth-child(1) {
	grid-row: span 2;
}

.secondary-grid a {
	grid-column: span 1;
}