:root {
	/* --background: hsl(20deg 5% 13%); */
	--background-body: hsl(20deg 5% 7%);
	--background-content: hsl(20deg 5% 11%);
	--background-nav: hsl(213deg 75% 35%);
	--background-search: hsl(213deg, 75%, 28%);
	--background-filters: hsl(213deg, 4%, 20%);
	--background-editor: hsl(213deg, 29%, 13%);
	--background-editor-panel: hsl(213deg, 29%, 19%);
	--background-input: hsl(213deg, 18%, 79%);
	--white: hsl(0 0% 100%);
	--white-10: hsl(0 0% 100% / 0.1);
	--white-20: hsl(0 0% 100% / 0.2);
	--white-50: hsl(0 0% 100% / 0.5);
	--white-70: hsl(0 0% 100% / 0.7);
	--black-20: hsl(0 0% 0% / 0.2);
	--black-30: hsl(0 0% 0% / 0.3);
	--black-70: hsl(0 0% 0% / 0.7);
	--grey-80: hsl(20deg 5% 80%);
	--grey-70: hsl(20deg 5% 70%);
	--grey-60: hsl(20deg 5% 60%);
	--blue: hsl(213deg, 69%, 60%);
	--blue-light: hsl(213deg, 69%, 75%);
	--green: hsl(144deg, 65%, 31%);
	--button: hsl(213deg 81% 40%);
	--button-hover: hsl(213deg 75% 49%);
	--error: hsl(355deg 100% 68%);
	--error-dark: hsl(355deg 58% 41%);
}

* {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

html {
	font-size: 10px;
	/* scroll-behavior: smooth; */
}

body {
	background: var(--background-body);
	color: #fff;
	font-family: 'Roboto', sans-serif;
	margin: 0;
	padding: 5.5rem 0 0 0;
}

.button {
	background-color: var(--button);
	border-radius: .3rem;
	cursor: pointer;
	padding: 1rem 2rem;
	font-size: 1.8rem;
	text-align: center;
	transition: background-color .2s ease-in-out;
	user-select: none;
}

.button:hover {
	background-color: var(--button-hover);
	transition: background-color .2s ease-in-out;
}


#search_cover,
#login_cover {
	display: none;
	width: 100vw;
	height: 100vh;
	position: fixed;
	top: 5.5rem;
	left: 0;
	background-color: var(--black-70);
}

/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** /////////////////////////////////////////////////////////////////////////////////  Nav  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

nav {
	font-size: 1.6rem;
	align-items: center;
	background: var(--background-nav);
	display: grid;
	grid-template-columns: auto max-content;
	height: 5.5rem;
	padding: 0 .7em;
	position: relative;
	user-select: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 4;
}

#all_recipes,
#search {
	display: inline-block;
	background: var(--black-20);
	border-radius: 30px;
	font-size: 1.6rem;
	font-family: 'Roboto', sans-serif;
	padding: .5em 1em;
	outline: none;
	border: none;
	color: #fff;
	vertical-align: middle;
	text-decoration: none;
	height: 34px;
	transition: all .2s ease-in-out;
}

#all_recipes {
	cursor: pointer;
	user-select: none;
}

#all_recipes:hover {
	background: var(--black-30);
	transition: all .2s ease-in-out;
}

#search_wrapper {
	display: inline-block;
	position: relative;
}

#search {
	width: 5.2em;
	transition: width .2s ease-in-out;
}

#search.active {
	width: 15em;
	padding: 0.5em 2.6em 0.5em 1em;
	transition: width .2s ease-in-out;
}

#search::placeholder {
	color: #fff;
	opacity: 1;
}

#search.active::placeholder {
	opacity: 0;
}

#search_clear {
	display: none;
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 4rem;
	text-align: center;
	cursor: pointer;
}

#search_clear svg {
	fill: var(--white-50);
	width: 40%;
	margin-top: .4rem;
	transition: all .2s ease-in-out;
}

#search_clear:hover svg {
	fill: var(--white);
	transition: all .2s ease-in-out;
}


.nav-button {}

.nav-button svg {
	fill: var(--white-50);
	transition: all .2s ease-in-out;
}

