/* global variables */
:root {
	--color-bg: #e9e9e9;
	--color-bg-card: #fff;
	--color-bg-header: #1d1d1d;
	--color-btn-primary: #4e3aff;
	--color-btn-secondary: #0d8e4f;
	--color-error: #f22241;
	--color-success: #00a17b;
}

/* css reset */
/* Box sizing rules */
* *::before *::after {
	box-sizing: border-box;
}
/* Remove default margin */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ul,
ol,
dl,
dd {
	margin: 0 0 1.5rem;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
	list-style: none;
}
/* Set core root defaults */
html {
	line-height: 1.5;
	font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
		Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
html:focus-within {
	scroll-behavior: smooth;
}
/* Set core body defaults */
body {
	min-height: 100vh;
	text-rendering: optimizeSpeed;
	line-height: 1.5;
	margin: 0;
}
/* A elements that don't have a class get default styles */
a {
	text-decoration-skip-ink: auto;
	color: #36bf7f;
}
a:hover,
a:focus {
	color: #d96666;
}
/* Make images easier to work with */
img,
picture,
svg {
	max-width: 100%;
	display: block;
}
svg {
	fill: currentColor;
}
svg:not(:root) {
	overflow: hidden;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
	font: inherit;
}
/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
/* breakpoint small - 1.125 (Major Second) */
h1 {
	font-size: 2.027rem;
	font-weight: bold;
}
h2 {
	font-size: 1.802rem;
	font-weight: bold;
}
h3 {
	font-size: 1.602rem;
	font-weight: bold;
}
h4 {
	font-size: 1.424rem;
	font-weight: bold;
}
h5 {
	font-size: 1.266rem;
	font-weight: bold;
}
h6 {
	font-size: 1.125rem;
	font-weight: bold;
}
p {
	font-size: 1rem;
	font-weight: normal;
}
a {
	font-size: 1rem;
	font-weight: normal;
}
/* breakpoint medium - 1.2 (Minor Third) */
@media only screen and (min-width: 50rem) {
	h1 {
		font-size: 2.986rem;
	}
	h2 {
		font-size: 2.488rem;
	}
	h3 {
		font-size: 2.074rem;
	}
	h4 {
		font-size: 1.728rem;
	}
	h5 {
		font-size: 1.44rem;
	}
	h6 {
		font-size: 1.2rem;
	}
}
/* breakpoint large - 1.25 (Major Third) */
@media only screen and (min-width: 70rem) {
	h1 {
		font-size: 3.815rem;
	}
	h2 {
		font-size: 3.052rem;
	}
	h3 {
		font-size: 2.441rem;
	}
	h4 {
		font-size: 1.953rem;
	}
	h5 {
		font-size: 1.563rem;
	}
	h6 {
		font-size: 1.25rem;
	}
}

/* my css */
body {
	background: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: #fff;
}

.container {
	width: min(60rem, 100%);
	margin: 0 auto;
	text-align: center;
}

header {
	background: var(--color-bg-header);
	.container {
		padding-top: 2rem;
		padding-bottom: 1rem;
	}
}

section {
	padding: 2rem 0;
}

.search-bar {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 1rem;
	padding: 0 1rem;

	input {
		width: min(20rem, 100%);
	}
}

#display {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 1rem;
	padding: 0 1rem;
	text-align: left;
}

.card {
	height: 100%;
	background: var(--color-bg-card);

	border-radius: 0.5rem;
	overflow: hidden;

	display: flex;
	flex-direction: column;

	box-shadow: 0px 2px 14px 1px rgb(0 0 0 / 20%);

	transform: translateY(0);
	transition: transform 0.3s ease;

	img {
		margin: 0.25rem;
		border-radius: 0.3em;
	}

	p {
		margin: 2rem 1rem;
		text-align: center;
	}
}

.card:is(:hover, :focus) {
	cursor: pointer;
	transform: translateY(-0.5rem);
}

button {
	all: unset;
	min-width: 6rem;
	max-width: 12rem;
	text-align: center;
	padding: 0.25rem 1.5rem;
	border-radius: 1rem;
	background: var(--color-btn-primary);
	color: var(--color-bg);
	cursor: pointer;
}

.btn--secondary {
	background-color: var(--color-btn-secondary);
}

.remove {
	display: none;
}

.input-before {
	color: var(--color-btn-primary);
	font-size: 1.5rem;
}

.input-yes {
	color: var(--color-success);
	font-size: 1.5rem;
}

.input-no {
	color: var(--color-error);
	font-size: 1.5rem;
}

dialog {
	width: min(30rem, 100%);
	text-align: left;
	border: none;
	border-radius: 1rem;

	h2 {
		color: var(--color-bg-header);
		font-size: 2rem;
		text-align: center;
	}
}

.title-instruction {
	margin-top: 2rem;
	margin-bottom: 0.5rem;
	font-weight: bold;
}

::backdrop {
	background-color: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(0.5rem);
}

@media only screen and (min-width: 40rem) {
	#display {
		grid-template-columns: repeat(3, 1fr);
		padding: 0 2rem;
	}
	.search-bar {
		flex-direction: row;
	}
}

@media only screen and (min-width: 60rem) {
	#display {
		grid-template-columns: repeat(4, 1fr);
		padding: 0;
	}
}
