:root {
	--main-box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.17);
	--main-brown-color: hsl(26, 50%, 80%);
	--main-border-radius: 10px;
	--dropdown-border-radius: 7px;
	--form-elements-border-radius: 5px;
}

* {
	margin: 0;
}

body {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	background-color: hsl(26, 55%, 92%);
	-webkit-tap-highlight-color: transparent;
}

nav {
	position: sticky;
	top: 0;
	z-index: 1;
	background-color: hsl(26, 45%, 65%);
	box-shadow: 0 2px 3px hsla(0, 0%, 0%, 0.2);
}

#nav-content {
	display: flex;
	max-width: 1000px;
	margin: 0 auto;
	padding: 12px clamp(12px, -21.333px + 8.333vw, 62px);
	box-sizing: border-box;
}

#nav-content #logo {
	padding: 0 15px 0 0;
}

#logo img {
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	vertical-align: middle;
	border-radius: 8px;
	box-shadow: 1.5px 1.5px 1.5px hsla(0, 0%, 0%, 0.23);
}

.dropdown {
	position: relative;
	display: flex;
	align-self: center;
	height: min-content;
	font-size: 17px;
	cursor: default;
}

.dropdown-text {
	display: flex;
	height: fit-content;
	align-self: center;
	padding: 10px 15px;
	border-radius: var(--dropdown-border-radius);
}

.dropdown .dropdown-text {
	transition: background-color 0.15s 0.1s ease-out;
}

.dropdown:hover > .dropdown-text {
	background-color: hsl(26, 40%, 55%);
}

.dropdown:not(:hover) .dropdown-text {
	transition: background-color 0.15s 0.1s ease-in;
}

.dropdown-text::after {
	align-self: center;
	content: "";
	background-image: url(/images/caret-down.svg);
	min-width: 18px;
	min-height: 18px;
	margin-left: 5px;
}

.dropdown-content {
	visibility: hidden;
	opacity: 0;
	position: absolute;
	left: 0;
	bottom: 0;
	transform: translateY(100%);
	padding: 10px;
	background-color: hsl(26, 40%, 75%);
	border-radius: var(--dropdown-border-radius);
	box-shadow: 0 3px 5px hsla(0, 0%, 0%, 0.2);
	transition: 0.15s 0.1s ease-in;
}

.dropdown:hover > .dropdown-content {
	visibility: visible;
	opacity: 1;
	transition: 0.15s 0.1s ease-out;
}

.dropdown-content a {
	display: inline-block;
	box-sizing: border-box;
	width: 100%;
	padding: 10px;
	white-space: nowrap;
	border-radius: var(--dropdown-border-radius);
}

#content {
	max-width: 1000px;
	margin: 0 auto;
	padding: 35px clamp(12px, -21.333px + 8.333vw, 62px);
	box-sizing: border-box;
}

section {
	margin: 15px 0 25px;
	padding: 12px 15px;
	border-radius: var(--main-border-radius);
	background-color: hsl(0, 0%, 100%);
	box-shadow: 0 2px 1px 1px hsla(0, 0%, 0%, 0.12);
}

h1 {
	font-size: 30px;
	margin-bottom: 17px;
}

h2 {
	margin: 50px 0 17px;
}

p {
	margin: 20px 0;
	line-height: 1.6;
}

a {
	text-decoration: none;
	color: hsl(0, 0%, 0%);
	transition: background-color 0.1s;
}

.card-table {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
	gap: 20px;
}

.card {
	display: flex;
	align-items: center;
	gap: 17px;
	padding: 15px 20px 15px 15px;
	border-radius: var(--main-border-radius);
	color: hsl(0, 0%, 0%);
	background-color: var(--main-brown-color);
	box-shadow: var(--main-box-shadow);
}

.card .calculator-example {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 68px;
	height: 68px;
	font-weight: bold;
	line-height: 1.4;
	padding: 5px;
	border-radius: var(--main-border-radius);
	background-color: hsl(26, 45%, 67%);
	box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.23);
	transition: background-color 0.1s;
}

.card .calculator-example img {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 55px;
	height: 55px;
}

.top-left,
.top-right,
.bottom-left,
.bottom-right {
	position: absolute;
	font-size: 17.5px;
}

.top-left {
	top: 3px;
	left: 10px;
}

.top-right {
	top: 3px;
	right: 10px;
}

.bottom-left {
	bottom: 3px;
	left: 10px;
}

.bottom-right {
	bottom: 3px;
	right: 10px;
}

.card h3 {
	font-size: 20px;
	margin-bottom: 10px;
}

.card p {
	line-height: 1.4;
	margin: 0;
}

form {
	width: fit-content;
	margin: 15px auto 25px;
	padding: 20px 20px 15px;
	border-radius: var(--main-border-radius);
	background-color: var(--main-brown-color);
	box-shadow: var(--main-box-shadow);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
	display: none;
}