.nav-button:hover svg {
	fill: var(--white);
	transition: all .2s ease-in-out;
}

#menu_add, #menu_login {
	display: none;
}


/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** ////////////////////////////////////////////////////////////////////////  Recipes List  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

main {
	font-size: 1.8rem;
}

#recipes {
	width: 100rem;
	margin: 3rem auto;
	column-count: 2;
	column-gap: 3rem;
}

.recipes-list-category {
	margin-bottom: 3rem;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	break-inside: avoid;
}

.recipes-list-category.empty {
	display: none;
}

.recipes-list-label {
	color: var(--blue);
	font-family: 'Roboto Slab', sans-serif;
	font-size: 2.2rem;
	margin-bottom: 10px;
	font-weight: 700;
	user-select: none;
}

.recipes-list-recipes {}

.recipes-list-recipe {
	cursor: pointer;
	font-size: 1.8rem;
	left: -1rem;
	padding: .5rem 1rem;
	position: relative;
	transition: background .3s ease-in-out;
	user-select: none;
}

.recipes-list-recipe:hover {
	background: var(--white-10);
	border-radius: .5rem;
	transition: background .3s ease-in-out;
}

#filters {
	background: var(--background-filters);
	padding: 0.8rem;
	user-select: none;
}

.filter {
	background: var(--white-10);
	cursor: pointer;
	padding: 0.5rem 1.1rem 0.5rem 0.8rem;
	display: inline-block;
	border-radius: 0.5rem;
	margin-right: 0.3rem;
	transition: background .2s ease-in-out;
}

.filter:hover {
	background: var(--white-20);
	transition: background .2s ease-in-out;
}

.filter input {
	margin: 0 0.6rem 0 0;
	display: inline-block;
}

/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** //////////////////////////////////////////////////////////////////////////////  Recipe  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

article {
	font-size: 1.8rem;
	background: var(--background-content);
	border-radius: .5rem;
	display: none;
	margin: 3rem auto;
	max-width: 114rem;
	min-height: calc(100vh - 11.5rem);
	padding: 3rem 4rem;
}

article.not-found {
	min-height: unset;
}

#recipe {
	display: grid;
	grid-template-columns: 1fr 1.5fr;
	gap: 3rem;
}

article h1 {
	color: var(--blue);
	font-family: 'Roboto Slab', sans-serif;
	font-weight: 700;
	font-size: 3.6rem;
	margin: 0 0 1rem;
	grid-column: 1 / 3;
	grid-row: 1 / 2;
}

article h2 {
  color: var(--blue-light);
	font-family: 'Roboto Slab', sans-serif;
	font-size: 2.9rem;
	margin: 0 0 2rem;
}

article h3 {
  color: var(--blue-light);
	font-size: 2.3rem;
	margin: 3rem 0 2rem;
}

#details {
	grid-column: 1 / 3;
	grid-row: 1 / 2;
}

#ingredients {
	grid-column: 1 / 2;
	grid-row: 2 / 3;
}

#directions {
	grid-column: 2 / 3;
	grid-row: 2 / 3;
}

#directions > div {
	line-height: 1.35em;
}

#directions a {
	color: var(--blue);
	word-break: break-all;
}

.detail {
	color: var(--grey-60);
	font-size: 1.7rem;
	font-family: 'Roboto Slab', sans-serif;
	font-weight: 700;
	display: inline-block;
	margin-right: 2rem;
	margin-top: 1rem;
}

.detail span {
	color: var(--grey-80);
}

.tags {
	display: inline-block;
	margin-top: 1rem;
}

.tag {
	display: inline-grid;
	place-content: center;
	background: var(--white-10);
	width: 3rem;
	height: 3rem;
	border-radius: 100%;
	color: var(--white-70);
	font-size: 0.85em;
	font-weight: 500;
}

#ingredients p {
	padding: .4rem 1rem;
	margin: 0;
	position: relative;
	left: -1rem;
	line-height: 1.3em;
	min-height: 1.3em;
	transition: background .3s ease-in-out;
}

#ingredients p:hover {
	border-radius: .5rem;
	background: var(--white-10);
	transition: background .3s ease-in-out;
}

