@import url('https://fonts.googleapis.com/css2?family=EB+Garamond&family=Libre+Franklin:wght@300&family=Roboto:wght@100;400;700&display=swap');

.light-theme {
	--clr-background: #f3f3f3;
	--clr-card: #fafafa;
	--clr-main: #000;
	--clr-sh1: #fff;
	--clr-sh2: #bebebe;
	--clr-alt: #535353;
}

.dark-theme {
	--clr-background: #252525;
	--clr-card: #2d2d2d;
	--clr-main: #fff;
	--clr-sh1: #2b2b2b;
	--clr-sh2: #1f1f1f;
	--clr-alt: #f0f0f0;
}

:root {
	--shadow: rgba(0, 0, 0, 0.45);
}

html {
	font-size: 0.8vw;
}

@media (max-width: 2000px) {
	html {
		font-size: 16px;
	}
}

@media (max-width: 450px) {
	html {
		font-size: 12px;
	}
}

body {
	font-family: 'Roboto', sans-serif;
	margin: 0;
	background-color: var(--clr-background);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 100vh;
	color: var(--clr-main);
}

* {
	box-sizing: border-box;
}

#app {
	font-size: 1rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 99vw;
	min-height: 90vh;
}

.search-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: transform ease-in-out 0.5s;
}

.search-box.empty {
	transform: translateY(40vh) scale(1.5);
}

.search-box > h1 {
	font-family: 'EB Garamond', serif;
	font-weight: 400;
	font-size: 1.75rem;
	margin: 1rem;
	text-align: center;
	text-transform: uppercase;
}

.search-box > h1 > span.small-caps {
	font-variant: all-small-caps;
}

.search-box > h1 > span.capitalize {
	text-transform: capitalize;
}

.search-container {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	background: var(--clr-card);
	border-radius: 1.4375rem;
	padding: 0.5rem 1rem;
	box-shadow: 0.25rem 0.25rem 0.375rem 0 var(--clr-sh1),
		-0.25rem -0.25rem 0.375rem 0 var(--clr-sh2),
		inset -0.25rem -0.25rem 0.375rem 0 var(--clr-sh1),
		inset 0.25rem 0.25rem 0.375rem var(--clr-sh2);
}

.search-container > input[type='text'] {
	font-size: 0.875rem;
	background: transparent;
	border: none;
	outline: none;
	color: var(--clr-main);
}

.search-container > svg {
	position: absolute;
	fill: var(--clr-main);
	width: 1.5rem;
	height: 1.5rem;
	right: 1rem;
}

.select-language {
	width: 4rem;
	text-transform: uppercase;
	margin-right: 2rem;
	background-clip: padding-box;
	border: 0.0625em solid transparent;
	background-color: var(--clr-card);
	color: var(--clr-main);
	text-align: end;
}

.results {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	list-style: none;
	padding: 0;
}

.results.empty {
	display: none;
}

.card {
	display: flex;
	flex-direction: column;
	width: 20rem;
	height: 33rem;
	overflow: hidden;
	margin: 1.5rem 2.5rem;
	border-radius: 0.75rem;
	background-color: var(--clr-card);
	color: var(--clr-main);
	border-radius: 1.25rem;
	box-shadow: 0 0.1875rem 1.25rem var(--shadow);
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease-out;
	text-decoration: none;
}

.image {
	height: 16rem;
	width: 100%;
}

.image > img {
	object-fit: cover;
	height: 100%;
	width: 100%;
	object-position: center 30%;
}

.image.default {
	display: flex;
	justify-content: center;
	align-items: center;
}

.image.default > svg {
	fill: url(#gradient-fill);
	width: 65%;
	height: auto;
}

.card:hover,
.card:focus {
	transform: scale(1.2);
	box-shadow: 0 1.875rem 1.25rem var(--shadow);
}

.text {
	padding: 1rem 2rem 2rem;
}

.text > h1 {
	display: block; /* Fallback for non-webkit */
	display: -webkit-box;
	margin: 0.3rem 0;
	font-size: 1.2rem;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	max-height: 3.5rem;
}

.description {
	margin: 0.3rem 0;
	color: gray;
	font-size: 0.8125rem;
	font-weight: 300;
	font-family: 'Libre Franklin', sans-serif;
}

.intro {
	font-size: 0.875rem;
	font-weight: 300;
	font-family: 'Libre Franklin', sans-serif;
}

.link-button {
	background-color: var(--clr-alt);
	padding: 0.75rem;
	display: none;
	margin: 1.5rem 1rem;
	color: var(--clr-card);
	text-decoration: none;
	font-size: 0.8125rem;
	border-radius: 1.25rem;
	box-shadow: 0 0.1875rem 1.25rem var(--shadow);
	font-weight: 300;
	font-family: 'Libre Franklin', sans-serif;
}

.search-box.empty .link-button {
	display: inline-block;
}

.right-side {
	position: fixed;
	display: block;
	right: 2rem;
	bottom: 2rem;
}

.switch-theme {
	padding: 1rem;
	border-radius: 50%;
	border: 0;
	z-index: 1;
	position: relative;
	cursor: pointer;
	box-shadow: 0 0.1875rem 1.25rem var(--shadow);
	background-color: #55514a;
}

.switch-theme > svg {
	width: 2.5rem;
	height: 2.5rem;
	fill: #fd9a1b;
	transition: transform 0.3s;
}

.switch-theme:hover > svg,
.switch-theme:focus > svg {
	transform: scale(1.2);
}

body.dark-theme .switch-theme {
	background-color: wheat;
}

.switch-theme::before {
	content: 'Switch to dark mode';
	position: absolute;
	display: block;
	right: 5rem;
	top: 1.75rem;
	width: 10rem;
	height: 1.2rem;
	border-radius: 0.125rem;
	font-size: 0.8125rem;
	color: var(--clr-background);
	/* background-color: #696969; */
	background-color: var(--clr-alt);
	opacity: 1;
	transition: transform 0.3s ease, opacity 0.3s ease;
	transform: translateX(1rem);
	opacity: 0;
}

body.dark-theme .switch-theme::before {
	content: 'Switch to light mode';
	/* background-color: #f5f5f5; */
}

.switch-theme:hover::before,
.switch-theme:focus::before {
	opacity: 1;
	transform: translateX(0);
}

footer {
	padding: 1rem;
	text-align: center;
}

footer > a {
	color: var(--clr-main);
}

/* Block Spinner */
.loading {
	width: 100%;
	height: 70vh;
	display: none;
	justify-content: center;
	max-height: 100%;
	align-items: center;
}

.loading.active {
	display: flex;
}

.spinner {
	width: 4rem;
}

.block {
	position: relative;
	box-sizing: border-box;
	float: left;
	margin: 0 0.5rem 0.5rem 0;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 0.1875rem;
	background: var(--clr-alt);
}

.block:nth-child(3n + 1) {
	animation: wave 2s ease 0s infinite;
}
.block:nth-child(3n + 2) {
	animation: wave 2s ease 0.2s infinite;
}
.block:nth-child(3n + 3) {
	animation: wave 2s ease 0.4s infinite;
	margin-right: 0;
}

@keyframes wave {
	0% {
		top: 0;
		opacity: 1;
	}
	50% {
		top: 1.875rem;
		opacity: 0.2;
	}
	100% {
		top: 0;
		opacity: 1;
	}
}
