/* full page */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Roboto', sans-serif;
	height: 100vh;
	font-size: 16px;
	line-height: 1.5;
	align-items: center;
	overflow-y: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* header: includes title, icon, and form */
header {
	position: absolute;
	top: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	gap: 0.5em;
	z-index: 2;
}

h1 {
	font-family: 'Oswald', sans-serif;
	font-size: 1.4rem;
	max-width: 450px;
	line-height: 1.1;
}

.title-ctn {
	width: 100%;
	padding: 1em;
	position: relative;
	z-index: 5;
	display: flex;
	align-items: center;
	flex-direction: row-reverse;
	gap: 1em;
}

/* container for form and toggle form button */
.search {
	width: 100%;
	position: relative;
	display: flex;
	justify-content: center;
	height: auto;
	overflow: hidden;
	transition: transform 300ms ease-out;
	padding-block-end: 3.5em;
}

.form-ctn {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.8em;
	width: 100%;
	padding: 2em;
	border-radius: 0.5em;
	background-color: #e7edef;
	padding: 2em;
}

.form-toggle {
	position: absolute;
	bottom: 4px;
	border: none;
	background-color: #e7edef;
	border-radius: 0.5em;
	transition: transform 300ms ease-out;
	z-index: 5;
	font-size: 1.1em;
	padding: 0;
	padding-block-end: 0.2em;
}

.closed {
	transform: translateY(-300px);
}

.closed>.form-ctn {
	padding-block-end: 1.4em;
}

/* overlay when form is in closed state */
.closed>.form-ctn::after {
	content: 'Find your way around RVCC';
	font-size: 1.1em;
	width: 100%;
	position: absolute;
	height: 83%;
	text-align: center;
	display: grid;
	align-items: end;
	justify-items: center;
	padding-block-end: 2em;
	left: 0;
	z-index: 3;
	background-color: #e7edef;
}

svg.arrow {
	transform: rotate(90deg);
	transition: transform 200ms ease;
	padding-inline: 0.5em;
}

/* change arrow direction based on form state */
.search.closed svg.arrow {
	transform: rotate(-90deg);
}

/* Style the canvas on screen*/

#underMap {
	display: none;
}

#outerMap-hidden {
	display: none;
}

#imgWrapper {
	display: grid;
	place-items: center;
}

#loadImg {
	position: absolute;

	animation: linear infinite;
	animation-duration: 4s;
	animation-name: rotate;
}

#hideLoad {
	display: none;
}

@keyframes rotate {
	from {
		transform: rotateZ(0deg);
	}

	to {
		transform: rotateZ(360deg);
	}
}

.predicative-search {
	position: relative;
}

.predicative-background,
.predicative-field {
	border: none;
	outline: none;
	height: 100%;
	font-family: inherit;
	font-size: inherit;
	width: 100%;
	padding: 0.75em 0.9em;
}

.predicative-background {
	position: absolute;
	color: #999999;
}

.predicative-field {
	position: relative;
	background: transparent;
	border: 1px solid black;
	border-radius: 0.2em;
}

.predicative-field:focus {
	box-shadow: 0 0 0 2px #84bb46;
}

/* user feedback for form entry error */
.searchError {
	position: absolute;
	top: 0;
	background: red;
	color: white;
}

.searchError-hidden {
	display: none;
}

/* buttons */
.search-btn {
	font-family: inherit;
	border: 1px solid black;
	border-radius: 0.2em;
	background-color: transparent;
	padding-block: 0.7em;
	cursor: pointer;
	font-size: 1.1rem;
	margin-block-start: 1em;
}

.search-btn:hover {
	background-color: #84bb46;
}

.search-btn:active {
	background-color: black;
	color: white;
}

.search-btn:focus {
	box-shadow: 0 0 0 2px #84bb46;
	outline: none;
}

button {
	color: black;
	cursor: pointer;
	padding: 0.3em;
	background-color: inherit;
	display: grid;
	place-items: center;
	border: none;
	transition: box-shadow 200ms ease;
	border-radius: 0.2em;
}

button>p {
	color: inherit;
}

/* button:hover {
	background-color: rgb(199, 218, 66);
} */

button:active {
	background-color: white;
}

button:focus {
	box-shadow: 0 0 0 2px black;
	outline: none;
}

/* accessibility input in form */
#accessibility {
	display: flex;
	align-items: center;
}

#accesibilityToggle {
	appearance: none;
	position: relative;
	height: 100%;
	width: 25px;
}

#accesibilityToggle:focus {
	outline: none;
}

#accesibilityToggle:focus+.accessibilityToggle::before {
	box-shadow: 0 0 0 2px #84bb46;
}

.accessibilityToggle {
	position: relative;
	cursor: pointer;
	display: flex;
	align-items: center;
}

.accessibilityToggle::before {
	content: '';
	position: absolute;
	left: -30px;
	height: 100%;
	width: 25px;
	border: 2px solid black;
	border-radius: 0.2em;
}

.accessibilityToggle::after {
	content: '';
	opacity: 0;
	position: absolute;
	left: -26px;
	height: 65%;
	width: 17px;
	border-radius: 0.2em;
	background-color: black;
}

#accesibilityToggle:checked+.accessibilityToggle::after {
	opacity: 1;
}

/* no animations for reduced motion preference */
@media (prefers-reduced-motion) {

	*,
	*::before,
	*::after {
		animation: none;
	}
}

/* container for buttons that show navigation steps */
.btn-ctn {
	position: absolute;
	bottom: 0;
	width: 100%;
	padding: 0.2em;
	display: flex;
	width: 100%;
	justify-content: space-around;
	background: rgb(134, 185, 64);
	background: linear-gradient(90deg,
			rgba(134, 185, 64, 1) 0%,
			rgba(134, 185, 64, 1) 52%,
			rgba(199, 218, 66, 1) 100%);
	border-block-start: 2px solid darkslategrey;
}

.link {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translate(-50%, 50%);
}

/* DESKTOP */
@media (min-width: 700px) {
	header {
		flex-direction: row;
		width: 100%;
		padding-block: 0;
		gap: 2em;
		align-items: start;
		justify-content: space-between;
	}

	.title-ctn {
		width: fit-content;
	}

	h1 {
		font-size: 1.5rem;
	}

	.search {
		max-width: 500px;
	}

	.canvas-ctn {
		padding: 5em;
		max-width: 1200px;
		display: grid;
		place-items: center;
	}

	.searchError {
		position: absolute;
		right: 0;
		z-index: 3;
	}

	button:hover {
		background-color: rgb(199, 218, 66);
	}
}

.img {
	width: 80px;
}