.amount {
	color: var(--grey-70);
}

.fraction {
	font-size: 2.4rem;
	vertical-align: bottom;
}

#directions p {
	margin: 2rem 0;
	line-height: 1.5em;
}

#directions li {
	margin-bottom: 2.5rem;
	counter-increment: list;
	list-style-type: none;
	position: relative;
}

#directions li:before {
	color: var(--grey-70);
	content: counter(list) ".";
	left: -32px;
	position: absolute;
	text-align: right;
	width: 26px;
}

#directions ol {
	padding: 0 0 0 1.9rem;
}


/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** /////////////////////////////////////////////////////////////////////// Search Results  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

#search_results {
	display: none;
	font-size: 1.6rem;
	position: fixed;
	top: 5.5rem;
	left: 12.5rem;
	width: 40rem;
	background-color: var(--background-search);
	border-radius: 0 0 .3rem .3rem;
}

.search-result {
	cursor: pointer;
	padding: 1.15rem 1.5rem;
	border-top: 1px solid var(--black-20);
	transition: background-color .2s ease-in-out;
}

.search-result:hover {
	background-color: var(--background-nav);
	transition: background-color .2s ease-in-out;
}

.search-result:last-child {
	border-radius: 0 0 .3rem .3rem;
}

.search-results-none {
	font-style: italic;
	padding: 1.15rem 1.5rem;
	border-top: 1px solid var(--black-20);
	color: var(--white-70);
}


/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** /////////////////////////////////////////////////////////////////////////////// Editor  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

#editor {
	display: none;
	font-size: 1.7rem;
	background: var(--background-editor);
	border-radius: .5rem;
	margin: 3rem auto;
	max-width: 150rem;
	min-height: calc(100vh - 11.5rem);
	padding: 3rem;
}

#editor .tox-tinymce {
	border: 0;
}

#editor_grid {
	display: grid;
	grid-template-columns: 1fr 1.5fr;
	gap: 2rem;
}

#editor_grid h1 {
	grid-column: 1 / 3;
	grid-row: 1 / 2;
	color: var(--blue);
	font-family: 'Roboto Slab', sans-serif;
	font-weight: 700;
	font-size: 3.3rem;
	margin: 0 0 1rem;
}

#editor_form {
	grid-column: 1 / 2;
	grid-row: 2 / 4;
	padding: 2rem;
}

#editor_ingredients {
	grid-column: 2 / 3;
	grid-row: 2 / 3;
}

#editor_directions {
	grid-column: 2 / 3;
	grid-row: 3 / 5;
}

#editor_save {
	grid-column: 1 / 2;
	grid-row: 4 / 5;
	margin: 0 2px 2px 2px;
	border-radius: 0.8rem;
}

#editor_ingredients > label,
#editor_directions > label {
	margin: 2rem 0 .5rem 2rem;
	display: inline-block;
	font-size: 1.9rem;
}

#editor_form input,
#editor_form select {
	font-size: 1.6rem;
	padding: 0.7rem 0.8rem;
	border-radius: 0.3rem;
	border: 0;
	outline: none;
	background: var(--background-input);
}

#editor_form input:focus {
	background: var(--white);
}

.editor-panel {
	background: var(--background-editor-panel);
	border: 2px solid #161f29;
	border-radius: 1rem;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: .5rem 1.5rem;
	margin-bottom: 2rem;
}

.form-row:last-child {
	margin-bottom: 0;
}

.form-row.double {
	grid-template-columns: 1fr 1fr;
}

.form-row.double label {
	grid-column: 1 / 3;
	grid-row: 1 / 2;
}

.input-checkboxes {
	margin-top: .5rem;
}

.form-input-checkbox {
	background: var(--background-input);
	color: #000;
	padding: 0.7rem;
	border-radius: 0.3rem;
	margin-right: 0.5rem;
	user-select: none;
	font-size: 1.6rem;
}


/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** //////////////////////////////////////////////////////////////////////////////// Login  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