form input {
	width: 90px;
	text-align: center;
	font-size: 20px;
	appearance: textfield;
	-moz-appearance: textfield;
	background-color: hsl(0, 0%, 99%);
	border: 1px solid hsl(0, 0%, 0%);
	border-radius: var(--form-elements-border-radius);
	box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.15);
}

form input:focus,
form select:focus {
	outline: 1px solid hsl(0, 0%, 0%);
}

form .numerator input {
	box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.08);
}

select {
	margin: 0 10px;
	padding: 0 3px;
	font-size: 20px;
	vertical-align: middle;
	border: 1px solid hsl(0, 0%, 0%);
	border-radius: var(--form-elements-border-radius);
	background-color: hsl(0, 0%, 99%);
	box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.15);
}

form .whole-number {
	margin-right: 7px;
}

form .numerator {
	padding-bottom: 6px;
}

form .denominator {
	padding-top: 6px;
}

.fraction {
	display: inline-flex;
	flex-direction: column;
	text-align: center;
}

#submit-button {
	display: block;
	margin: 20px auto 0;
	padding: 8px 10px;
	font-size: 18px;
	color: hsl(0, 0%, 100%);
	background-color: hsl(225, 95%, 42%);
	border: none;
	border-radius: var(--form-elements-border-radius);
	box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.22);
}

#submit-button:focus {
	outline: none;
}

.numerator {
	border-bottom: 2px solid;
	padding: 0 2px;
}

.numerator,
.denominator,
.sign {
	font-size: 17.5px;
}

.whole-number {
	margin-right: 2px;
}

.whole-number,
.fraction {
	vertical-align: middle;
}

.sign {
	vertical-align: middle;
	margin: 0 2px;
}

#message {
	display: none;
	width: fit-content;
	margin: 15px auto 20px;
	padding: 5px 10px;
	text-align: center;
	font-weight: bold;
	background-color: var(--main-brown-color);
	border: 3px solid hsl(0, 100%, 50%);
	border-radius: var(--main-border-radius);
	box-shadow: 2px 2px 1.5px hsla(0, 0%, 0%, 0.25);
}

.calculator-button {
	display: block;
	width: fit-content;
	margin: 20px 0 25px;
	padding: 10px 12px;
	text-align: center;
	font-size: 18px;
	font-weight: bold;
	background-color: var(--main-brown-color);
	border-radius: var(--main-border-radius);
	box-shadow: var(--main-box-shadow);
}

form + .calculator-button {
	margin: 20px auto 25px;
}

section h3 {
	margin-bottom: 10px;
}

ul {
	padding-left: clamp(30px, 23.333px + 1.667vw, 40px);
	margin: 20px 0;
}

ul li {
	line-height: 1.6;
	margin-bottom: 12px;
}

#explanation p {
	margin: 10px 0;
}

#explanation h3 {
	margin-top: 35px;
}

#sitemap-links a {
	display: block;
	width: fit-content;
	margin: 12px 0;
}

#sitemap-links h3 {
	margin-top: 30px;
}

#bottom-card-table {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 16px;
	margin-top: 25px;
}

#bottom-card-table a {
	width: auto;
	margin: 0;
}

footer {
	padding: 12px 0;
	text-align: center;
	background-color: hsl(26, 35%, 30%);
}

footer * {
	color: hsl(0, 0%, 100%);
}

footer a {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 10px;
}

.ad:has(ins.adsbygoogle) {
	margin: 25px 0;
}

/* .ad:not(:has(ins.adsbygoogle)) {
	margin: 25px 0;
	height: 200px;
	background-color: black;
} */
p:first-child,
ul:first-child,
#explanation h3:first-child,
#explanation p:first-child,
#sitemap-links a:first-child {
	margin-top: 0;
}

p:last-child,
ul:first-child,
section:last-child,
ul li:last-child,
.calculator-button:last-child,
#explanation p:last-child,
#sitemap-links a:last-child,
.ad:last-child {
	margin-bottom: 0;
}

@media (hover) {
	.dropdown-content a:hover {
		background-color: hsl(26, 36%, 65%);
	}

	.card:hover {
		background-color: hsl(26, 48%, 72%);
	}

	.card:hover .calculator-example {
		background-color: hsl(26, 43%, 59%);
	}

	#submit-button:hover {
		background-color: hsl(225, 97%, 34%);
	}

	.calculator-button:hover {
		background-color: hsl(26, 48%, 72%);
	}

	#sitemap-links a:hover {
		color: hsl(225, 100%, 35%);
	}

	footer a:hover {
		background-color: hsl(26, 45%, 20%);
	}
}

@media (max-width: 600px) {

	.mixed-number,
	.mixed-number + select {
		display: block;
	}

	.mixed-number + select {
		margin: 20px auto;
	}
}

@media (max-width: 400px) {
	.dropdown-content a {
		white-space: normal;
	}

	form {
		display: flex;
		flex-direction: column;
	}

	select {
		width: fit-content;
		margin: 20px auto;
	}

	.mixed-number input {
		width: clamp(28px, -53.84px + 49.6vw, 90px);
	}
}