* {
	box-sizing: border-box;
}

body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	margin: 0;
	padding: 1.5rem;
	background: #f4f4f6;
	font-family: system-ui, sans-serif;
	color: #1c1c22;
}

.recipe {
	width: min(30rem, 100%);
	padding: 2rem;
	border-radius: 1.5rem;
	background: #ffffff;
	box-shadow: 0 10px 30px -15px rgb(0 0 0 / 0.25);
}

.recipe-title {
	margin: 0 0 1.25rem;
	font-size: 1.75rem;
}

/* Three columns: the labels fill the first row, the panels span all three. */
.tabs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.25rem;
}

/* The radios stay in the page for keyboards, but out of sight. */
.tab-radio {
	position: absolute;
	opacity: 0;
}

.tab {
	padding: 0.625rem 0.75rem;
	border-radius: 999px;
	background: #f4f4f6;
	font-weight: 600;
	text-align: center;
	color: #6b6b76;
	cursor: pointer;
}

.tab:hover {
	color: #1c1c22;
}

/* + picks the label straight after the checked radio: the selected tab. */
.tab-radio:checked + .tab {
	background: #1c1c22;
	color: #ffffff;
}

.tab-radio:focus-visible + .tab {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}

/* A fixed minimum height stops the card jumping when panels change size. */
.tab-panel {
	display: none;
	grid-column: 1 / -1;
	min-height: 9rem;
	margin-top: 1.25rem;
	line-height: 1.6;
	color: #4b4b55;
}

/* ~ reaches any later sibling, so each checked radio shows its own panel. */
#tab-ingredients:checked ~ .panel-ingredients,
#tab-method:checked ~ .panel-method,
#tab-tips:checked ~ .panel-tips {
	display: block;
}

.tab-panel ul,
.tab-panel ol {
	margin: 0;
	padding-left: 1.25rem;
}

.tab-panel p {
	margin: 0;
}