#login {
	display: none;
	width: 300px;
	background: var(--background-editor-panel);
	font-size: 1.7rem;
	padding: 3rem;
	position: absolute;
	top: 8.5rem;
	left: 50%;
	transform: translateX(-50%);
	border-radius: 0.5rem;
	box-shadow: 0 1rem 3rem #000;
}

#login h2 {
	margin-top: 0;

}

#login input {
	background: var(--background-input);
	padding: 0.8rem 1rem;
	width: 100%;
	margin: 0.5rem 0 2rem 0;
	border-radius: 0.2rem;
	border: 0;
	font-size: 1.7rem;
}

#login_error {
	color: var(--error);
	display: none;
}


/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** ///////////////////////////////////////////////////////////////////////// Notification  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

#notification {
	display: none;
	position: absolute;
	top: 7.5rem;
	width: 90%;
	background: var(--green);
	left: 50%;
	transform: translateX(-50%);
	font-size: 1.7rem;
	padding: 1.7rem 2rem;
	border-radius: 0.8rem;
	max-width: 40rem;
	box-shadow: 0 0 0 3000px var(--black-30), 0 1rem 3rem #000;
	z-index: 5;
}

#notification.error {
	background: var(--error-dark);
}

#notification_title {
	font-size: 2.2rem;
}

#notification_text {
	margin-top: 1.5rem;
}

#notification_close {
	width: 4rem;
	height: 4rem;
	padding: 1.3rem 0 0 0.5rem;
	position: absolute;
	top: 0;
	right: 0;
}

#notification_close svg {
	width: 45%;
	fill: #fff;
}


/** ////////////////////////////////////////////////////////////////////////////////////////// */
/** ///////////////////////////////////////////////////////////////////////  Media Queries  // */
/** ////////////////////////////////////////////////////////////////////////////////////////// */

/*? // NOTE: Relative Units in media queries are always based off the initial root value (16) and ignore declared values */
/*? // NOTE: So REM units must be based on 16px instead of the 10px declared for the HTML attribute */

@media all and (max-width: 1570px) {
	#editor {
		border-radius: 0;
		margin: 0;
		max-width: unset;
		width: 100%;
		min-height: calc(100vh - 5.5rem);
		padding: 3rem 4rem;
	}
}

@media all and (max-width: 1200px) {
	body {
		background-color: var(--background-content);
	}

	article {
		margin: 0;
		width: 100%;
	}
}

@media all and (max-width: 1056px) {
	#recipes {
		column-count: 1;
		width: 50rem;
		padding: 0 3rem;
	}

	#editor_grid {
		grid-template-columns: 1fr;
	}

	#editor_grid h1 {
		grid-column: 1 / 2;
		grid-row: 1 / 2;
	}

	#editor_form {
		grid-column: 1 / 2;
		grid-row: 2 / 3;
	}

	#editor_ingredients {
		grid-column: 1 / 2;
		grid-row: 3 / 4;
	}

	#editor_directions {
		grid-column: 1 / 2;
		grid-row: 4 / 5;
	}

	#editor_save {
		grid-column: 1 / 2;
		grid-row: 5 / 6;
	}
}

@media all and (max-width: 850px) {
	#recipe {
		grid-template-columns: 1fr;
	}

	#details {
		grid-column: 1 / 2;
		grid-row: 1 / 2;
	}

	#ingredients {
		grid-column: 1 / 2;
		grid-row: 2 / 3;
	}

	#directions {
		grid-column: 1 / 2;
		grid-row: 3 / 4;
	}

	#editor {
		padding: 2rem;
	}
}

@media all and (max-width: 550px) {
	#search_results {
		left: 0;
		width: 100%;
	}

	#search.active {
		width: 10em;
	}

	article {
		padding: 2.5rem;
	}

	article h1 {
		font-size: 2.8rem;
	}

	#recipes {
		width: 100%;
	}
}

@media all and (max-width: 450px) {
	#editor {
		padding: 2rem 1rem;
	}

	#editor_form {
		padding: 1.5rem 1rem;
	}

	#editor_grid h1 {
		font-size: 3rem;
		margin: 0 0 .5rem 2rem;
	}
}

@media all and (max-width: 380px) {
	#fullscreen {
		display: none;
	}
}
